Assets API
The Assets API allows you to manage your assets (get and create).
Authentication
Get Assets
Description: Use this API to retrieve a list of your assets. The response will include the following: id, titleId, type, orientation, source, duration.
Required Parameters:None
Method:GET
Endpoint: https://api.ironsrc.com/advertisers/v2/assets?
Parameters:
Field | Mandatory | Data type | Description |
type | No | string | Filter by asset type. (image, video, html) |
titleId | No | string | Filter assets of a specific title |
ids | No | string | ֿFilter by specified asset ids, separated by commas |
status | No | string | Filter by status. (approved, denied, pending_approval) |
requestId | No | string | Used for paginated requests. |
pageNumber | No | Number | Used for paginated requests. |
resultsBulkSize | No | Number | Used for paginated requests. |
Request Example
Get https://api.ironsrc.com/advertisers/v2/assets?
Response example
{
"assets": [{
"id": 200305,
"type": "video",
"titleId": 501567,
"orientation": "all",
"source": "none",
"duration": 30
}, {
"id": 200304,
"type": "image",
"titleId": 501567,
"orientation": "all",
"source": "none",
"duration": null
}, {
"id": 200303,
"type": "html_iec",
"titleId": 501567,
"orientation": "all",
"source": "playworks",
"duration": null
}, {
"id": 200302,
"type": "video",
"titleId": 501567,
"orientation": "all",
"source": "none",
"duration": 17
}, {
"id": 200301,
"type": "html",
"titleId": 501567,
"orientation": "portrait",
"source": "none",
"duration": null
}, {
"id": 200300,
"type": "html_iec",
"titleId": 501567,
"orientation": "portrait",
"source": "none",
"duration": null
}],
"totalResultsCount": 6,
"requestId": "MjA1MzUzLjIwMDMwMy40LjM1OTY="
}
The API returns by default the first 3000 assets.
For better performance – we strongly recommend to work with pagination requests in all cases,
To do so you should use ‘resultsBulkSize’ parameter – This parameter will limit the amount of the results you get in the response.
In order to get the next bulk of results, use ‘pageNumber’ parameter, combined with the ‘requestId’ parameter – which is received in the first response.
Pagination request Example URL:
In the first request you set the results number limitation: https://api.ironsrc.com/advertisers/v2/assets?resultsBulkSize=2
Pagination response example:
{
"assets": [{
"id": 200305,
"type": "video",
"titleId": 501567,
"orientation": "all",
"source": "none",
"duration": 30
}, {
"id": 200304,
"type": "image",
"titleId": 501567,
"orientation": "all",
"source": "none",
"duration": null
}],
"totalResultsCount": 6,
"requestId": "MjA1MzUzLjIwMDMwMy40LjM1OTY="
}
For the next pages, use the requestId from the response and the required pageNumber.
For example: https://api.ironsrc.com/advertisers/v2/assets?requestId=MjE2MDkzLjUwMTEwMC4yLjE5&pageNumber=2
Keep increasing the ‘pageNumber’ param to get the following pages.
Upload image & video Assets
Description: Use this API in order to upload and create a new asset for a specific title.
Method: POST
Content type: multipart/form-data
Endpoint: https://api.ironsrc.com/advertisers/v2/assets?
Body Parameters:
Name
|
Mandatory
|
Data type
|
Description
|
---|---|---|---|
titleId | Yes | Number | The title ID. |
type | Yes | String | The type of the asset you wish to upload (image, video) |
file | Yes | Blob | The actual image or video file. |
name | No | String | Asset name (max 200 characters) |
Files Requirements
Image
File format: png,jpg,jpeg,gif
Max file size: 2MB
Min dimension: 320px
Max dimension: 3,840px
Ratio: From 1:2 to 2:1
Video
Max file size: 100MB
Max duration: 60sec
Ratio: From 1:2 to 2:1
Note: Videos longer than 30sec will have limited traffic
Response example:
{
"assets": [{
"id": 200314,
"type": "image",
"titleId": 411675,
"orientation": "all",
"source": "none",
"duration": null
}]
}
Upload HTML creative asset
Use this API to upload and create your HTML asset file in the next 3 steps.
Step 1 – Upload HTML asset
Description: On this step the asset will be automatically verification to make sure it works well with our ad player. You can use the polling endpoint (step 2) to get the test status.
Method: POST
Content type: multipart/form-data
Endpoint: https://api.ironsrc.com/advertisers/v2/assets/html/upload
Body Parameters:
Field | Mandatory | Data type | Description |
file | Yes | Blob | The actual HTML file |
titleId | Yes | number | The title ID. |
name | No | String | Asset name (max 200 characters) |
Response:
{
"submissionId":'your_submission_id'
}
Note:
- Duplication is a particular case in which the error message will be:
Duplication found – This HTML file already exists – Asset ID: ${existing_asset_id}
- Rate limit: 200 requests per hour
- submissionId is valid for 2 hours
Step 2 – HTML Asset Polling
Description: use this endpoint to check if the asset passed the automatic verification, if passed, proceed to submit the asset for review (step 3).
Content type: application/json
Method: GET
Endpoint: https://api.ironsrc.com/advertisers/v2/assets/html/polling
Parameters:
Field | Mandatory | Data type | Description | |
submissionId | Yes | string | The Submission ID provided on the upload response. |
Response: {
"pollingStatus": "Success" / "Pending" / "Failed",
"validations": {
"isReadyCalled": {
"status": "Success" / "Pending" / "Failed",
"error": appears only
if the status = "Failed"
},
"getAutoVolumeCalled": {
"status": "Success" / "Pending" / "Failed",
"error": appears only
if the status = "Failed"
},
"audioVolumeChangeListened": {
"status": "Success" / "Pending" / "Failed",
"error": appears only
if the status = "Failed"
},
"getScreenSizeCalled": {
"status": "Success" / "Pending" / "Failed",
"error": appears only
if the status = "Failed"
},
"nativeCloseButton": {
"status": "Success" / "Pending" / "Failed",
"error": appears only
if the status = "Failed"
}
Step 3 – Submit HTML assets for review
Description: Use this endpoint to submit asset for our review process.
Content type: application/json
Method: POST
Endpoint: https://api.ironsrc.com/advertisers/v2/assets/html/submit
Body Parameters:
Field | Mandatory | Data type | Description | |
submissionId | Yes | string | The Submission ID provided on the upload response. |
Response:
{
"assets": [{
"id": 200314
}]
}
You can use the “asset id” provided with the “get” method to pull the asset approval status.