Package: api.video
api.video Python clientapi.videois the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.Table of contentsTable of contentsProject descriptionGetting startedRequirementsInstallationCode samplesAutomatic authenticationManual authenticationDocumentationAPI EndpointsAnalyticsApiCaptionsApiChaptersApiLiveStreamsApiPlayerThemesApiRawStatisticsApiUploadTokensApiVideosApiWatermarksApiWebhooksApiModelsHave you gotten use from this API client?ContributionProject descriptionapi.video's Python API client streamlines the coding process. Chunking files is handled for you, as is pagination and refreshing your tokens.Getting startedRequirementsPython >= 3.6Installationpipinstallapi.videoCode samplesAutomatic authenticationlist all videos:importapivideofromapivideo.apisimportVideosApiapi_key="__API_KEY__"withapivideo.AuthenticatedApiClient(api_key)asclient:# if you rather like to use the sandbox environment:# with apivideo.AuthenticatedApiClient(api_key, production=False) as client:videos_api=VideosApi(client)videos=videos_api.list()In this context the client will keep its authentication updated.Manual authenticationIf there is an issue, like you think a refresh token may have been exposed, you can manually retrieve a new one. Otherwise, authentication is handled for you.
When you retrieve a new refresh token, the old one becomes invalid. Here is the code, where you retrieve a list of videos and then refresh your token:importapivideofromapivideo.apisimportVideosApifromapivideo.exceptionsimportApiAuthExceptionapi_key="__API_KEY__"client=apivideo.AuthenticatedApiClient(api_key)# if you rather like to use the sandbox environment:# client = apivideo.AuthenticatedApiClient(api_key, production=False)client.connect()videos_api=VideosApi(client)videos=videos_api.list()try:client.refresh_token()exceptApiAuthException:print("cannot refresh token !")...DocumentationAPI EndpointsAll URIs are relative tohttps://ws.api.videoAnalyticsApiMethodHTTP requestDescriptionget_live_streams_playsGET/analytics/live-streams/playsGet play events for live streamget_videos_playsGET/analytics/videos/playsGet play events for videoCaptionsApiMethodHTTP requestDescriptionuploadPOST/videos/{videoId}/captions/{language}Upload a captiongetGET/videos/{videoId}/captions/{language}Retrieve a captionupdatePATCH/videos/{videoId}/captions/{language}Update a captiondeleteDELETE/videos/{videoId}/captions/{language}Delete a captionlistGET/videos/{videoId}/captionsList video captionsChaptersApiMethodHTTP requestDescriptionuploadPOST/videos/{videoId}/chapters/{language}Upload a chaptergetGET/videos/{videoId}/chapters/{language}Retrieve a chapterdeleteDELETE/videos/{videoId}/chapters/{language}Delete a chapterlistGET/videos/{videoId}/chaptersList video chaptersLiveStreamsApiMethodHTTP requestDescriptioncreatePOST/live-streamsCreate live streamgetGET/live-streams/{liveStreamId}Retrieve live streamupdatePATCH/live-streams/{liveStreamId}Update a live streamdeleteDELETE/live-streams/{liveStreamId}Delete a live streamlistGET/live-streamsList all live streamsupload_thumbnailPOST/live-streams/{liveStreamId}/thumbnailUpload a thumbnaildelete_thumbnailDELETE/live-streams/{liveStreamId}/thumbnailDelete a thumbnailPlayerThemesApiMethodHTTP requestDescriptioncreatePOST/playersCreate a playergetGET/players/{playerId}Retrieve a playerupdatePATCH/players/{playerId}Update a playerdeleteDELETE/players/{playerId}Delete a playerlistGET/playersList all player themesupload_logoPOST/players/{playerId}/logoUpload a logodelete_logoDELETE/players/{playerId}/logoDelete logoRawStatisticsApiMethodHTTP requestDescriptionlist_live_stream_sessionsGET/analytics/live-streams/{liveStreamId}List live stream player sessionslist_session_eventsGET/analytics/sessions/{sessionId}/eventsList player session eventslist_video_sessionsGET/analytics/videos/{videoId}List video player sessionsUploadTokensApiMethodHTTP requestDescriptioncreate_tokenPOST/upload-tokensGenerate an upload tokenget_tokenGET/upload-tokens/{uploadToken}Retrieve upload tokendelete_tokenDELETE/upload-tokens/{uploadToken}Delete an upload tokenlistGET/upload-tokensList all active upload tokensVideosApiMethodHTTP requestDescriptioncreatePOST/videosCreate a video objectuploadPOST/videos/{videoId}/sourceUpload a videoupload_with_upload_tokenPOST/uploadUpload with an delegated upload tokengetGET/videos/{videoId}Retrieve a video objectupdatePATCH/videos/{videoId}Update a video objectdeleteDELETE/videos/{videoId}Delete a video objectlistGET/videosList all video objectsupload_thumbnailPOST/videos/{videoId}/thumbnailUpload a thumbnailpick_thumbnailPATCH/videos/{videoId}/thumbnailSet a thumbnailget_statusGET/videos/{videoId}/statusRetrieve video status and detailsWatermarksApiMethodHTTP requestDescriptionuploadPOST/watermarksUpload a watermarkdeleteDELETE/watermarks/{watermarkId}Delete a watermarklistGET/watermarksList all watermarksWebhooksApiMethodHTTP requestDescriptioncreatePOST/webhooksCreate WebhookgetGET/webhooks/{webhookId}Retrieve Webhook detailsdeleteDELETE/webhooks/{webhookId}Delete a WebhooklistGET/webhooksList all webhooksModelsAccessTokenAdditionalBadRequestErrorsAnalyticsDataAnalyticsPlays400ErrorAnalyticsPlaysResponseAuthenticatePayloadBadRequestBytesRangeCaptionCaptionsListResponseCaptionsUpdatePayloadChapterChaptersListResponseLinkLiveStreamLiveStreamAssetsLiveStreamCreationPayloadLiveStreamListResponseLiveStreamSessionLiveStreamSessionClientLiveStreamSessionDeviceLiveStreamSessionLocationLiveStreamSessionReferrerLiveStreamSessionSessionLiveStreamUpdatePayloadMetadataModel403ErrorSchemaNotFoundPaginationPaginationLinkPlayerSessionEventPlayerThemePlayerThemeAssetsPlayerThemeCreationPayloadPlayerThemeUpdatePayloadPlayerThemesListResponseQualityRawStatisticsListLiveStreamAnalyticsResponseRawStatisticsListPlayerSessionEventsResponseRawStatisticsListSessionsResponseRefreshTokenPayloadRestreamsRequestObjectRestreamsResponseObjectTokenCreationPayloadTokenListResponseUploadTokenVideoVideoAssetsVideoClipVideoCreationPayloadVideoSessionVideoSessionClientVideoSessionDeviceVideoSessionLocationVideoSessionOsVideoSessionReferrerVideoSessionSessionVideoSourceVideoSourceLiveStreamVideoSourceLiveStreamLinkVideoStatusVideoStatusEncodingVideoStatusEncodingMetadataVideoStatusIngestVideoStatusIngestReceivedPartsVideoThumbnailPickPayloadVideoUpdatePayloadVideoWatermarkVideosListResponseWatermarkWatermarksListResponseWebhookWebhooksCreationPayloadWebhooksListResponseHave you gotten use from this API client?Please take a moment to leave a star on the clientThis helps other users to find the clients and also helps us understand which clients are most popular. Thank you!ContributionSince this API client is generated from an OpenAPI description, we cannot accept pull requests made directly to the repository. If you want to contribute, you can open a pull request on the repository of ourclient generator. Otherwise, you can also simply open an issue detailing your need on this repository.