Use this endpoint to upload single asset.
Request
End Point https://business.newsbreak.com/business-api/v1/ad/uploadAssets
Method POST
Header
| Field | Required | Data Type | Description |
|---|---|---|---|
| Access-Token | Y | string | Authorized access token. |
| Content-Type | Y | string | Request message type Allowed format: application/json. |
Request Parameters
| Field | Required | Data Type | Description |
|---|---|---|---|
| asset | Y | binary | Assets to be uploaded. |
| adAccountId | Y | string | ID of the ad account of the ad. |
| saveToMediaLibrary | N | boolean | Save that media to the account's Media Library (reusable in the ad platform UI) |
| mediaName | N | string |
Media Name (3-256 chars) Required only if saveToMediaLibrary=true |
Example
curl -X 'POST' \
'https://business.newsbreak.com/business-api/v1/ad/uploadAssets' \
-F "asset=@/Users/tom/Documents/test1.png" \
-F "adAccountId=1234567" \
-F "saveToMediaLibrary=true" \
-F "mediaName=Holiday Campaign 1"
-H 'accept: application/json' \
-H 'Access-Token: {{Access-Token}}'
Response
Response Parameters
| Field | Data Type | Description |
|---|---|---|
| code | int | Status code, see Return Codes. |
| errMsg | string | Error message when code!=0. |
| data | object | Response object. |
| └── assetUrl | string | Url of the image/video/gif. |
| └── mediaId | string | Media ID. |
Example
{
"code": 0,
"data": {
"assetUrl": "https://static.particlenews.com/nova/assets/1234567/example.png"
"mediaId": "987654321012345678"
}
}