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:
Name
|
Mandatory
|
Data type
|
Description |
---|---|---|---|
type | No | String |
Filter assets of a specified type. (Options: image, video, html, html_iec). |
titleId | No | String | Filter assets of a specific title. |
ids | No | String | ֿFilter by specified asset ids, separated by commasץ |
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/titles?
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.
Create Assets
Description: Use this API in order to create a new asset for a specific title.
Method: POST
Content type: multipart/form-data
Request Example URL: https://api.ironsrc.com/advertisers/v2/assets?
Name
|
Mandatory
|
Data type
|
Description
|
---|---|---|---|
titleId | Yes | Number | The title ID. |
type | Yes | String |
The type of the asset. One of the following: image, video. |
file | Yes | Blob | The actual file. |
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 } ] }