Skip to content

Commit 6b179e3

Browse files
Marcos Spessatto DefendiMartinSchoeler
authored andcommitted
Add REST shield.svg docs (RocketChat#913)
1 parent f20056a commit 6b179e3

File tree

5 files changed

+65
-1
lines changed

5 files changed

+65
-1
lines changed

_data/toc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@
338338
- Miscellaneous:
339339
- directory
340340
- info
341+
- shield.svg
341342
- spotlight
342343
- statistics
343344
- statistics.list

contributing/documentation/documentation-map/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ Here you can also find what articles are incomplete and missing.
365365
- Miscellaneous:
366366
- directory
367367
- info
368+
- shield.svg
368369
- spotlight
369370
- statistics
370371
- statistics.list

developer-guides/rest-api/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and
2222
| :------------------------ | :-------------------------------------------------------- | :------------------------------------- |
2323
| `/api/v1/info` | Information about the Rocket.Chat server. | [Link](miscellaneous/info/) |
2424
| `/api/v1/directory` | Search by users or channels on all server. | [Link](miscellaneous/directory/) |
25+
| `/api/v1/shield.svg` | Gets the shield svg(badge) to add in your website. | [Link](miscellaneous/shield-svg/) |
2526
| `/api/v1/spotlight` | Searches for users or rooms that are visible to the user. | [Link](miscellaneous/spotlight/) |
2627
| `/api/v1/statistics` | Statistics about the Rocket.Chat server. | [Link](miscellaneous/statistics/) |
2728
| `/api/v1/statistics.list` | Selectable statistics about the Rocket.Chat server. | [Link](miscellaneous/statistics-list/) |

developer-guides/rest-api/miscellaneous/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ Just some generic information, such as information about the server and authenti
55
| Url | Short Description | Details Page |
66
| :--- | :--- | :--- |
77
| `/api/v1/directory` | Search by users or channels on all server. | [Link](directory/) |
8-
| `/api/v1/info` | Information about the Rocket.Chat server. | [info](info/) |
8+
| `/api/v1/info` | Information about the Rocket.Chat server. | [Link](info/) |
9+
| `/api/v1/shield.svg` | Gets the shield svg(badge) to add in your website. | [Link](shield-svg/) |
910
| `/api/v1/spotlight` | Searches for users or rooms that are visible to the user. | [Link](spotlight/) |
1011
| `/api/v1/statistics` | Statistics about the Rocket.Chat server. | [Link](statistics/) |
1112
| `/api/v1/statistics.list` | Selectable statistics about the Rocket.Chat server. | [Link](statistics-list/) |
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Shield SVG
2+
3+
A simple method, requires no authentication, that returns the shield svg(badge) to add in your website. It must have `API_Enable_Shields` enabled.
4+
5+
| URL | Requires Auth | HTTP Method |
6+
| :--- | :--- | :--- | :--- |
7+
| `/api/v1/shield.svg` | `no` | `GET` |
8+
9+
## Query Parameters
10+
11+
| Argument | Example | Required | Description |
12+
| :--- | :--- | :--- | :--- |
13+
| `type` | `online` | Optional | Can be one of `online`, `user`, `channel`
14+
| `icon` | `false` | Optional |
15+
| `channel` | `general` | Optional | Name of the channel
16+
| `name` | `Rocket.Chat` | Optional | Name to show
17+
18+
## Example Call
19+
20+
```bash
21+
curl http://localhost:3000/api/v1/shield.svg
22+
```
23+
24+
## Example Result
25+
26+
### Headers
27+
28+
`Content-Type`: `image/svg+xml;charset=utf-8`
29+
30+
### Body
31+
32+
```
33+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="141" height="20">
34+
<linearGradient id="b" x2="0" y2="100%">
35+
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
36+
<stop offset="1" stop-opacity=".1"/>
37+
</linearGradient>
38+
<mask id="a">
39+
<rect width="141" height="20" rx="3" fill="#fff"/>
40+
</mask>
41+
<g mask="url(#a)">
42+
<path fill="#555" d="M0 0h67v20H0z"/>
43+
<path fill="#4c1" d="M67 0h74v20H67z"/>
44+
<path fill="url(#b)" d="M0 0h141v20H0z"/>
45+
</g>
46+
<image x="5" y="3" width="14" height="14" xlink:href="/assets/favicon.svg"/>
47+
<g fill="#fff" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
48+
<text x="24" y="15" fill="#010101" fill-opacity=".3">Rocket</text>
49+
<text x="24" y="14">Rocket</text>
50+
<text x="74" y="15" fill="#010101" fill-opacity=".3">JOIN CHAT</text>
51+
<text x="74" y="14">JOIN CHAT</text>
52+
</g>
53+
</svg>
54+
```
55+
56+
## Change Log
57+
58+
| Version | Description |
59+
| :--- | :--- |
60+
| 0.55.0 | Added |

0 commit comments

Comments
 (0)