diff options
Diffstat (limited to 'support/doc/api')
-rw-r--r-- | support/doc/api/openapi.yaml | 7 | ||||
-rw-r--r-- | support/doc/api/quickstart.md | 12 |
2 files changed, 12 insertions, 7 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index aa6be7e87..f0c0b46b1 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml | |||
@@ -1741,7 +1741,12 @@ components: | |||
1741 | type: string | 1741 | type: string |
1742 | description: 'The user videoQuota ' | 1742 | description: 'The user videoQuota ' |
1743 | role: | 1743 | role: |
1744 | type: string | 1744 | type: integer |
1745 | format: int32 | ||
1746 | enum: | ||
1747 | - 0 | ||
1748 | - 1 | ||
1749 | - 2 | ||
1745 | description: 'The user role ' | 1750 | description: 'The user role ' |
1746 | required: | 1751 | required: |
1747 | - username | 1752 | - username |
diff --git a/support/doc/api/quickstart.md b/support/doc/api/quickstart.md index 6c19b59ee..00874a1c9 100644 --- a/support/doc/api/quickstart.md +++ b/support/doc/api/quickstart.md | |||
@@ -6,13 +6,13 @@ | |||
6 | 6 | ||
7 | Some endpoints need authentication. We use OAuth 2.0 so first fetch the client tokens: | 7 | Some endpoints need authentication. We use OAuth 2.0 so first fetch the client tokens: |
8 | 8 | ||
9 | ``` | 9 | ```bash |
10 | $ curl https://peertube.example.com/api/v1/oauth-clients/local | 10 | $ curl https://peertube.example.com/api/v1/oauth-clients/local |
11 | ``` | 11 | ``` |
12 | 12 | ||
13 | Response example: | 13 | Response example: |
14 | 14 | ||
15 | ``` | 15 | ```json |
16 | { | 16 | { |
17 | "client_id": "v1ikx5hnfop4mdpnci8nsqh93c45rldf", | 17 | "client_id": "v1ikx5hnfop4mdpnci8nsqh93c45rldf", |
18 | "client_secret": "AjWiOapPltI6EnsWQwlFarRtLh4u8tDt" | 18 | "client_secret": "AjWiOapPltI6EnsWQwlFarRtLh4u8tDt" |
@@ -23,7 +23,7 @@ Response example: | |||
23 | 23 | ||
24 | Now you can fetch the user token: | 24 | Now you can fetch the user token: |
25 | 25 | ||
26 | ``` | 26 | ```bash |
27 | $ curl -X POST \ | 27 | $ curl -X POST \ |
28 | -d "client_id=v1ikx5hnfop4mdpnci8nsqh93c45rldf&client_secret=AjWiOapPltI6EnsWQwlFarRtLh4u8tDt&grant_type=password&response_type=code&username=your_user&password=your_password" \ | 28 | -d "client_id=v1ikx5hnfop4mdpnci8nsqh93c45rldf&client_secret=AjWiOapPltI6EnsWQwlFarRtLh4u8tDt&grant_type=password&response_type=code&username=your_user&password=your_password" \ |
29 | https://peertube.example.com/api/v1/users/token | 29 | https://peertube.example.com/api/v1/users/token |
@@ -31,7 +31,7 @@ $ curl -X POST \ | |||
31 | 31 | ||
32 | Response example: | 32 | Response example: |
33 | 33 | ||
34 | ``` | 34 | ```json |
35 | { | 35 | { |
36 | "access_token": "90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0", | 36 | "access_token": "90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0", |
37 | "token_type": "Bearer", | 37 | "token_type": "Bearer", |
@@ -42,13 +42,13 @@ Response example: | |||
42 | 42 | ||
43 | Just use the `access_token` in the `Authorization` header: | 43 | Just use the `access_token` in the `Authorization` header: |
44 | 44 | ||
45 | ``` | 45 | ```bash |
46 | $ curl -H 'Authorization: Bearer 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0' https://peertube.example.com/api/v1/jobs/completed | 46 | $ curl -H 'Authorization: Bearer 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0' https://peertube.example.com/api/v1/jobs/completed |
47 | ``` | 47 | ``` |
48 | 48 | ||
49 | 49 | ||
50 | ### List videos | 50 | ### List videos |
51 | 51 | ||
52 | ``` | 52 | ```bash |
53 | $ curl https://peertube.example.com/api/v1/videos | 53 | $ curl https://peertube.example.com/api/v1/videos |
54 | ``` | 54 | ``` |