Create campaign
const url = 'https://portal.staging.arago-tech.com/line-items/campaigns';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"name":"Discount on products","description":"Campaign to promote discount on products in the store","line_items":[{"budget":{"amount":1000,"currency":"EUR"},"end_date":"2021-01-31T00:00:00Z","name":"Discount on products","start_date":"2021-01-01T00:00:00Z"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://portal.staging.arago-tech.com/line-items/campaigns \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Discount on products", "description": "Campaign to promote discount on products in the store", "line_items": [ { "budget": { "amount": 1000, "currency": "EUR" }, "end_date": "2021-01-31T00:00:00Z", "name": "Discount on products", "start_date": "2021-01-01T00:00:00Z" } ] }'Creates a campaign with line items
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”The request to create a campaign with associated line items
The request to create a campaign with associated line items
object
The name of the campaign. Must not contain only whitespace (NOT_BLANK). Length is checked before surrounding whitespace is trimmed on write; the response returns the stored name.
Example
Discount on productsThe description of the campaign
Example
Campaign to promote discount on products in the storeThe list of line items to be associated with the campaign
The line item to associate with the campaign
object
The name of the line item. Optional; omitted names default to Line item N. Supplied names must not contain only whitespace (NOT_BLANK). Length is checked before surrounding whitespace is trimmed on write.
Example
A/B Test, version with 3D creativeThe start date and time of the line item
Example
2021-01-01T00:00:00ZThe end date and time of the line item
Example
2021-01-31T00:00:00ZThe tags associated with the line item. Each tag must be 3 to 255 characters and must not contain only whitespace (NOT_BLANK). Tags are not trimmed.
Example
[ "tag1", "tag2"]The spending cap of the line item
object
Total budget in the given currency. It must be at least 10 USD once converted; conversion is applied server-side after submission, so the smallest accepted value depends on the selected currency.
Example
1000Currency ID based on ISO 4217 numeric codes. The bond market units (XBA, XBB, XBC, XBD), the supranational units of account (XUA, XSU) and the fund codes (BOV, CHE, CHW, CLF, COU, USN, UYI) are rejected: no exchange rate is published for them, so a budget denominated in one could not be converted to USD.
Example
978Example
[ { "budget": { "amount": 1000, "currency": "EUR" }, "end_date": "2021-01-31T00:00:00Z", "name": "Discount on products", "start_date": "2021-01-01T00:00:00Z" }]Responses
Section titled “ Responses ”A successful response.
The campaign creation response containing the campaign identifier
object
The campaign unique identifier
The stored campaign name, with surrounding whitespace trimmed.
The description of the campaign
List of line items
Line item information
object
The unique identifier of the line item in hexadecimal format
The campaign unique identifier
The name of the line item
The UTC start date of the line item
The UTC end date of the line item
The status of the line item
The unique identifiers of the creatives of the line item
The unique identifier of the targeting of the line item
The unique identifier of the dynamic content optimization of the line item
The unique identifier of the pricing policy of the line item
The unique identifier of the banker of the line item
The UTC creation date of the line item
The UTC last updated date of the line item
The tags associated with the line item
The unique identifier of the tracking of the line item
The spending cap of the line item
object
Total budget in the given currency, as entered
Currency ID based on ISO 4217 numeric codes
The budget converted to USD at the rate in force when its amount or currency last changed, net of the platform fee
The creation date and time of the campaign
The last update date and time of the campaign
Example
{ "id": "63e2d42a27ad5f2b345ca123", "name": "Discount on products", "description": "Campaign to promote discount on products in the store", "line_items": [ { "id": "63e2d42a27ad5f2b345ca123", "name": "Line Item 1" }, { "id": "63e2d42a27ad5f2b345ca124", "name": "Line Item 2" } ], "created_at": "2021-01-01T00:00:00Z", "updated_at": "2021-01-01T00:00:00Z"}Bad request
object
Example
{ "error": { "code": "BAD_REQUEST", "details": [ { "code": "MAX_ITEMS", "field": "line_items", "message": "value must contain no more than 3000 item(s)", "params": { "max": "3000" } } ], "message": "Bad request" }}Unauthorized
object
Example
{ "error": { "code": "UNAUTHORIZED", "message": "Unauthorized" }}Internal server error
object
Example
{ "error": { "code": "INTERNAL_ERROR", "message": "Internal server error" }}default
Section titled “default”An unexpected error response.
object
object
Examplegenerated
{ "code": 1, "message": "example", "details": [ { "@type": "example" } ]}