To create or update a public link you need to have X-Auth-Token header set for all requests which you send. It can be obtained as described here: https://docs.stylelabs.com/contenthub/4.1.x/content/integrations/rest-api/authenticate/get-token.html
Create a public link for an asset
Send a POST request to /api/entitydefinitions/M.PublicLink/entities URL with the following body:
{ |
If the operation is successful, 201 response code must be received and the body must have id and identifier of the created entity. RelativeUrl must be a unique random guid.
Wait until link is ready
Send GET request to /api/entities/PublicLinkEntityId and check the properties.Status value in the returned response. When it is Completed, the link is ready.
Update existing public link
Send a PUT request to api/entities/PublicLinkEntityId URL with the body which has modifications to the properties which needs to be updated.
For example, changing the ExpirationDate can be done as follows:
{ |
entitydefinition property is mandatory and must be present in the request.