Skip to content

Commit

Permalink
fix : doc by replacing instances of "create access token"
Browse files Browse the repository at this point in the history
missing create access token doc in access token which is in playback authentication , so replace the access token doc into access token
  • Loading branch information
chiranjeevi committed Dec 14, 2023
1 parent 757e0b1 commit 6a65fde
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 40 deletions.
30 changes: 29 additions & 1 deletion docs/server-api/access-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,36 @@ sidebar_position: 7
---

# Access token
An access token is essential for secure video playback .

### Create an Access token

To generate the Access token you need to send an HTTP POST request to the API Endpoint, with the [authentication Header](../server-api/authentication.md) and the optional Access token request Body.

```bash
https://app.tpstreams.com/api/v1/{{org_code}}/assets/{{asset_id}}/access_tokens/
```

**Optional Fields**

| Name | Type | description |
| ----------- | ----------- | ----------- |
| time_to_live | integer | By default, the Access token validity is set to infinity. You can create shorter-lived URLs by passing the time_to_live parameter. This value is to be set in seconds |
| expires_after_first_usage | boolean | Passing true will make the access token expire immediately after the first usage |
| annotations | json | JSON contain all the information about the watermark. Please refer to this [doc](./watermarking.md) for details on watermarking. |

For valid requests the API server returns a JSON:

```js
{
"playback_url":"https://app.tpstreams.com/embed/dcek2m/6cKHaeJ44pp/?access_token=1a60b175-c2e8-4a38-814b-323697f52994",
"expires_after_first_usage":false,
"code":"1a60b175-c2e8-4a38-814b-323697f52994",
"status":"Active","valid_until":null,
"annotations":[]
}
```

For Creation API, Please check [here](../video-embedding/authentication.md)

### List Access tokens

Expand Down
40 changes: 1 addition & 39 deletions docs/video-embedding/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,42 +11,4 @@ If the user has your video embed code he can embed your video onto any page on t
You can prevent the above scenario by generating an access token using API with time-to-live or set to expire after one usage on the back-end server and then sent to the website front-end and use generate access_token as part of the video embed code.


### Obtaining an Access token

To generate the Access token you need to send an HTTP POST request to the API Endpoint, with the [authentication Header](../server-api/authentication.md) and the optional Access token request Body.

```bash
https://app.tpstreams.com/api/v1/{{org_code}}/assets/{{asset_id}}/access_tokens/
```

**Optional Fields**

| Name | Type | description |
| ----------- | ----------- | ----------- |
| time_to_live | integer | By default, the Access token validity is set to infinity. You can create shorter-lived URLs by passing the time_to_live parameter. This value is to be set in seconds |
| expires_after_first_usage | boolean | Passing true will make the access token expire immediately after the first usage |
| annotations | json | JSON contain all the information about the watermark. Please refer to this [doc](./watermarking.md) for details on watermarking. |

For valid requests the API server returns a JSON:

```js

{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"playback_url": "https://app.tpstreams.com/embed/dcek2m/3XqS4b4UKUm/?access_token=b1aa3af8-9c75-40e9-a051-4c129e84da82",
"expires_after_first_usage": false,
"code": "b1aa3af8-9c75-40e9-a051-4c129e84da82",
"status": "Active",
"valid_until": null,
"annotations": []
}
]
}
```


Other CRED operation APIs are documented [here](../server-api/access-token.md)
Access token CRUD operation APIs are documented [here](../server-api/access-token.md)

0 comments on commit 6a65fde

Please sign in to comment.