Examples
Query examplesLink copied!
Getting an Asset by the IDLink copied!
In the query below, we are querying for the createdDate
and label
of three specific assets using each of their ids.
This query gives us the following response:
Getting the Asset RepositoriesLink copied!
If you would like to access the asset repositories for the current user or API client, you would use the following query:
Getting the Asset FoldersLink copied!
To get the asset repositories and asset folders for the current user or api client, you would use the following query:
Getting the Media Hub IDLink copied!
If you would like to obtain the mediaHubId
that is needed for the createTransformationTemplate mutation
you would use the following query:
Getting the Organization idLink copied!
To get the organization id that is needed for the removeBackgroundFromImage
mutation you can use the following query:
Mutation examplesLink copied!
deleteAssetsLink copied!
The following mutation query example details how you would delete assets by ID:
updateAssetsLink copied!
The following mutation query example details how you would update assets by specific id:
updateAssetMetadataLink copied!
The following mutation query example details how you would update the metadata of your assets by a specific id, with the inclusion of what you would like the existing meta data to be replaced by:
createAsset - videoLink copied!
The following mutation query example details how you would create video assets. The src URL can be any valid video URL.
If you use the GraphQL Asset Management API to upload videos they will not be automatically transcoded. Instead, you must transcode video files manually. See Uploading video to Content Hub.
createAsset - imageLink copied!
The following mutation query example details how you would create image assets. The src URL can be any valid image URL.
Personal access token examplesLink copied!
Personal access tokens (PATs) can be used to authorize access to the GraphQL Asset Management API and Dynamic Content Management API. Access tokens are associated with users within an organization.
Creating an access tokenLink copied!
To create a PAT use the createPersonalAccessToken
mutation and send the organizationId and a name as input.
Listing your access tokensLink copied!
This query will list all tokens assigned to the user.
Deleting an access tokenLink copied!
Use thedeletePersonalAccessToken
mutation to delete a token. The token will be revoked and can no longer be used for authentication.
Video transcodingLink copied!
Listing transcoding profilesLink copied!
You can use the following query to list all the available video transcoding profiles. This example includes all the supported fields in the response, although in most cases you will just need the id to add, reprocess and remove a profile from a video asset.
Adding transcoding profiles to an assetLink copied!
The following mutation shows how to add one or more video transcoding profiles to a video asset. You need to specify the asset id and one or more profile ids. The profile will start processing when it is added to the asset.
Reprocessing transcoding profilesLink copied!
You can reprocess one or more existing transcoding profiles that have been added to a video asset by using the reprocessVideoTranscodingProfiles
mutation.
Removing transcoding profilesLink copied!
To remove transcoding profiles from a video asset use the removeVideoTranscodingProfiles
mutation. Note that there are no fields returned in the response.
Example response: