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 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 Asset FoldersLink copied!
To get the asset repositories and asset folders for the current user or api client, you would use the following query:
Creating foldersLink copied!
Use the createAssetFolder
mutation to create a folder. Specify the assetRepositoryId
, label
, and include parentId
if you want to create the new folder within an existing folder. If parentId
is not specified then the folder is created at the top level of the asset repository.
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:
Creating, updating and deleting assetsLink 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.
createAsset - videoLink copied!
The following mutation query example details how you would create video assets. The src URL can be any valid video URL.
You can create the asset within a folder by specifying assetFolderId
. If no folder is specified then the asset will be created at the top level of the repository.
See the video transcoding examples for details of how to add transcoding profiles to a video.
When using the createAsset mutation, if an asset with the specified name already exists in your account, then a new asset with a unique filename will be created (a number will be appended to the filename).
createAsset - imageLink copied!
The following mutation query example details how you would create an image asset. The src URL can be any valid image URL.
createOrUpdateAssetByNameLink copied!
The createOrUpdateAssetByName
works in the same way as the createAsset
mutation, except that if an asset with the specified name already exists, then it will be updated.
Personal access token examplesLink copied!
Personal access tokens (PATs) can be used to authorize access to the account management features of the GraphQL Asset Management API and the 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 an existing transcoding profile that has been added to a video asset by using the reprocessVideoTranscodingProfiles
mutation.
Removing transcoding profileLink copied!
To remove a transcoding profile from a video asset use the removeVideoTranscodingProfiles
mutation. Note that there are no fields returned in the response.