Creating an asset
Learn how to create an image, video, html, or json asset.
Overview
Creating an asset is a two-step process where you first create the asset and then upload the actual file.
For more information about using the assets in your campaigns, see the working with assets page.
Step 1: Create the asset
Create the asset by calling the Create Asset API. This will return an upload URL along with all the information needed to upload the file.
The asset status will be pending_upload
at this point.
Step 2: Upload the file
The upload URL is only valid for a short period of time, so make sure to upload the file within 30 minutes after creating the asset.
If the upload URL expires, you can create a new asset and use the new upload URL.
Once you have the upload URL, you can upload the file using a standard HTTP POST request.
Example API Request for image/html/json assets
Following Python snippet shows how to upload a GIF asset using the id
, fields
, and uploadUrl
returned in the asset creation response.
You can also use your preferred language and library to upload the file:
Example API Request for video assets
Following Python snippet shows how to upload a video asset using the id
and uploadUrl
returned in the asset creation response.
You can also use your preferred language and library to upload the file:
Step 3: Confirm that the asset is ready to use
Once the file has been uploaded, you can confirm that the asset is ready to use by calling the Get Asset API after a few seconds delay. In the case of videos, the delay might be longer due to the video encoding process.
The asset status should now be approved
and the url
field will contain the URL to the asset. You can now use the asset in your campaigns by passing the asset ID in your banners during campaign creation.