Update campaign
const url = 'https://portal.staging.arago-tech.com/line-items/campaigns/example';const options = { method: 'PATCH', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"name":"Discount on products","description":"Campaign to promote discount on products in the store"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://portal.staging.arago-tech.com/line-items/campaigns/example \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Discount on products", "description": "Campaign to promote discount on products in the store" }'Updates a campaign by its unique identifier
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”The campaign unique identifier
Request Body
Section titled “Request Body”The request to create a campaign
object
The name of the campaign. When omitted, the current name is preserved. Supplied names 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 storeResponses
Section titled “ Responses ”A successful response.
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
Example
{ "id": "63e2d42a27ad5f2b345ca123", "name": "Discount on products", "description": "Campaign to promote discount on products in the store", "created_at": "2021-01-01T00:00:00Z", "updated_at": "2021-01-01T00:00:00Z", "start_date": "2021-01-01T00:00:00Z", "end_date": "2021-01-31T00:00:00Z", "line_item_count": 10, "status": "STATUS_UNSPECIFIED"}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" } ]}