Skip to content

Commit

Permalink
Add REST shield.svg docs (RocketChat#913)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosSpessatto authored and MartinSchoeler committed Sep 11, 2018
1 parent f20056a commit 6b179e3
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 1 deletion.
1 change: 1 addition & 0 deletions _data/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@
- Miscellaneous:
- directory
- info
- shield.svg
- spotlight
- statistics
- statistics.list
Expand Down
1 change: 1 addition & 0 deletions contributing/documentation/documentation-map/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ Here you can also find what articles are incomplete and missing.
- Miscellaneous:
- directory
- info
- shield.svg
- spotlight
- statistics
- statistics.list
Expand Down
1 change: 1 addition & 0 deletions developer-guides/rest-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and
| :------------------------ | :-------------------------------------------------------- | :------------------------------------- |
| `/api/v1/info` | Information about the Rocket.Chat server. | [Link](miscellaneous/info/) |
| `/api/v1/directory` | Search by users or channels on all server. | [Link](miscellaneous/directory/) |
| `/api/v1/shield.svg` | Gets the shield svg(badge) to add in your website. | [Link](miscellaneous/shield-svg/) |
| `/api/v1/spotlight` | Searches for users or rooms that are visible to the user. | [Link](miscellaneous/spotlight/) |
| `/api/v1/statistics` | Statistics about the Rocket.Chat server. | [Link](miscellaneous/statistics/) |
| `/api/v1/statistics.list` | Selectable statistics about the Rocket.Chat server. | [Link](miscellaneous/statistics-list/) |
Expand Down
3 changes: 2 additions & 1 deletion developer-guides/rest-api/miscellaneous/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Just some generic information, such as information about the server and authenti
| Url | Short Description | Details Page |
| :--- | :--- | :--- |
| `/api/v1/directory` | Search by users or channels on all server. | [Link](directory/) |
| `/api/v1/info` | Information about the Rocket.Chat server. | [info](info/) |
| `/api/v1/info` | Information about the Rocket.Chat server. | [Link](info/) |
| `/api/v1/shield.svg` | Gets the shield svg(badge) to add in your website. | [Link](shield-svg/) |
| `/api/v1/spotlight` | Searches for users or rooms that are visible to the user. | [Link](spotlight/) |
| `/api/v1/statistics` | Statistics about the Rocket.Chat server. | [Link](statistics/) |
| `/api/v1/statistics.list` | Selectable statistics about the Rocket.Chat server. | [Link](statistics-list/) |
60 changes: 60 additions & 0 deletions developer-guides/rest-api/miscellaneous/shield-svg/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Shield SVG

A simple method, requires no authentication, that returns the shield svg(badge) to add in your website. It must have `API_Enable_Shields` enabled.

| URL | Requires Auth | HTTP Method |
| :--- | :--- | :--- | :--- |
| `/api/v1/shield.svg` | `no` | `GET` |

## Query Parameters

| Argument | Example | Required | Description |
| :--- | :--- | :--- | :--- |
| `type` | `online` | Optional | Can be one of `online`, `user`, `channel`
| `icon` | `false` | Optional |
| `channel` | `general` | Optional | Name of the channel
| `name` | `Rocket.Chat` | Optional | Name to show

## Example Call

```bash
curl http://localhost:3000/api/v1/shield.svg
```

## Example Result

### Headers

`Content-Type`: `image/svg+xml;charset=utf-8`

### Body

```
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="141" height="20">
<linearGradient id="b" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<mask id="a">
<rect width="141" height="20" rx="3" fill="#fff"/>
</mask>
<g mask="url(#a)">
<path fill="#555" d="M0 0h67v20H0z"/>
<path fill="#4c1" d="M67 0h74v20H67z"/>
<path fill="url(#b)" d="M0 0h141v20H0z"/>
</g>
<image x="5" y="3" width="14" height="14" xlink:href="/assets/favicon.svg"/>
<g fill="#fff" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="24" y="15" fill="#010101" fill-opacity=".3">Rocket</text>
<text x="24" y="14">Rocket</text>
<text x="74" y="15" fill="#010101" fill-opacity=".3">JOIN CHAT</text>
<text x="74" y="14">JOIN CHAT</text>
</g>
</svg>
```

## Change Log

| Version | Description |
| :--- | :--- |
| 0.55.0 | Added |

0 comments on commit 6b179e3

Please sign in to comment.