Upload asset

POST https://{{base_url}}/v3/assets

The Upload asset request uploads an asset file to your stack.
To configure the permissions for your application via OAuth, please include the cm.assets.management:write scope.

To use the API Request, you will need to authenticate yourself either with a Management Token (highly recommended) or an Authtoken. 
Read more about it in Authentication.


For more information, refer to the Upload asset API Reference document

Request Params

KeyDatatypeRequiredDescription
relative_urlsbooleanSet this to 'true' to display the relative URL of the asset.
include_dimensionbooleanSet this to 'true' to include the dimensions (height and width) of the image in the response.
include_branchbooleanSet this to 'true' to include the '_branch' top-level key in the response. This key states the unique ID of the branch where the concerned Contentstack module resides.

Request Body

[{"name"=>"asset[upload]", "value"=>nil, "datatype"=>"null"}, {"name"=>"asset[parent_uid]", "value"=>nil, "datatype"=>"null"}, {"name"=>"asset[title]", "value"=>nil, "datatype"=>"null"}, {"name"=>"asset[description]", "value"=>nil, "datatype"=>"null"}, {"name"=>"asset[tags]", "value"=>nil, "datatype"=>"null"}]

HEADERS

KeyDatatypeRequiredDescription
api_keystringEnter the API key of your stack.
authtokenstringEnter your authtoken.
authorizationstringFor this call we recommend you to use management token.
Content-TypestringPass “multipart/form-data” to include form data body parameters.
branchstringEnter your branch unique ID.