make POST /users have integer role enum
This commit is contained in:
parent
31d45e0e0b
commit
0f49023061
|
@ -1741,7 +1741,12 @@ components:
|
||||||
type: string
|
type: string
|
||||||
description: 'The user videoQuota '
|
description: 'The user videoQuota '
|
||||||
role:
|
role:
|
||||||
type: string
|
type: integer
|
||||||
|
format: int32
|
||||||
|
enum:
|
||||||
|
- 0
|
||||||
|
- 1
|
||||||
|
- 2
|
||||||
description: 'The user role '
|
description: 'The user role '
|
||||||
required:
|
required:
|
||||||
- username
|
- username
|
||||||
|
|
|
@ -6,13 +6,13 @@
|
||||||
|
|
||||||
Some endpoints need authentication. We use OAuth 2.0 so first fetch the client tokens:
|
Some endpoints need authentication. We use OAuth 2.0 so first fetch the client tokens:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
$ curl https://peertube.example.com/api/v1/oauth-clients/local
|
$ curl https://peertube.example.com/api/v1/oauth-clients/local
|
||||||
```
|
```
|
||||||
|
|
||||||
Response example:
|
Response example:
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"client_id": "v1ikx5hnfop4mdpnci8nsqh93c45rldf",
|
"client_id": "v1ikx5hnfop4mdpnci8nsqh93c45rldf",
|
||||||
"client_secret": "AjWiOapPltI6EnsWQwlFarRtLh4u8tDt"
|
"client_secret": "AjWiOapPltI6EnsWQwlFarRtLh4u8tDt"
|
||||||
|
@ -23,7 +23,7 @@ Response example:
|
||||||
|
|
||||||
Now you can fetch the user token:
|
Now you can fetch the user token:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
$ curl -X POST \
|
$ curl -X POST \
|
||||||
-d "client_id=v1ikx5hnfop4mdpnci8nsqh93c45rldf&client_secret=AjWiOapPltI6EnsWQwlFarRtLh4u8tDt&grant_type=password&response_type=code&username=your_user&password=your_password" \
|
-d "client_id=v1ikx5hnfop4mdpnci8nsqh93c45rldf&client_secret=AjWiOapPltI6EnsWQwlFarRtLh4u8tDt&grant_type=password&response_type=code&username=your_user&password=your_password" \
|
||||||
https://peertube.example.com/api/v1/users/token
|
https://peertube.example.com/api/v1/users/token
|
||||||
|
@ -31,7 +31,7 @@ $ curl -X POST \
|
||||||
|
|
||||||
Response example:
|
Response example:
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"access_token": "90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0",
|
"access_token": "90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0",
|
||||||
"token_type": "Bearer",
|
"token_type": "Bearer",
|
||||||
|
@ -42,13 +42,13 @@ Response example:
|
||||||
|
|
||||||
Just use the `access_token` in the `Authorization` header:
|
Just use the `access_token` in the `Authorization` header:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
$ curl -H 'Authorization: Bearer 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0' https://peertube.example.com/api/v1/jobs/completed
|
$ curl -H 'Authorization: Bearer 90286a0bdf0f7315d9d3fe8dabf9e1d2be9c97d0' https://peertube.example.com/api/v1/jobs/completed
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### List videos
|
### List videos
|
||||||
|
|
||||||
```
|
```bash
|
||||||
$ curl https://peertube.example.com/api/v1/videos
|
$ curl https://peertube.example.com/api/v1/videos
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue