Commit 318c3639 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'docs/update-badge-api' into 'master'

Update doc/api/project_badges.md

See merge request gitlab-org/gitlab!52193
parents 6356c0f5 a0874d71
...@@ -106,9 +106,10 @@ POST /projects/:id/badges ...@@ -106,9 +106,10 @@ POST /projects/:id/badges
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
| `link_url` | string | yes | URL of the badge link | | `link_url` | string | yes | URL of the badge link |
| `image_url` | string | yes | URL of the badge image | | `image_url` | string | yes | URL of the badge image |
| `name` | string | no | Name of the badge |
```shell ```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --data "link_url=https://gitlab.com/gitlab-org/gitlab-foss/commits/master&image_url=https://shields.io/my/badge1&position=0" "https://gitlab.example.com/api/v4/projects/:id/badges" curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --data "link_url=https://gitlab.com/gitlab-org/gitlab-foss/commits/master&image_url=https://shields.io/my/badge1&name=mybadge" "https://gitlab.example.com/api/v4/projects/:id/badges"
``` ```
Example response: Example response:
...@@ -116,6 +117,7 @@ Example response: ...@@ -116,6 +117,7 @@ Example response:
```json ```json
{ {
"id": 1, "id": 1,
"name": "mybadge",
"link_url": "https://gitlab.com/gitlab-org/gitlab-foss/commits/master", "link_url": "https://gitlab.com/gitlab-org/gitlab-foss/commits/master",
"image_url": "https://shields.io/my/badge1", "image_url": "https://shields.io/my/badge1",
"rendered_link_url": "https://gitlab.com/gitlab-org/gitlab-foss/commits/master", "rendered_link_url": "https://gitlab.com/gitlab-org/gitlab-foss/commits/master",
...@@ -138,6 +140,7 @@ PUT /projects/:id/badges/:badge_id ...@@ -138,6 +140,7 @@ PUT /projects/:id/badges/:badge_id
| `badge_id` | integer | yes | The badge ID | | `badge_id` | integer | yes | The badge ID |
| `link_url` | string | no | URL of the badge link | | `link_url` | string | no | URL of the badge link |
| `image_url` | string | no | URL of the badge image | | `image_url` | string | no | URL of the badge image |
| `name` | string | no | Name of the badge |
```shell ```shell
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/badges/:badge_id" curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/badges/:badge_id"
...@@ -148,6 +151,7 @@ Example response: ...@@ -148,6 +151,7 @@ Example response:
```json ```json
{ {
"id": 1, "id": 1,
"name": "mybadge",
"link_url": "https://gitlab.com/gitlab-org/gitlab-foss/commits/master", "link_url": "https://gitlab.com/gitlab-org/gitlab-foss/commits/master",
"image_url": "https://shields.io/my/badge", "image_url": "https://shields.io/my/badge",
"rendered_link_url": "https://gitlab.com/gitlab-org/gitlab-foss/commits/master", "rendered_link_url": "https://gitlab.com/gitlab-org/gitlab-foss/commits/master",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment