diff --git a/docs/live-stream-api/list-live-stream-api.md b/docs/live-stream-api/list-live-stream-api.md index 6fd368ed..ef88fc87 100644 --- a/docs/live-stream-api/list-live-stream-api.md +++ b/docs/live-stream-api/list-live-stream-api.md @@ -11,60 +11,83 @@ To retrieve a list of live streams in the organization, send an HTTP GET request https://app.tpstreams.com/api/v1//assets/live_streams/ ``` **Sample webhook response is as follows** -```json -{ - "count": 2, - "next": null, - "previous": null, - "results": [ - { - "title": "Data Science Live Class", - "bytes": null, - "type": "livestream", - "video": null, - "id": "8DH94uXQgrA", - "live_stream": { - "rtmp_url": "rtmp://52.66.213.19/live", - "stream_key": "org-89b2cy-live-8DH94uXQgrA-7XkI", - "status": "Completed", - "hls_url": "https://d3cydmgt9q030i.cloudfront.net/live/89b2cy/8DH94uXQgrA/video.m3u8", - "start": "2023-12-07 13:02:16", - "transcode_recorded_video": true, - "enable_drm_for_recording": true, - "chat_embed_url": null, - "resolutions": [ - "240p", - "480p", - "720p" - ] - }, - "parent": null, - "parent_id": null - }, - { - "title": "GO LIVE NOW", - "bytes": null, - "type": "livestream", - "video": null, - "id": "9QgXR3pPj49", - "live_stream": { - "rtmp_url": "", - "stream_key": null, - "status": "Completed", - "hls_url": "https://d3cydmgt9q030i.cloudfront.net/live/89b2cy/9QgXR3pPj49/video.m3u8", - "start": "2023-12-07 12:34:42", - "transcode_recorded_video": true, - "enable_drm_for_recording": true, - "chat_embed_url": null, - "resolutions": [ - "240p", - "480p", - "720p" - ] +**Response** + +**HTTP Status Codes:** + +- **200 OK :** + Request successful. Server processed the request. + + ```json + { + "count": 2, + "next": null, + "previous": null, + "results": [ + { + "title": "Data Science Live Class", + "bytes": null, + "type": "livestream", + "video": null, + "id": "8DH94uXQgrA", + "live_stream": { + "rtmp_url": "rtmp://52.66.213.19/live", + "stream_key": "org-89b2cy-live-8DH94uXQgrA-7XkI", + "status": "Completed", + "hls_url": "https://d3cydmgt9q030i.cloudfront.net/live/89b2cy/8DH94uXQgrA/video.m3u8", + "start": "2023-12-07 13:02:16", + "transcode_recorded_video": true, + "enable_drm_for_recording": true, + "chat_embed_url": null, + "resolutions": [ + "240p", + "480p", + "720p" + ] + }, + "parent": null, + "parent_id": null }, - "parent": null, - "parent_id": null - } - ] -} -``` \ No newline at end of file + { + "title": "GO LIVE NOW", + "bytes": null, + "type": "livestream", + "video": null, + "id": "9QgXR3pPj49", + "live_stream": { + "rtmp_url": "", + "stream_key": null, + "status": "Completed", + "hls_url": "https://d3cydmgt9q030i.cloudfront.net/live/89b2cy/9QgXR3pPj49/video.m3u8", + "start": "2023-12-07 12:34:42", + "transcode_recorded_video": true, + "enable_drm_for_recording": true, + "chat_embed_url": null, + "resolutions": [ + "240p", + "480p", + "720p" + ] + }, + "parent": null, + "parent_id": null + } + ] + } + ``` + +- **401 Unauthorized :** + Returned when the request lacks valid authentication credentials. + + ```json + { + "detail": "Invalid token." + } + + +- **404 Not Found :** + If the wrong organization ID is provided: + + ```json + The requested resource was not found on this server. + ``` diff --git a/docs/live-stream-api/live-stream/schedule-a-live-stream.md b/docs/live-stream-api/live-stream/schedule-a-live-stream.md index 1d30cd87..1a0fb0a4 100644 --- a/docs/live-stream-api/live-stream/schedule-a-live-stream.md +++ b/docs/live-stream-api/live-stream/schedule-a-live-stream.md @@ -32,34 +32,66 @@ https://app.tpstreams.com/api/v1//assets/live_streams/ ``` -For valid requests the API server returns a JSON: +### Response +**HTTP Status Codes:** + +For valid requests the API server returns a JSON +- **201 Created:** + Indicates successful creation of a new video resource + + ```json + { + "title": "Data science Live class", + "bytes": null, + "type": "livestream", + "video": null, + "id": "AuC9yX2EtBr", + "live_stream": { + "rtmp_url": "", + "stream_key": null, + "status": "Not Started", + "hls_url": "https://d28qihy7z761lk.cloudfront.net/live/gnarys/AuC9yX2EtBr/video.m3u8", + "start": "2024-10-05 15:30:00", + "transcode_recorded_video": true, + "enable_drm_for_recording": false, + "chat_embed_url": null, + "resolutions": [ + "240p", + "480p", + "720p" + ] + }, + "parent": null, + "parent_id": null + } + ``` + +- **401 Unauthorized :** + Returned when the request lacks valid authentication credentials. + + ```json + { + "detail": "Invalid token." + } + ``` +- **404 Not Found :** + If the wrong organization ID is provided + + ```json + The requested resource was not found on this server. + ``` +- ** 400 Bad Request :** + Returned when the provided folder UUID is invalid. + + ```json + { + "parent": [ + "Invalid folder UUID" + ] + } + + -```json -{ - "title": "Data science Live class", - "bytes": null, - "type": "livestream", - "video": null, - "id": "AuC9yX2EtBr", - "live_stream": { - "rtmp_url": "", - "stream_key": null, - "status": "Not Started", - "hls_url": "https://d28qihy7z761lk.cloudfront.net/live/gnarys/AuC9yX2EtBr/video.m3u8", - "start": "2024-10-05 15:30:00", - "transcode_recorded_video": true, - "enable_drm_for_recording": false, - "chat_embed_url": null, - "resolutions": [ - "240p", - "480p", - "720p" - ] - }, - "parent": null, - "parent_id": null -} -``` Live stream is created with the scheduled time for you to start the server later. Above response has the details of the live stream scheduled which can also be obtained by API diff --git a/docs/live-stream-api/live-stream/start-server.md b/docs/live-stream-api/live-stream/start-server.md index d642b0b8..06b55aad 100644 --- a/docs/live-stream-api/live-stream/start-server.md +++ b/docs/live-stream-api/live-stream/start-server.md @@ -11,34 +11,62 @@ To Start a server for the scheduled live stream you need to send an HTTP POST re ```bash https://app.tpstreams.com/api/v1//assets//start_server/ ``` + +**Response** +**HTTP Status Codes:** + For valid requests the API server returns a JSON: +- **200 OK :** + Request successful. Server processed the request. + + ```json + { + "title": "Data science Live class", + "bytes": null, + "type": "livestream", + "video": null, + "id": "8XGEEj6ptnB", + "live_stream": { + "rtmp_url": "", + "stream_key": null, + "status": "Not Started", + "hls_url": "https://d3cydmgt9q030i.cloudfront.net/live/edee9b/8XGEEj6ptnB/video.m3u8", + "start": "2024-10-05 15:30:00", + "transcode_recorded_video": true, + "enable_drm_for_recording": false, + "chat_embed_url": "https://app.tpstreams.com/live-chat/edee9b/8XGEEj6ptnB/", + "resolutions": [ + "240p", + "480p", + "720p" + ] + }, + "parent": null, + "parent_id": null + } + ``` + +- **404 Not Found :** + + If the wrong organization ID is provided: + ```json + The requested resource was not found on this server. + ``` + + If the wrong asset ID is provided: + + ```json + { + "detail": "Not found." + } +- **401 Unauthorized :** + Returned when the request lacks valid authentication credentials. + + ```json + { + "detail": "Invalid token." + } -```json -{ - "title": "Data science Live class", - "bytes": null, - "type": "livestream", - "video": null, - "id": "8XGEEj6ptnB", - "live_stream": { - "rtmp_url": "", - "stream_key": null, - "status": "Not Started", - "hls_url": "https://d3cydmgt9q030i.cloudfront.net/live/edee9b/8XGEEj6ptnB/video.m3u8", - "start": "2024-10-05 15:30:00", - "transcode_recorded_video": true, - "enable_drm_for_recording": false, - "chat_embed_url": "https://app.tpstreams.com/live-chat/edee9b/8XGEEj6ptnB/", - "resolutions": [ - "240p", - "480p", - "720p" - ] - }, - "parent": null, - "parent_id": null -} -``` This will start the server for specified live stream Above response has the details of the live stream started which can also be obtained by API diff --git a/docs/server-api/access-token.md b/docs/server-api/access-token.md index 37b3f6c8..14454e12 100644 --- a/docs/server-api/access-token.md +++ b/docs/server-api/access-token.md @@ -49,13 +49,153 @@ https://app.tpstreams.com/api/v1/{{org_code}}/assets/{{asset_id}}/access_tokens/ | is_active | boolean | + **Response** -```js -{ - "count": 3, - "next": null, - "previous": null, - "results": [ +**HTTP Status Codes:** + +- **200 OK :** + Request successful. Server processed the request. + + ```js + { + "count": 3, + "next": null, + "previous": null, + "results": [ + { + "playback_url": "https://app.tpstreams.com/embed/d2ff26b2-f88e-4d6d-a9ce-bb0e3ce858cc/?access_token=e91e2bf4-a3ab-493f-8685-7b88ea943c5a", + "expires_after_first_usage": false, + "code": "e91e2bf4-a3ab-493f-8685-7b88ea943c5a", + "status": "Active", + "valid_until": null, + "annotations": [ + { + "text": "moving text", + "type": "dynamic", + "color": "#FF0000", + "opacity": "0.80", + "size": 15, + "interval": 1000, + "skip": 0, + "x": 16, + "y": 16 + }, + { + "text": "moving text 2", + "type": "dynamic", + "color": "#FF0000", + "opacity": "0.80", + "size": 15, + "interval": 1000, + "skip": 0, + "x": 16, + "y": 16 + } + ] + }, + { + "playback_url": "https://app.tpstreams.com/embed/d2ff26b2-f88e-4d6d-a9ce-bb0e3ce858cc/?access_token=a33ab940-2fc5-44e8-bb7a-222ee06f023b", + "expires_after_first_usage": false, + "code": "a33ab940-2fc5-44e8-bb7a-222ee06f023b", + "status": "Active", + "valid_until": null, + "annotations": [ + { + "text": "moving text", + "type": "dynamic", + "color": "#FF0000", + "opacity": "0.80", + "size": 15, + "interval": 1000, + "skip": 0, + "x": 16, + "y": 16 + }, + { + "text": "moving text 2", + "type": "dynamic", + "color": "#FF0000", + "opacity": "0.80", + "size": 15, + "interval": 1000, + "skip": 0, + "x": 16, + "y": 16 + } + ] + }, + { + "playback_url": "https://app.tpstreams.com/embed/d2ff26b2-f88e-4d6d-a9ce-bb0e3ce858cc/?access_token=609fb114-d45d-4b64-9c95-3a2334bec0ad", + "expires_after_first_usage": false, + "code": "609fb114-d45d-4b64-9c95-3a2334bec0ad", + "status": "Active", + "valid_until": null, + "annotations": [ + { + "text": "moving text", + "type": "dynamic", + "color": "#FF0000", + "opacity": "0.80", + "size": 15, + "interval": 1000, + "skip": 0, + "x": 16, + "y": 16 + }, + { + "text": "moving text 2", + "type": "dynamic", + "color": "#FF0000", + "opacity": "0.80", + "size": 15, + "interval": 1000, + "skip": 0, + "x": 16, + "y": 16 + } + ] + } + ] + } + ``` + +- **404 Not Found :** + + If the wrong organization ID is provided: + ```json + The requested resource was not found on this server. + ``` + + If the wrong asset ID is provided: + + ```json + { + "detail": "Not found." + } +- **401 Unauthorized :** + Returned when the request lacks valid authentication credentials. + + ```json + { + "detail": "Invalid token." + } + + + +### View Access token + +Make get request to the below API with your video id and access token code to get the access token details + +```bash +https://app.tpstreams.com/api/v1/{{org_code}}/assets/{{asset_id}}/access_tokens/{access_token_code}/ +``` + +**HTTP Status Codes:** + +- **200 OK :** + Request successful. Server processed the request. + + ```js { "playback_url": "https://app.tpstreams.com/embed/d2ff26b2-f88e-4d6d-a9ce-bb0e3ce858cc/?access_token=e91e2bf4-a3ab-493f-8685-7b88ea943c5a", "expires_after_first_usage": false, @@ -73,121 +213,32 @@ https://app.tpstreams.com/api/v1/{{org_code}}/assets/{{asset_id}}/access_tokens/ "skip": 0, "x": 16, "y": 16 - }, - { - "text": "moving text 2", - "type": "dynamic", - "color": "#FF0000", - "opacity": "0.80", - "size": 15, - "interval": 1000, - "skip": 0, - "x": 16, - "y": 16 - } - ] - }, - { - "playback_url": "https://app.tpstreams.com/embed/d2ff26b2-f88e-4d6d-a9ce-bb0e3ce858cc/?access_token=a33ab940-2fc5-44e8-bb7a-222ee06f023b", - "expires_after_first_usage": false, - "code": "a33ab940-2fc5-44e8-bb7a-222ee06f023b", - "status": "Active", - "valid_until": null, - "annotations": [ - { - "text": "moving text", - "type": "dynamic", - "color": "#FF0000", - "opacity": "0.80", - "size": 15, - "interval": 1000, - "skip": 0, - "x": 16, - "y": 16 - }, - { - "text": "moving text 2", - "type": "dynamic", - "color": "#FF0000", - "opacity": "0.80", - "size": 15, - "interval": 1000, - "skip": 0, - "x": 16, - "y": 16 - } - ] - }, - { - "playback_url": "https://app.tpstreams.com/embed/d2ff26b2-f88e-4d6d-a9ce-bb0e3ce858cc/?access_token=609fb114-d45d-4b64-9c95-3a2334bec0ad", - "expires_after_first_usage": false, - "code": "609fb114-d45d-4b64-9c95-3a2334bec0ad", - "status": "Active", - "valid_until": null, - "annotations": [ - { - "text": "moving text", - "type": "dynamic", - "color": "#FF0000", - "opacity": "0.80", - "size": 15, - "interval": 1000, - "skip": 0, - "x": 16, - "y": 16 - }, - { - "text": "moving text 2", - "type": "dynamic", - "color": "#FF0000", - "opacity": "0.80", - "size": 15, - "interval": 1000, - "skip": 0, - "x": 16, - "y": 16 } ] } - ] -} -``` - - - - -### View Access token + ``` + +- **404 Not Found** -Make get request to the below API with your video id and access token code to get the access token details + If the wrong organization ID is provided: + ```json + The requested resource was not found on this server. + ``` -```bash -https://app.tpstreams.com/api/v1/{{org_code}}/assets/{{asset_id}}/access_tokens/{access_token_code}/ -``` + If the wrong asset ID is provided: + ```json + { + "detail": "Not found." + } +- **401 Unauthorized :** + Returned when the request lacks valid authentication credentials. -**Response** -```js + ```json { - "playback_url": "https://app.tpstreams.com/embed/d2ff26b2-f88e-4d6d-a9ce-bb0e3ce858cc/?access_token=e91e2bf4-a3ab-493f-8685-7b88ea943c5a", - "expires_after_first_usage": false, - "code": "e91e2bf4-a3ab-493f-8685-7b88ea943c5a", - "status": "Active", - "valid_until": null, - "annotations": [ - { - "text": "moving text", - "type": "dynamic", - "color": "#FF0000", - "opacity": "0.80", - "size": 15, - "interval": 1000, - "skip": 0, - "x": 16, - "y": 16 - } - ] + "detail": "Invalid token." } -``` + diff --git a/docs/server-api/assets.md b/docs/server-api/assets.md index a91e1759..096b9a3d 100644 --- a/docs/server-api/assets.md +++ b/docs/server-api/assets.md @@ -42,38 +42,57 @@ https://app.tpstreams.com/api/v1//assets/videos/ ``` -For valid requests the API server returns a JSON: +### Response +**HTTP Status Codes:** -```json -{ - "id": "9328558d-e0a5-4093-b3b9-8f15ad1550d8", // asset id - "title": "Big Buck Bunny Video", - "bytes": null, - "type": "video", - "video": { - "progress": 0, - "thumbnails": [], - "status": "Completed", - "playback_url": "https://d7pdowhru2wq4.cloudfront.net/transcoded/9328558d-e0a5-4093-b3b9-8f15ad1550d8/video.m3u8", - "dash_url": "https://d7pdowhru2wq4.cloudfront.net/transcoded/9328558d-e0a5-4093-b3b9-8f15ad1550d8/video.mpd", - "preview_thumbnail_url": null, - "format": "abr", - "resolutions": ["240p", "360p", "480p", "720p"], - "video_codec": "h264", - "audio_codec": "aac", - "content_protection_type": "drm", - "tracks": [], - "inputs": [ - { - "url": "https://static.testpress.in/BigBuckBunny.mp4" - } - ], - }, - "parent_id": "32seYYHeNxE", -} +For valid requests the API server returns a JSON +- **201 Created:** + Indicates successful creation of a new video resource -``` -Above response can also be obtained by asset detail API **/api/v1//assets//** + ```json + { + "id": "9328558d-e0a5-4093-b3b9-8f15ad1550d8", // asset id + "title": "Big Buck Bunny Video", + "bytes": null, + "type": "video", + "video": { + "progress": 0, + "thumbnails": [], + "status": "Completed", + "playback_url": "https://d7pdowhru2wq4.cloudfront.net/transcoded/9328558d-e0a5-4093-b3b9-8f15ad1550d8/video.m3u8", + "dash_url": "https://d7pdowhru2wq4.cloudfront.net/transcoded/9328558d-e0a5-4093-b3b9-8f15ad1550d8/video.mpd", + "preview_thumbnail_url": null, + "format": "abr", + "resolutions": ["240p", "360p", "480p", "720p"], + "video_codec": "h264", + "audio_codec": "aac", + "content_protection_type": "drm", + "tracks": [], + "inputs": [ + { + "url": "https://static.testpress.in/BigBuckBunny.mp4" + } + ], + }, + "parent_id": "32seYYHeNxE", + } + + ``` + +- **401 Unauthorized :** + Returned when the request lacks valid authentication credentials + + ```json + { + "detail": "Invalid token." + } + ``` +- **404 Not Found :** + If the wrong organization ID is provided + + ```json + The requested resource was not found on this server. + ``` ## Get all the assets that belong to the organization @@ -85,44 +104,66 @@ https://app.tpstreams.com/api/v1//assets/ ``` **Response** -```json -{ - "count": 1, - "next": null, - "previous": null, - "results": [ - { - "id": "9328558d-e0a5-4093-b3b9-8f15ad1550d8", - "title": "Big Buck Bunny Video", - "bytes": null, - "type": "video", - "video": { - "progress": 0, - "thumbnails": [], - "status": "Completed", - "playback_url": "https://d7pdowhru2wq4.cloudfront.net/transcoded/9328558d-e0a5-4093-b3b9-8f15ad1550d8/video.m3u8", - "dash_url": "https://d7pdowhru2wq4.cloudfront.net/transcoded/9328558d-e0a5-4093-b3b9-8f15ad1550d8/video.mpd", - "preview_thumbnail_url": null, - "format": "abr", - "resolutions": [ - "240p" - ], - "video_codec": "h264", - "audio_codec": "aac", - "content_protection_type": "drm", - "tracks": [], - "inputs": [ - { - "url": "https://static.testpress.in/BigBuckBunny.mp4" - } - ], - }, - "parent_id": "32seYYHeNxE", - } - ] -} -``` +**HTTP Status Codes:** + +- **200 OK :** + Request successful. Server processed the request + + ```json + { + "count": 1, + "next": null, + "previous": null, + "results": [ + { + "id": "9328558d-e0a5-4093-b3b9-8f15ad1550d8", + "title": "Big Buck Bunny Video", + "bytes": null, + "type": "video", + "video": { + "progress": 0, + "thumbnails": [], + "status": "Completed", + "playback_url": "https://d7pdowhru2wq4.cloudfront.net/transcoded/9328558d-e0a5-4093-b3b9-8f15ad1550d8/video.m3u8", + "dash_url": "https://d7pdowhru2wq4.cloudfront.net/transcoded/9328558d-e0a5-4093-b3b9-8f15ad1550d8/video.mpd", + "preview_thumbnail_url": null, + "format": "abr", + "resolutions": [ + "240p" + ], + "video_codec": "h264", + "audio_codec": "aac", + "content_protection_type": "drm", + "tracks": [], + "inputs": [ + { + "url": "https://static.testpress.in/BigBuckBunny.mp4" + } + ], + }, + "parent_id": "32seYYHeNxE", + } + ] + } + ``` + +- **401 Unauthorized :** + Returned when the request lacks valid authentication credentials + + ```json + { + "detail": "Invalid token." + } + + +- **404 Not Found :** + If the wrong organization ID is provided + + ```json + The requested resource was not found on this server. + ``` + ## Get Individual Asset Details To get a individual asset in the organization, you need to send an HTTP GET request to the API Endpoint, with the [authentication Header](../server-api/authentication.md). @@ -134,38 +175,62 @@ https://app.tpstreams.com/api/v1//assets// **Response** -```json -{ - "title": "sample.mp4", - "bytes": null, - "type": "video", - "video": { - "progress": 0, - "thumbnails": [], - "status": "Completed", - "playback_url": "https://d28qihy7z761lk.cloudfront.net/transcoded/56761978-503c-4ad9-9eca-dff4c4cc12db/video.m3u8", - "dash_url": "https://d28qihy7z761lk.cloudfront.net/transcoded/56761978-503c-4ad9-9eca-dff4c4cc12db/video.mpd", - "preview_thumbnail_url": null, - "format": "abr", - "resolutions": [ - "240p" - ], - "video_codec": "h264", - "audio_codec": "aac", - "content_protection_type": "drm", - "tracks": [], - "inputs": [ - { - "url": "private/e3e153564cb641b08edb3ae9c85c7211.mp4" - } - ] - }, - "id": "56761978-503c-4ad9-9eca-dff4c4cc12db", - "live_stream": null, - "parent_id": "32seYYHeNxE", -} +**HTTP Status Codes:** -``` +- **200 OK :** + Request successful. Server processed the request + + ```json + { + "title": "sample.mp4", + "bytes": null, + "type": "video", + "video": { + "progress": 0, + "thumbnails": [], + "status": "Completed", + "playback_url": "https://d28qihy7z761lk.cloudfront.net/transcoded/56761978-503c-4ad9-9eca-dff4c4cc12db/video.m3u8", + "dash_url": "https://d28qihy7z761lk.cloudfront.net/transcoded/56761978-503c-4ad9-9eca-dff4c4cc12db/video.mpd", + "preview_thumbnail_url": null, + "format": "abr", + "resolutions": [ + "240p" + ], + "video_codec": "h264", + "audio_codec": "aac", + "content_protection_type": "drm", + "tracks": [], + "inputs": [ + { + "url": "private/e3e153564cb641b08edb3ae9c85c7211.mp4" + } + ] + }, + "id": "56761978-503c-4ad9-9eca-dff4c4cc12db", + "live_stream": null, + "parent_id": "32seYYHeNxE", + } + +- **404 Not Found : ** + + If the wrong organization ID is provided + ```json + The requested resource was not found on this server. + ``` + + If the wrong asset ID is provided: + + ```json + { + "detail": "Not found." + } +- **401 Unauthorized :** + Returned when the request lacks valid authentication credentials + + ```json + { + "detail": "Invalid token." + } ## Delete Individual Asset diff --git a/docs/server-api/folders.md b/docs/server-api/folders.md index db727517..ebbdcfdb 100644 --- a/docs/server-api/folders.md +++ b/docs/server-api/folders.md @@ -33,10 +33,43 @@ https://app.tpstreams.com/api/v1//assets/folders/ For valid requests the API server returns a JSON: -```json -{ - "title": "CAT videos", - "uuid": "46seZZHAnWE", // folder id -} -``` \ No newline at end of file + + +### Response +**HTTP Status Codes:** + +For valid requests the API server returns a JSON +- **201 Created :** + Indicates successful creation of a new video resource + ```json + { + "title": "CAT videos", + "uuid": "46seZZHAnWE", // folder id + } + + ``` + +- **401 Unauthorized :** + Returned when the request lacks valid authentication credentials. + + ```json + { + "detail": "Invalid token." + } + ``` +- **404 Not Found :** + If the wrong organization ID is provided: + ```json + The requested resource was not found on this server. + ``` +- ** 400 Bad Request :** + Returned when the provided folder UUID is invalid. + + ```json + { + "parent": [ + "Invalid folder UUID" + ] + } + diff --git a/docs/server-api/organizations.md b/docs/server-api/organizations.md index 4eddfd1a..9e321a0a 100644 --- a/docs/server-api/organizations.md +++ b/docs/server-api/organizations.md @@ -79,22 +79,33 @@ IRestResponse response = client.Execute(request); ### Response -```json -{ - "count": 2, - "next": null, - "previous": null, - "results": [ - { - "name": "Testpress", - "uuid": "6dnpyx" - }, +**HTTP Status Codes:** + +- **200 OK:** + Request successful. Server processed the request. + + ```json { - "name": "Streams", - "uuid": "7coqzy" + "count": 2, + "next": null, + "previous": null, + "results": [ + { + "name": "Testpress", + "uuid": "6dnpyx" + }, + { + "name": "Streams", + "uuid": "7coqzy" + } + ] } - ] -} -``` + ``` + +- **401 Unauthorized:** + Request lacks valid authentication. Client needs proper credentials. + ```json + {"detail":"Invalid token."} + ``` diff --git a/docs/server-api/webhooks.md b/docs/server-api/webhooks.md index e3f7c696..3c8b4636 100644 --- a/docs/server-api/webhooks.md +++ b/docs/server-api/webhooks.md @@ -35,15 +35,36 @@ https://app.tpstreams.com/api/v1//webhooks/ ``` -For valid requests the API server returns a JSON: +### Response +**HTTP Status Codes:** + +For valid requests the API server returns a JSON +- **201 Created:** + Indicates successful creation of a new video resource + + ```json + { + "url": "https://sample.beeceptor.com", + "secret_token": "abcdef", + "id": "c4cf9c5f-0b60-4e5c-9db9-81321ffe31d5" + } + ``` -```json -{ - "url": "https://sample.beeceptor.com", - "secret_token": "abcdef", - "id": "c4cf9c5f-0b60-4e5c-9db9-81321ffe31d5" -} -``` + +- **401 Unauthorized** + Returned when the request lacks valid authentication credentials. + + ```json + { + "detail": "Invalid token." + } + ``` +- **404 Not Found :** + If the wrong organization ID is provided: + + ```json + The requested resource was not found on this server. + ``` ## List all webhooks To get all the webhooks, you need to send an HTTP GET request to the API Endpoint, with the [Authentication Header](../server-api/authentication.md). @@ -54,21 +75,41 @@ https://app.tpstreams.com/api/v1//webhooks/ ``` **Response** -```json -{ - "count": 1, - "next": null, - "previous": null, - "results": [ - { - "url": "https://sample.beeceptor.com", - "secret_token": "abcdef", - "id": "c4cf9c5f-0b60-4e5c-9db9-81321ffe31d5" - } - ] -} -``` +**HTTP Status Codes:** + +- **200 OK:** + Request successful. Server processed the request. + + ```json + { + "count": 1, + "next": null, + "previous": null, + "results": [ + { + "url": "https://sample.beeceptor.com", + "secret_token": "abcdef", + "id": "c4cf9c5f-0b60-4e5c-9db9-81321ffe31d5" + } + ] + } + ``` + +- **401 Unauthorized** + Returned when the request lacks valid authentication credentials. + + ```json + { + "detail": "Invalid token." + } + ``` +- **404 Not Found :** + If the wrong organization ID is provided: + + ```json + The requested resource was not found on this server. + ``` ## Update a webhook To update a webhook, you need to send an HTTP PUT request to the API Endpoint, with the [Authentication Header](../server-api/authentication.md). @@ -77,14 +118,40 @@ To update a webhook, you need to send an HTTP PUT request to the API Endpoint, w https://app.tpstreams.com/api/v1//webhooks// ``` -**Response** -```json -{ - "url": "https://sample1.beeceptor.com", - "secret_token": "abcdef", - "id": "c4cf9c5f-0b60-4e5c-9db9-81321ffe31d5" -} -``` + +**HTTP Status Codes:** + +- **200 OK:** + Request successful. Server processed the request. + + ```json + { + "url": "https://sample1.beeceptor.com", + "secret_token": "abcdef", + "id": "c4cf9c5f-0b60-4e5c-9db9-81321ffe31d5" + } + ``` + +- **404 Not Found :** + + If the wrong organization ID is provided: + ```json + The requested resource was not found on this server. + ``` + + If the wrong webhook ID is provided: + + ```json + { + "detail": "Not found." + } +- **401 Unauthorized :** + Returned when the request lacks valid authentication credentials. + + ```json + { + "detail": "Invalid token." + } ## Delete a webhook To delete a webhook, you need to send an HTTP DELETE request to the API Endpoint, with the [Authentication Header](../server-api/authentication.md). diff --git a/docs/video-embedding/aes-encryption.md b/docs/video-embedding/aes-encryption.md index 324e39be..861251c0 100644 --- a/docs/video-embedding/aes-encryption.md +++ b/docs/video-embedding/aes-encryption.md @@ -53,21 +53,44 @@ https://app.tpstreams.com/api/v1//assets//?expiry=100 The playback_url provided in the API response is the signed URL that you can use for secure video playback. -**Response** -```json -{ - "title": "sample.mp4", - "bytes": null, - "type": "video", - "video": { - .... - .... - "playback_url": "https://d384padtbeqfgy.cloudfront.net/transcoded_private/B66mmRm2TPF/video.m3u8?Expires=1692398327&Signature=OXqiVfCVAFrNoMq0hrpJ05YYY0XeyzA1H8kD6lv~~71v5PCdpf-9h1Qe~A0RFYoJuOq22j70juEFVJNjEr-WvVPvCvSRoYbRG6xEx5sr-541G~UkBXrcNXRHpb1988hQdG8NAh2pCV6o7bFOKsk3BBk8t6FRo-ZYs6xl46vFN8qH3FCNMhQLFmWqNpNo1vSPjmSSZlNrAplBkNq7MWxoNPxEFrzBgKusqrFZWLqOoXdzR8f9kb9VKkEQAPZL2tk71D6aN8toxwPV70esr8df78hkmAl3d4lChKZlrbWKd0tzew3RDPYZxicxfD1ZBx0th5PQfCltukkitQ0zPbE3TQ__&Key-Pair-Id=K2XWKDWM065EGO", - }, -} +### Response +**HTTP Status Codes:** + +For valid requests the API server returns a JSON +- **201 Created :** + Indicates successful creation of a new video resource + + ```json + { + "title": "sample.mp4", + "bytes": null, + "type": "video", + "video": { + .... + .... + "playback_url": "https://d384padtbeqfgy.cloudfront.net/transcoded_private/B66mmRm2TPF/video.m3u8?Expires=1692398327&Signature=OXqiVfCVAFrNoMq0hrpJ05YYY0XeyzA1H8kD6lv~~71v5PCdpf-9h1Qe~A0RFYoJuOq22j70juEFVJNjEr-WvVPvCvSRoYbRG6xEx5sr-541G~UkBXrcNXRHpb1988hQdG8NAh2pCV6o7bFOKsk3BBk8t6FRo-ZYs6xl46vFN8qH3FCNMhQLFmWqNpNo1vSPjmSSZlNrAplBkNq7MWxoNPxEFrzBgKusqrFZWLqOoXdzR8f9kb9VKkEQAPZL2tk71D6aN8toxwPV70esr8df78hkmAl3d4lChKZlrbWKd0tzew3RDPYZxicxfD1ZBx0th5PQfCltukkitQ0zPbE3TQ__&Key-Pair-Id=K2XWKDWM065EGO", + }, + + } + + ``` + +- **401 Unauthorized :** + Returned when the request lacks valid authentication credentials. + + ```json + { + "detail": "Invalid token." + } + ``` +- **404 Not Found :** + If the wrong organization ID is provided: + + ```json + The requested resource was not found on this server. + ``` -```