Upload asset file
const url = 'https://portal.staging.arago-tech.com/creatives/asset';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"file":{"content":"R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7","name":"creative.gif"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://portal.staging.arago-tech.com/creatives/asset \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "file": { "content": "R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", "name": "creative.gif" } }'Uploads a creative asset file (main image, native icon, video, …) and returns its public URL. The returned URL can then be referenced when upserting a creative, for example as its source_url or as a native metadata.icon_image_url. Only images and videos are accepted; the content must match the file extension.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”The request to upload an asset file
The request to upload an asset file
object
The asset file to upload (png, jpeg, jpg, gif or mp4). This can be a main creative image, a native asset such as the icon image, or a video.
object
The file name, with extension, of the media
Example
image.pngThe binary content of the file
Example
{ "content": "R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", "name": "creative.gif"}Responses
Section titled “ Responses ”A successful response.
The public URL of the uploaded asset file
object
The public URL of the uploaded asset file
Example
{ "url": "https://cdn.example.com/bucket/owner_user_id/<hash>/creative.png"}Bad request
object
Example
{ "error": { "code": "BAD_REQUEST", "details": [ { "code": "MAX_ITEMS", "field": "line_items", "message": "value must contain no more than 3000 item(s)", "params": { "max": "3000" } } ], "message": "Bad request" }}Unauthorized
object
Example
{ "error": { "code": "UNAUTHORIZED", "message": "Unauthorized" }}Internal server error
object
Example
{ "error": { "code": "INTERNAL_ERROR", "message": "Internal server error" }}default
Section titled “default”An unexpected error response.
object
object
Examplegenerated
{ "code": 1, "message": "example", "details": [ { "@type": "example" } ]}