Share token
This relation targets share token.
Get all share token
GET /api/dam/medias/{mediaId}/share/tokens
The response will contain a paginated list of share token resources. Share token resources will follow the following schema:
"properties": {
"title": {
"type": "string"
},
"tokenValue": {
"type": "string"
},
"suffix": {
"type": "string"
}
},
"isManualActive": {
"type": "boolean"
},
"exportDefinition": {
"type": {
"type": "string",
"enum": [
"NOT_GRANTED",
"BD",
"HD"
]
},
},
"templateId": {
"type": "integer"
},
"createUser": {
"type": "integer"
},
"creationDate": {
"type": "string",
"format": "date-time"
}
}
Possible errors are:
-
403
(share-token-operation-forbidden): To get share token on a media user has to have READ right on this media -
404
(share-token-not-found): If the share token does not exist or if the share token is not linked to requested media
Get a share token
GET /api/dam/medias/{mediaId}/share/tokens/{tokenId}
If the share template exists and is readable by the user, the HTTP status of the response will be 200
. The body of the response will follow the following schema:
"properties": {
"title": {
"type": "string"
},
"tokenValue": {
"type": "string"
},
"suffix": {
"type": "string",
},
"active": {
"type": "boolean"
},
"manualActivate": {
"type": "boolean"
},
"exportDefinition": {
"type": {
"type": "string",
"enum": [
"NOT_GRANTED",
"BD",
"HD"
]
}
},
"templateId": {
"type": "integer"
},
"createUser": {
"type": "integer"
},
"createDate": {
"type": "string",
"format": "date-time"
}
}
Possible errors are:
-
403
(share-token-operation-forbidden): To get share token on a media user has to have READ right on this media -
404
(share-token-not-found): If the share token does not exist or if the share token is not linked to requested media
Create a share token
Header: Content-type:application/json
POST /api/dam/medias/{mediaId}/share/tokens
Request body must contain the following attributes:
-
title
: the title of the token -
exportDefinition
: Enum value which define the level download -
templateId
: The id of the share template -
templateDomainId
: The id of the share template domain
The body must follow the following schema:
"title": [
{
"type": "string",
"value": "Token of media 1"
},
],
"exportDefinition": {
"type": {
"type": "string",
"enum": [
"NOT_GRANTED",
"BD",
"HD"
]
}
},
"suffix": {
"type": "string",
},
"templateId": {
"type": "integer"
}
Request body can contain the following attributes:
-
manualActivate
: boolean which activate the mode manual or not -
activationDate
: It's a date to indicate the moment when the token is activated -
deactivationDate
: It's a date to indicate the moment when the token is deactivated -
suffix
: A string to add at the end of the uri. Please note the suffix is appended without any separator, you should take care of setting a value that permits to distinguish the token value from the suffix.example:
"manualActivate": true,
"activationDate": "2021-08-16T12:14:03Z",
"deactivationDate": "2021-08-17T12:14:03Z"
"suffix": "?iAmASuffix"
If the share token is created with success, the HTTP status of the response will be 201
. It is then possible to get the location of the newly created resource in the Location
HTTP response header.
Possible errors are:
-
403
(share-token-operation-forbidden): To get share token on a media user has to have READ right on this media -
404
(share-token-not-found): If the share token does not exist or if the share token is not linked to requested media
Update a share token
Header: Content-type:application/json
PUT /api/dam/medias/{mediaId}/share/tokens/{tokenValue}
Request body must contain the complete representation of the share token, the missing attributes will be erased. The available attributes are:
-
title
: the title of the token -
exportDefinition
: Enum value which define the level download -
suffix
: A string to add at the end of the uri. Please note the suffix is appended without any separator, you should take care of setting a value that permits to distinguish the token value from the suffix. -
manualActivate
: boolean which activate the mode manual or not -
activationDate
: It's a date to indicate the moment when the token is activated -
deactivationDate
: It's a date to indicate the moment when the token is deactivated
If the share token is updated with success, the HTTP status of the response will be 204
.
Possible errors are:
-
400
(share-token-create-all-ready-exist): the token all exist -
403
(share-token-operation-forbidden): To get share token on a media user has to have READ right on this media -
404
(share-token-not-found): If the share token does not exist or if the share token is not linked to requested media
Delete a share token
DELETE /api/dam/medias/{mediaId}/share/tokens/{tokenValue}
If the share token is deleted with success, the HTTP status of the response will be 204
.
Possible errors are:
-
403
(share-token-operation-forbidden): User needs to be an administrator to be able to delete a share token -
404
(share-token-media-not-found): Requested share token media does not exist -
404
(share-token-not-found): If the share token does not exist or if the share token is not linked to requested media
4.62.0+