Categorygithub.com/RustLangLatam/peertube_api_sdk_go
modulepackage
1.0.1
Repository: https://github.com/rustlanglatam/peertube_api_sdk_go.git
Documentation: pkg.go.dev

# README

Go API client for peertube_api_sdk_go

The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite HTTP/REST library for your programming language to use PeerTube. The spec API is fully compatible with openapi-generator which generates a client SDK in the language of your choice - we generate some client SDKs automatically:

See the REST API quick start for a few examples of using the PeerTube API.

Authentication

When you sign up for an account on a PeerTube instance, you are given the possibility to generate sessions on it, and authenticate there using an access token. Only one access token can currently be used at a time.

Roles

Accounts are given permissions based on their role. There are three roles on PeerTube: Administrator, Moderator, and User. See the roles guide for a detail of their permissions.

Errors

The API uses standard HTTP status codes to indicate the success or failure of the API call, completed by a RFC7807-compliant response body.

HTTP 1.1 404 Not Found
Content-Type: application/problem+json; charset=utf-8

{
  \"detail\": \"Video not found\",
  \"docs\": \"https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo\",
  \"status\": 404,
  \"title\": \"Not Found\",
  \"type\": \"about:blank\"
}

We provide error type (following RFC7807) and code (internal PeerTube code) values for a growing number of cases, but it is still optional. Types are used to disambiguate errors that bear the same status code and are non-obvious:

HTTP 1.1 403 Forbidden
Content-Type: application/problem+json; charset=utf-8

{
  \"detail\": \"Cannot get this video regarding follow constraints\",
  \"docs\": \"https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo\",
  \"status\": 403,
  \"title\": \"Forbidden\",
  \"type\": \"https://docs.joinpeertube.org/api-rest-reference.html#section/Errors/does_not_respect_follow_constraints\"
}

Here a 403 error could otherwise mean that the video is private or blocklisted.

Validation errors

Each parameter is evaluated on its own against a set of rules before the route validator proceeds with potential testing involving parameter combinations. Errors coming from validation errors appear earlier and benefit from a more detailed error description:

HTTP 1.1 400 Bad Request
Content-Type: application/problem+json; charset=utf-8

{
  \"detail\": \"Incorrect request parameters: id\",
  \"docs\": \"https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo\",
  \"instance\": \"/api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180\",
  \"invalid-params\": {
    \"id\": {
      \"location\": \"params\",
      \"msg\": \"Invalid value\",
      \"param\": \"id\",
      \"value\": \"9c9de5e8-0a1e-484a-b099-e80766180\"
    }
  },
  \"status\": 400,
  \"title\": \"Bad Request\",
  \"type\": \"about:blank\"
}

Where id is the name of the field concerned by the error, within the route definition. invalid-params.<field>.location can be either 'params', 'body', 'header', 'query' or 'cookies', and invalid-params.<field>.value reports the value that didn't pass validation whose invalid-params.<field>.msg is about.

Deprecated error fields

Some fields could be included with previous versions. They are still included but their use is deprecated:

  • error: superseded by detail

Rate limits

We are rate-limiting all endpoints of PeerTube's API. Custom values can be set by administrators:

Endpoint (prefix: /api/v1)CallsTime frame
/_*5010 seconds
POST /users/token155 minutes
POST /users/register2*5 minutes
POST /users/ask-send-verify-email35 minutes

Depending on the endpoint, *failed requests are not taken into account. A service limit is announced by a 429 Too Many Requests status code.

You can get details about the current state of your rate limit by reading the following headers:

HeaderDescription
X-RateLimit-LimitNumber of max requests allowed in the current time period
X-RateLimit-RemainingNumber of remaining requests in the current time period
X-RateLimit-ResetTimestamp of end of current time period as UNIX timestamp
Retry-AfterSeconds to delay after the first 429 is received

CORS

This API features Cross-Origin Resource Sharing (CORS), allowing cross-domain communication from the browser for some routes:

| Endpoint | |------------------------- ---| | /api/_* | | /download/_* | | /lazy-static/_* | | /.well-known/webfinger |

In addition, all routes serving ActivityPub are CORS-enabled for all origins.

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 7.0.0
  • Package version: 1.0.0
  • Generator version: 7.11.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://joinpeertube.org

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import peertube_api_sdk_go "github.com/GIT_USER_ID/GIT_REPO_ID/peertube_api_sdk_go"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value peertube_api_sdk_go.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), peertube_api_sdk_go.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value peertube_api_sdk_go.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), peertube_api_sdk_go.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using peertube_api_sdk_go.ContextOperationServerIndices and peertube_api_sdk_go.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), peertube_api_sdk_go.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), peertube_api_sdk_go.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://peertube2.cpy.re

