List campaigns
const url = 'https://portal.staging.arago-tech.com/line-items/campaigns';const options = {method: 'GET', headers: {Authorization: '<Authorization>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://portal.staging.arago-tech.com/line-items/campaigns \ --header 'Authorization: <Authorization>'Returns a list of campaigns
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters”Query
Search query to filter campaigns by name, description or other searchable fields
Statuses
List of statuses to filter campaigns by
From Date
Filter items with date on or after this timestamp
To Date
Filter items with date strictly before this timestamp. Must be after ‘from’ when both are provided.
From Date
Filter items with date on or after this timestamp
To Date
Filter items with date strictly before this timestamp. Must be after ‘from’ when both are provided.
Field
The field to sort by. This should be a valid field name in the context of the request.
Desc
The sort order. If true, the results will be sorted in descending order. If false, the results will be sorted in ascending order.
Offset
The offset of the first item
Limit
The maximum number of items to return (must be >= 10 and <= 1000)
Tags
List of tags to filter campaigns by
From Date
Filter items with date on or after this timestamp
To Date
Filter items with date strictly before this timestamp. Must be after ‘from’ when both are provided.
Responses
Section titled “ Responses ”A successful response.
object
The list of campaigns
object
The campaign unique identifier
The name of the campaign
The description of the campaign
The creation date and time of the campaign
The last update date and time of the campaign
The earliest start date of line items in the campaign
The latest end date of line items in the campaign
The total number of line items in the campaign
The aggregated status of the campaign based on line item statuses
Flag indicating if full text search has been performed
Example
{ "campaigns": [ { "id": "63e2d42a27ad5f2b345ca123", "name": "Discount on products" }, { "id": "63e2d42a27ad5f2b345ca124", "name": "New Year Sale" } ]}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" } ]}