ClassMethodHTTP requestDescription
AbusesAPIApiV1AbusesAbuseIdDeleteDelete /api/v1/abuses/{abuseId}Delete an abuse
AbusesAPIApiV1AbusesAbuseIdMessagesAbuseMessageIdDeleteDelete /api/v1/abuses/{abuseId}/messages/{abuseMessageId}Delete an abuse message
AbusesAPIApiV1AbusesAbuseIdMessagesGetGet /api/v1/abuses/{abuseId}/messagesList messages of an abuse
AbusesAPIApiV1AbusesAbuseIdMessagesPostPost /api/v1/abuses/{abuseId}/messagesAdd message to an abuse
AbusesAPIApiV1AbusesAbuseIdPutPut /api/v1/abuses/{abuseId}Update an abuse
AbusesAPIApiV1AbusesPostPost /api/v1/abusesReport an abuse
AbusesAPIGetAbusesGet /api/v1/abusesList abuses
AbusesAPIGetMyAbusesGet /api/v1/users/me/abusesList my abuses
AccountBlocksAPIApiV1BlocklistStatusGetGet /api/v1/blocklist/statusGet block status of accounts/hosts
AccountBlocksAPIApiV1ServerBlocklistAccountsAccountNameDeleteDelete /api/v1/server/blocklist/accounts/{accountName}Unblock an account by its handle
AccountBlocksAPIApiV1ServerBlocklistAccountsGetGet /api/v1/server/blocklist/accountsList account blocks
AccountBlocksAPIApiV1ServerBlocklistAccountsPostPost /api/v1/server/blocklist/accountsBlock an account
AccountsAPIApiV1AccountsNameRatingsGetGet /api/v1/accounts/{name}/ratingsList ratings of an account
AccountsAPIApiV1AccountsNameVideoChannelSyncsGetGet /api/v1/accounts/{name}/video-channel-syncsList the synchronizations of video channels of an account
AccountsAPIApiV1AccountsNameVideoChannelsGetGet /api/v1/accounts/{name}/video-channelsList video channels of an account
AccountsAPIApiV1AccountsNameVideoPlaylistsGetGet /api/v1/accounts/{name}/video-playlistsList playlists of an account
AccountsAPIGetAccountGet /api/v1/accounts/{name}Get an account
AccountsAPIGetAccountFollowersGet /api/v1/accounts/{name}/followersList followers of an account
AccountsAPIGetAccountVideosGet /api/v1/accounts/{name}/videosList videos of an account
AccountsAPIGetAccountsGet /api/v1/accountsList accounts
AutomaticTagsAPIApiV1AutomaticTagsAccountsAccountNameAvailableGetGet /api/v1/automatic-tags/accounts/{accountName}/availableGet account available auto tags
AutomaticTagsAPIApiV1AutomaticTagsPoliciesAccountsAccountNameCommentsGetGet /api/v1/automatic-tags/policies/accounts/{accountName}/commentsGet account auto tag policies on comments
AutomaticTagsAPIApiV1AutomaticTagsPoliciesAccountsAccountNameCommentsPutPut /api/v1/automatic-tags/policies/accounts/{accountName}/commentsUpdate account auto tag policies on comments
AutomaticTagsAPIApiV1AutomaticTagsServerAvailableGetGet /api/v1/automatic-tags/server/availableGet server available auto tags
ChannelsSyncAPIAddVideoChannelSyncPost /api/v1/video-channel-syncsCreate a synchronization for a video channel
ChannelsSyncAPIDelVideoChannelSyncDelete /api/v1/video-channel-syncs/{channelSyncId}Delete a video channel synchronization
ChannelsSyncAPITriggerVideoChannelSyncPost /api/v1/video-channel-syncs/{channelSyncId}/syncTriggers the channel synchronization job, fetching all the videos from the remote channel
ConfigAPIApiV1ConfigInstanceAvatarDeleteDelete /api/v1/config/instance-avatarDelete instance avatar
ConfigAPIApiV1ConfigInstanceAvatarPickPostPost /api/v1/config/instance-avatar/pickUpdate instance avatar
ConfigAPIApiV1ConfigInstanceBannerDeleteDelete /api/v1/config/instance-bannerDelete instance banner
ConfigAPIApiV1ConfigInstanceBannerPickPostPost /api/v1/config/instance-banner/pickUpdate instance banner
ConfigAPIDelCustomConfigDelete /api/v1/config/customDelete instance runtime configuration
ConfigAPIGetAboutGet /api/v1/config/aboutGet instance &quot;About&quot; information
ConfigAPIGetConfigGet /api/v1/configGet instance public configuration
ConfigAPIGetCustomConfigGet /api/v1/config/customGet instance runtime configuration
ConfigAPIPutCustomConfigPut /api/v1/config/customSet instance runtime configuration
HomepageAPIApiV1CustomPagesHomepageInstanceGetGet /api/v1/custom-pages/homepage/instanceGet instance custom homepage
HomepageAPIApiV1CustomPagesHomepageInstancePutPut /api/v1/custom-pages/homepage/instanceSet instance custom homepage
InstanceFollowsAPIApiV1ServerFollowersGetGet /api/v1/server/followersList instances following the server
InstanceFollowsAPIApiV1ServerFollowersNameWithHostAcceptPostPost /api/v1/server/followers/{nameWithHost}/acceptAccept a pending follower to your server
InstanceFollowsAPIApiV1ServerFollowersNameWithHostDeleteDelete /api/v1/server/followers/{nameWithHost}Remove or reject a follower to your server
InstanceFollowsAPIApiV1ServerFollowersNameWithHostRejectPostPost /api/v1/server/followers/{nameWithHost}/rejectReject a pending follower to your server
InstanceFollowsAPIApiV1ServerFollowingGetGet /api/v1/server/followingList instances followed by the server
InstanceFollowsAPIApiV1ServerFollowingHostOrHandleDeleteDelete /api/v1/server/following/{hostOrHandle}Unfollow an actor (PeerTube instance, channel or account)
InstanceFollowsAPIApiV1ServerFollowingPostPost /api/v1/server/followingFollow a list of actors (PeerTube instance, channel or account)
InstanceRedundancyAPIApiV1ServerRedundancyHostPutPut /api/v1/server/redundancy/{host}Update a server redundancy policy
JobAPIApiV1JobsPausePostPost /api/v1/jobs/pausePause job queue
JobAPIApiV1JobsResumePostPost /api/v1/jobs/resumeResume job queue
JobAPIGetJobsGet /api/v1/jobs/{state}List instance jobs
LiveVideosAPIAddLivePost /api/v1/videos/liveCreate a live
LiveVideosAPIApiV1VideosIdLiveSessionGetGet /api/v1/videos/{id}/live-sessionGet live session of a replay
LiveVideosAPIApiV1VideosLiveIdSessionsGetGet /api/v1/videos/live/{id}/sessionsList live sessions
LiveVideosAPIGetLiveIdGet /api/v1/videos/live/{id}Get information about a live
LiveVideosAPIUpdateLiveIdPut /api/v1/videos/live/{id}Update information about a live
LogsAPIGetInstanceAuditLogsGet /api/v1/server/audit-logsGet instance audit logs
LogsAPIGetInstanceLogsGet /api/v1/server/logsGet instance logs
LogsAPISendClientLogPost /api/v1/server/logs/clientSend client log
MyHistoryAPIApiV1UsersMeHistoryVideosGetGet /api/v1/users/me/history/videosList watched videos history
MyHistoryAPIApiV1UsersMeHistoryVideosRemovePostPost /api/v1/users/me/history/videos/removeClear video history
MyHistoryAPIApiV1UsersMeHistoryVideosVideoIdDeleteDelete /api/v1/users/me/history/videos/{videoId}Delete history element
MyNotificationsAPIApiV1UsersMeNotificationSettingsPutPut /api/v1/users/me/notification-settingsUpdate my notification settings
MyNotificationsAPIApiV1UsersMeNotificationsGetGet /api/v1/users/me/notificationsList my notifications
MyNotificationsAPIApiV1UsersMeNotificationsReadAllPostPost /api/v1/users/me/notifications/read-allMark all my notification as read
MyNotificationsAPIApiV1UsersMeNotificationsReadPostPost /api/v1/users/me/notifications/readMark notifications as read by their id
MySubscriptionsAPIApiV1UsersMeSubscriptionsExistGetGet /api/v1/users/me/subscriptions/existGet if subscriptions exist for my user
MySubscriptionsAPIApiV1UsersMeSubscriptionsGetGet /api/v1/users/me/subscriptionsGet my user subscriptions
MySubscriptionsAPIApiV1UsersMeSubscriptionsPostPost /api/v1/users/me/subscriptionsAdd subscription to my user
MySubscriptionsAPIApiV1UsersMeSubscriptionsSubscriptionHandleDeleteDelete /api/v1/users/me/subscriptions/{subscriptionHandle}Delete subscription of my user
MySubscriptionsAPIApiV1UsersMeSubscriptionsSubscriptionHandleGetGet /api/v1/users/me/subscriptions/{subscriptionHandle}Get subscription of my user
MySubscriptionsAPIApiV1UsersMeSubscriptionsVideosGetGet /api/v1/users/me/subscriptions/videosList videos of subscriptions of my user
MyUserAPIApiV1UsersMeAvatarDeleteDelete /api/v1/users/me/avatarDelete my avatar
MyUserAPIApiV1UsersMeAvatarPickPostPost /api/v1/users/me/avatar/pickUpdate my user avatar
MyUserAPIApiV1UsersMeVideoQuotaUsedGetGet /api/v1/users/me/video-quota-usedGet my user used quota
MyUserAPIApiV1UsersMeVideosGetGet /api/v1/users/me/videosList videos of my user
MyUserAPIApiV1UsersMeVideosImportsGetGet /api/v1/users/me/videos/importsGet video imports of my user
MyUserAPIApiV1UsersMeVideosVideoIdRatingGetGet /api/v1/users/me/videos/{videoId}/ratingGet rate of my user for a video
MyUserAPIGetUserInfoGet /api/v1/users/meGet my user information
MyUserAPIPutUserInfoPut /api/v1/users/meUpdate my user information
OverviewVideosAPIGetOverviewVideosGet /api/v1/overviews/videosGet overview of videos
PluginsAPIAddPluginPost /api/v1/plugins/installInstall a plugin
PluginsAPIApiV1PluginsNpmNamePublicSettingsGetGet /api/v1/plugins/{npmName}/public-settingsGet a plugin's public settings
PluginsAPIApiV1PluginsNpmNameRegisteredSettingsGetGet /api/v1/plugins/{npmName}/registered-settingsGet a plugin's registered settings
PluginsAPIApiV1PluginsNpmNameSettingsPutPut /api/v1/plugins/{npmName}/settingsSet a plugin's settings
PluginsAPIGetAvailablePluginsGet /api/v1/plugins/availableList available plugins
PluginsAPIGetPluginGet /api/v1/plugins/{npmName}Get a plugin
PluginsAPIGetPluginsGet /api/v1/pluginsList plugins
PluginsAPIUninstallPluginPost /api/v1/plugins/uninstallUninstall a plugin
PluginsAPIUpdatePluginPost /api/v1/plugins/updateUpdate a plugin
RegisterAPIAcceptRegistrationPost /api/v1/users/registrations/{registrationId}/acceptAccept registration
RegisterAPIDeleteRegistrationDelete /api/v1/users/registrations/{registrationId}Delete registration
RegisterAPIListRegistrationsGet /api/v1/users/registrationsList registrations
RegisterAPIRegisterUserPost /api/v1/users/registerRegister a user
RegisterAPIRejectRegistrationPost /api/v1/users/registrations/{registrationId}/rejectReject registration
RegisterAPIRequestRegistrationPost /api/v1/users/registrations/requestRequest registration
RegisterAPIResendEmailToVerifyRegistrationPost /api/v1/users/registrations/ask-send-verify-emailResend verification link to registration email
RegisterAPIVerifyRegistrationEmailPost /api/v1/users/registrations/{registrationId}/verify-emailVerify a registration email
RunnerJobsAPIApiV1RunnersJobsGetGet /api/v1/runners/jobsList jobs
RunnerJobsAPIApiV1RunnersJobsJobUUIDAbortPostPost /api/v1/runners/jobs/{jobUUID}/abortAbort job
RunnerJobsAPIApiV1RunnersJobsJobUUIDAcceptPostPost /api/v1/runners/jobs/{jobUUID}/acceptAccept job
RunnerJobsAPIApiV1RunnersJobsJobUUIDCancelGetGet /api/v1/runners/jobs/{jobUUID}/cancelCancel a job
RunnerJobsAPIApiV1RunnersJobsJobUUIDDeleteDelete /api/v1/runners/jobs/{jobUUID}Delete a job
RunnerJobsAPIApiV1RunnersJobsJobUUIDErrorPostPost /api/v1/runners/jobs/{jobUUID}/errorPost job error
RunnerJobsAPIApiV1RunnersJobsJobUUIDSuccessPostPost /api/v1/runners/jobs/{jobUUID}/successPost job success
RunnerJobsAPIApiV1RunnersJobsJobUUIDUpdatePostPost /api/v1/runners/jobs/{jobUUID}/updateUpdate job
RunnerJobsAPIApiV1RunnersJobsRequestPostPost /api/v1/runners/jobs/requestRequest a new job
RunnerRegistrationTokenAPIApiV1RunnersRegistrationTokensGeneratePostPost /api/v1/runners/registration-tokens/generateGenerate registration token
RunnerRegistrationTokenAPIApiV1RunnersRegistrationTokensGetGet /api/v1/runners/registration-tokensList registration tokens
RunnerRegistrationTokenAPIApiV1RunnersRegistrationTokensRegistrationTokenIdDeleteDelete /api/v1/runners/registration-tokens/{registrationTokenId}Remove registration token
RunnersAPIApiV1RunnersGetGet /api/v1/runnersList runners
RunnersAPIApiV1RunnersRegisterPostPost /api/v1/runners/registerRegister a new runner
RunnersAPIApiV1RunnersRunnerIdDeleteDelete /api/v1/runners/{runnerId}Delete a runner
RunnersAPIApiV1RunnersUnregisterPostPost /api/v1/runners/unregisterUnregister a runner
SearchAPISearchChannelsGet /api/v1/search/video-channelsSearch channels
SearchAPISearchPlaylistsGet /api/v1/search/video-playlistsSearch playlists
SearchAPISearchVideosGet /api/v1/search/videosSearch videos
ServerBlocksAPIApiV1ServerBlocklistServersGetGet /api/v1/server/blocklist/serversList server blocks
ServerBlocksAPIApiV1ServerBlocklistServersHostDeleteDelete /api/v1/server/blocklist/servers/{host}Unblock a server by its domain
ServerBlocksAPIApiV1ServerBlocklistServersPostPost /api/v1/server/blocklist/serversBlock a server
SessionAPIGetOAuthClientGet /api/v1/oauth-clients/localLogin prerequisite
SessionAPIGetOAuthTokenPost /api/v1/users/tokenLogin
SessionAPIRevokeOAuthTokenPost /api/v1/users/revoke-tokenLogout
StaticVideoFilesAPIStaticStreamingPlaylistsHlsFilenameGetGet /static/streaming-playlists/hls/{filename}Get public HLS video file
StaticVideoFilesAPIStaticStreamingPlaylistsHlsPrivateFilenameGetGet /static/streaming-playlists/hls/private/{filename}Get private HLS video file
StaticVideoFilesAPIStaticWebVideosFilenameGetGet /static/web-videos/{filename}Get public Web Video file
StaticVideoFilesAPIStaticWebVideosPrivateFilenameGetGet /static/web-videos/private/{filename}Get private Web Video file
StatsAPIApiV1MetricsPlaybackPostPost /api/v1/metrics/playbackCreate playback metrics
StatsAPIGetInstanceStatsGet /api/v1/server/statsGet instance stats
UserExportsAPIDeleteUserExportDelete /api/v1/users/{userId}/exports/{id}Delete a user export
UserExportsAPIListUserExportsGet /api/v1/users/{userId}/exportsList user exports
UserExportsAPIRequestUserExportPost /api/v1/users/{userId}/exports/requestRequest user export
UserImportsAPIGetLatestUserImportGet /api/v1/users/{userId}/imports/latestGet latest user import
UsersAPIAddUserPost /api/v1/usersCreate a user
UsersAPIConfirmTwoFactorRequestPost /api/v1/users/{id}/two-factor/confirm-requestConfirm two factor auth
UsersAPIDelUserDelete /api/v1/users/{id}Delete a user
UsersAPIDisableTwoFactorPost /api/v1/users/{id}/two-factor/disableDisable two factor auth
UsersAPIGetUserGet /api/v1/users/{id}Get a user
UsersAPIGetUsersGet /api/v1/usersList users
UsersAPIPutUserPut /api/v1/users/{id}Update a user
UsersAPIRequestTwoFactorPost /api/v1/users/{id}/two-factor/requestRequest two factor auth
UsersAPIResendEmailToVerifyUserPost /api/v1/users/ask-send-verify-emailResend user verification link
UsersAPIVerifyUserPost /api/v1/users/{id}/verify-emailVerify a user
VideoAPIAddViewPost /api/v1/videos/{id}/viewsNotify user is watching a video
VideoAPIApiV1VideosIdStudioEditPostPost /api/v1/videos/{id}/studio/editCreate a studio task
VideoAPIApiV1VideosIdWatchingPutPut /api/v1/videos/{id}/watchingSet watching progress of a video
VideoAPIDelVideoDelete /api/v1/videos/{id}Delete a video
VideoAPIDeleteVideoSourceFileDelete /api/v1/videos/{id}/source/fileDelete video source file
VideoAPIGetCategoriesGet /api/v1/videos/categoriesList available video categories
VideoAPIGetLanguagesGet /api/v1/videos/languagesList available video languages
VideoAPIGetLicencesGet /api/v1/videos/licencesList available video licences
VideoAPIGetVideoGet /api/v1/videos/{id}Get a video
VideoAPIGetVideoDescGet /api/v1/videos/{id}/descriptionGet complete video description
VideoAPIGetVideoPrivacyPoliciesGet /api/v1/videos/privaciesList available video privacy policies
VideoAPIGetVideoSourceGet /api/v1/videos/{id}/sourceGet video source file metadata
VideoAPIGetVideosGet /api/v1/videosList videos
VideoAPIListVideoStoryboardsGet /api/v1/videos/{id}/storyboardsList storyboards of a video
VideoAPIPutVideoPut /api/v1/videos/{id}Update a video
VideoAPIRequestVideoTokenPost /api/v1/videos/{id}/tokenRequest video token
VideoAPIUploadLegacyPost /api/v1/videos/uploadUpload a video
VideoAPIUploadResumablePut /api/v1/videos/upload-resumableSend chunk for the resumable upload of a video
VideoAPIUploadResumableCancelDelete /api/v1/videos/upload-resumableCancel the resumable upload of a video, deleting any data uploaded so far
VideoAPIUploadResumableInitPost /api/v1/videos/upload-resumableInitialize the resumable upload of a video
VideoBlocksAPIAddVideoBlockPost /api/v1/videos/{id}/blacklistBlock a video
VideoBlocksAPIDelVideoBlockDelete /api/v1/videos/{id}/blacklistUnblock a video by its id
VideoBlocksAPIGetVideoBlocksGet /api/v1/videos/blacklistList video blocks
VideoCaptionsAPIAddVideoCaptionPut /api/v1/videos/{id}/captions/{captionLanguage}Add or replace a video caption
VideoCaptionsAPIDelVideoCaptionDelete /api/v1/videos/{id}/captions/{captionLanguage}Delete a video caption
VideoCaptionsAPIGenerateVideoCaptionPost /api/v1/videos/{id}/captions/generateGenerate a video caption
VideoCaptionsAPIGetVideoCaptionsGet /api/v1/videos/{id}/captionsList captions of a video
VideoChannelsAPIAddVideoChannelPost /api/v1/video-channelsCreate a video channel
VideoChannelsAPIApiV1VideoChannelsChannelHandleAvatarDeleteDelete /api/v1/video-channels/{channelHandle}/avatarDelete channel avatar
VideoChannelsAPIApiV1VideoChannelsChannelHandleAvatarPickPostPost /api/v1/video-channels/{channelHandle}/avatar/pickUpdate channel avatar
VideoChannelsAPIApiV1VideoChannelsChannelHandleBannerDeleteDelete /api/v1/video-channels/{channelHandle}/bannerDelete channel banner
VideoChannelsAPIApiV1VideoChannelsChannelHandleBannerPickPostPost /api/v1/video-channels/{channelHandle}/banner/pickUpdate channel banner
VideoChannelsAPIApiV1VideoChannelsChannelHandleImportVideosPostPost /api/v1/video-channels/{channelHandle}/import-videosImport videos in channel
VideoChannelsAPIApiV1VideoChannelsChannelHandleVideoPlaylistsGetGet /api/v1/video-channels/{channelHandle}/video-playlistsList playlists of a channel
VideoChannelsAPIDelVideoChannelDelete /api/v1/video-channels/{channelHandle}Delete a video channel
VideoChannelsAPIGetVideoChannelGet /api/v1/video-channels/{channelHandle}Get a video channel
VideoChannelsAPIGetVideoChannelFollowersGet /api/v1/video-channels/{channelHandle}/followersList followers of a video channel
VideoChannelsAPIGetVideoChannelVideosGet /api/v1/video-channels/{channelHandle}/videosList videos of a video channel
VideoChannelsAPIGetVideoChannelsGet /api/v1/video-channelsList video channels
VideoChannelsAPIPutVideoChannelPut /api/v1/video-channels/{channelHandle}Update a video channel
VideoChaptersAPIGetVideoChaptersGet /api/v1/videos/{id}/chaptersGet chapters of a video
VideoChaptersAPIReplaceVideoChaptersPut /api/v1/videos/{id}/chaptersReplace video chapters
VideoCommentsAPIApiV1UsersMeVideosCommentsGetGet /api/v1/users/me/videos/commentsList comments on user's videos
VideoCommentsAPIApiV1VideosCommentsGetGet /api/v1/videos/commentsList instance comments
VideoCommentsAPIApiV1VideosIdCommentThreadsGetGet /api/v1/videos/{id}/comment-threadsList threads of a video
VideoCommentsAPIApiV1VideosIdCommentThreadsPostPost /api/v1/videos/{id}/comment-threadsCreate a thread
VideoCommentsAPIApiV1VideosIdCommentThreadsThreadIdGetGet /api/v1/videos/{id}/comment-threads/{threadId}Get a thread
VideoCommentsAPIApiV1VideosIdCommentsCommentIdApprovePostPost /api/v1/videos/{id}/comments/{commentId}/approveApprove a comment
VideoCommentsAPIApiV1VideosIdCommentsCommentIdDeleteDelete /api/v1/videos/{id}/comments/{commentId}Delete a comment or a reply
VideoCommentsAPIApiV1VideosIdCommentsCommentIdPostPost /api/v1/videos/{id}/comments/{commentId}Reply to a thread of a video
VideoDownloadAPIDownloadVideosGenerateVideoIdGetGet /download/videos/generate/:videoIdDownload video file
VideoFeedsAPIGetSyndicatedCommentsGet /feeds/video-comments.{format}Comments on videos feeds
VideoFeedsAPIGetSyndicatedSubscriptionVideosGet /feeds/subscriptions.{format}Videos of subscriptions feeds
VideoFeedsAPIGetSyndicatedVideosGet /feeds/videos.{format}Common videos feeds
VideoFeedsAPIGetVideosPodcastFeedGet /feeds/podcast/videos.xmlVideos podcast feed
VideoFilesAPIDelVideoHLSDelete /api/v1/videos/{id}/hlsDelete video HLS files
VideoFilesAPIDelVideoWebVideosDelete /api/v1/videos/{id}/web-videosDelete video Web Video files
VideoImportsAPIApiV1VideosImportsIdCancelPostPost /api/v1/videos/imports/{id}/cancelCancel video import
VideoImportsAPIApiV1VideosImportsIdDeleteDelete /api/v1/videos/imports/{id}Delete video import
VideoImportsAPIImportVideoPost /api/v1/videos/importsImport a video
VideoMirroringAPIDelMirroredVideoDelete /api/v1/server/redundancy/videos/{redundancyId}Delete a mirror done on a video
VideoMirroringAPIGetMirroredVideosGet /api/v1/server/redundancy/videosList videos being mirrored
VideoMirroringAPIPutMirroredVideoPost /api/v1/server/redundancy/videosMirror a video
VideoOwnershipChangeAPIApiV1VideosIdGiveOwnershipPostPost /api/v1/videos/{id}/give-ownershipRequest ownership change
VideoOwnershipChangeAPIApiV1VideosOwnershipGetGet /api/v1/videos/ownershipList video ownership changes
VideoOwnershipChangeAPIApiV1VideosOwnershipIdAcceptPostPost /api/v1/videos/ownership/{id}/acceptAccept ownership change request
VideoOwnershipChangeAPIApiV1VideosOwnershipIdRefusePostPost /api/v1/videos/ownership/{id}/refuseRefuse ownership change request
VideoPasswordsAPIApiV1VideosIdPasswordsGetGet /api/v1/videos/{id}/passwordsList video passwords
VideoPasswordsAPIApiV1VideosIdPasswordsPutPut /api/v1/videos/{id}/passwordsUpdate video passwords
VideoPasswordsAPIApiV1VideosIdPasswordsVideoPasswordIdDeleteDelete /api/v1/videos/{id}/passwords/{videoPasswordId}Delete a video password
VideoPlaylistsAPIAddPlaylistPost /api/v1/video-playlistsCreate a video playlist
VideoPlaylistsAPIAddVideoPlaylistVideoPost /api/v1/video-playlists/{playlistId}/videosAdd a video in a playlist
VideoPlaylistsAPIApiV1UsersMeVideoPlaylistsVideosExistGetGet /api/v1/users/me/video-playlists/videos-existCheck video exists in my playlists
VideoPlaylistsAPIApiV1VideoPlaylistsPlaylistIdDeleteDelete /api/v1/video-playlists/{playlistId}Delete a video playlist
VideoPlaylistsAPIApiV1VideoPlaylistsPlaylistIdGetGet /api/v1/video-playlists/{playlistId}Get a video playlist
VideoPlaylistsAPIApiV1VideoPlaylistsPlaylistIdPutPut /api/v1/video-playlists/{playlistId}Update a video playlist
VideoPlaylistsAPIDelVideoPlaylistVideoDelete /api/v1/video-playlists/{playlistId}/videos/{playlistElementId}Delete an element from a playlist
VideoPlaylistsAPIGetPlaylistPrivacyPoliciesGet /api/v1/video-playlists/privaciesList available playlist privacy policies
VideoPlaylistsAPIGetPlaylistsGet /api/v1/video-playlistsList video playlists
VideoPlaylistsAPIGetVideoPlaylistVideosGet /api/v1/video-playlists/{playlistId}/videosList videos of a playlist
VideoPlaylistsAPIPutVideoPlaylistVideoPut /api/v1/video-playlists/{playlistId}/videos/{playlistElementId}Update a playlist element
VideoPlaylistsAPIReorderVideoPlaylistPost /api/v1/video-playlists/{playlistId}/videos/reorderReorder a playlist
VideoRatesAPIApiV1VideosIdRatePutPut /api/v1/videos/{id}/rateLike/dislike a video
VideoStatsAPIApiV1VideosIdStatsOverallGetGet /api/v1/videos/{id}/stats/overallGet overall stats of a video
VideoStatsAPIApiV1VideosIdStatsRetentionGetGet /api/v1/videos/{id}/stats/retentionGet retention stats of a video
VideoStatsAPIApiV1VideosIdStatsTimeseriesMetricGetGet /api/v1/videos/{id}/stats/timeseries/{metric}Get timeserie stats of a video
VideoTranscodingAPICreateVideoTranscodingPost /api/v1/videos/{id}/transcodingCreate a transcoding job
WatchedWordsAPIApiV1WatchedWordsAccountsAccountNameListsGetGet /api/v1/watched-words/accounts/{accountName}/listsList account watched words
WatchedWordsAPIApiV1WatchedWordsAccountsAccountNameListsListIdDeleteDelete /api/v1/watched-words/accounts/{accountName}/lists/{listId}Delete account watched words
WatchedWordsAPIApiV1WatchedWordsAccountsAccountNameListsListIdPutPut /api/v1/watched-words/accounts/{accountName}/lists/{listId}Update account watched words
WatchedWordsAPIApiV1WatchedWordsAccountsAccountNameListsPostPost /api/v1/watched-words/accounts/{accountName}/listsAdd account watched words
WatchedWordsAPIApiV1WatchedWordsServerListsGetGet /api/v1/watched-words/server/listsList server watched words
WatchedWordsAPIApiV1WatchedWordsServerListsListIdDeleteDelete /api/v1/watched-words/server/lists/{listId}Delete server watched words
WatchedWordsAPIApiV1WatchedWordsServerListsListIdPutPut /api/v1/watched-words/server/lists/{listId}Update server watched words
WatchedWordsAPIApiV1WatchedWordsServerListsPostPost /api/v1/watched-words/server/listsAdd server watched words

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

OAuth2

  • Type: OAuth
  • Flow: password
  • Authorization URL:
  • Scopes:
  • admin: Admin scope
  • moderator: Moderator scope
  • user: User scope

Example

auth := context.WithValue(context.Background(), peertube_api_sdk_go.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

import "golang.org/x/oauth2"

/* Perform OAuth2 round trip request and obtain a token */

tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, peertube_api_sdk_go.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

IsNil checks if an input is nil.
NewAPIResponse returns a new APIResponse object.
NewAPIResponseWithError returns a new APIResponse object with the provided error message.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PtrBool is a helper routine that returns a pointer to given boolean value.
PtrFloat32 is a helper routine that returns a pointer to given float value.
PtrFloat64 is a helper routine that returns a pointer to given float value.
PtrInt is a helper routine that returns a pointer to given integer value.
PtrInt32 is a helper routine that returns a pointer to given integer value.
PtrInt64 is a helper routine that returns a pointer to given integer value.
PtrString is a helper routine that returns a pointer to given string value.
PtrTime is helper routine that returns a pointer to given Time value.

# Structs

APIResponse stores the API response returned by the server.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author