PUT /api/v3/campaigns/{lcuid}/inventory-items¶
Summary¶
PUT campaigns/{lcuid}/inventory-items
Description¶
Add existing inventory items to a campaign based on either their lcuid or the vendor supplied unique_id These items must already exist in the system created via data sources, manual post or some other method
One of inventory_item_lcuids or inventory_item_unique_ids is required but not both
When adding an item to a campaign, it may not yet have creatives attached to it if the creative build process has not yet completed. You can check the status of creative_state for an item to determine the state of its creatives
Tags: campaigns
Parameters¶
Header Parameters¶
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
Authorization |
string |
✓ Yes | Bearer {AuthToken} |
|
Content-Type |
string |
✓ Yes | application/json |
|
Accept |
string |
✓ Yes | application/json |
|
AppIdV3 |
string |
✓ Yes | LCUID-LAP-********-****-****-****-************ |
Request Body¶
Content Type: application/json¶
Schema¶
Type: object
Properties:
inventory_item_lcuids(object): An array of inventory item lcuids to add to the campaign.This field is required wheninventory_item_unique_idsis not present.inventory_item_unique_ids(object): An array of vendor unique ids to add to the campaign.This field is required wheninventory_item_lcuidsis not present.
Responses¶
Response: 200¶
Description: Sample Response
Content Type: application/json¶
Schema¶
Type: object
Properties:
success(boolean)
Example Response¶
Example Implementations¶
Bash (cURL)¶
curl --request PUT \
"https://api.lucit.app/api/v3/campaigns/LCUID-LE-506fc585-77be-11ec-acb9-c2cdb617d190/inventory-items" \
--header "Authorization: Bearer {AuthToken}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "AppIdV3: LCUID-LAP-********-****-****-****-************" \
--data "{
\"inventory_item_lcuids\": [
\"LCUID-LI-506fc585-77be-11ec-acb9-c2cdb617d190\",
\"LCUID-LI-906fc585-12be-11ec-acb9-c2cdb617d190\"
],
\"inventory_item_unique_ids\": [
\"123456\",
\"222346\"
]
}"
JavaScript (Fetch API)¶
const url = new URL(
"https://api.lucit.app/api/v3/campaigns/LCUID-LE-506fc585-77be-11ec-acb9-c2cdb617d190/inventory-items"
);
const headers = {
"Authorization": "Bearer {AuthToken}",
"Content-Type": "application/json",
"Accept": "application/json",
"AppIdV3": "LCUID-LAP-********-****-****-****-************",
};
let body = {
"inventory_item_lcuids": [
"LCUID-LI-506fc585-77be-11ec-acb9-c2cdb617d190",
"LCUID-LI-906fc585-12be-11ec-acb9-c2cdb617d190"
],
"inventory_item_unique_ids": [
"123456",
"222346"
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
PHP (Guzzle)¶
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://api.lucit.app/api/v3/campaigns/LCUID-LE-506fc585-77be-11ec-acb9-c2cdb617d190/inventory-items',
[
'headers' => [
'Authorization' => 'Bearer {AuthToken}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'AppIdV3' => 'LCUID-LAP-********-****-****-****-************',
],
'json' => [
'inventory_item_lcuids' => [
'LCUID-LI-506fc585-77be-11ec-acb9-c2cdb617d190',
'LCUID-LI-906fc585-12be-11ec-acb9-c2cdb617d190',
],
'inventory_item_unique_ids' => [
'123456',
'222346',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Python (Requests)¶
import requests
import json
url = 'https://api.lucit.app/api/v3/campaigns/LCUID-LE-506fc585-77be-11ec-acb9-c2cdb617d190/inventory-items'
payload = {
"inventory_item_lcuids": [
"LCUID-LI-506fc585-77be-11ec-acb9-c2cdb617d190",
"LCUID-LI-906fc585-12be-11ec-acb9-c2cdb617d190"
],
"inventory_item_unique_ids": [
"123456",
"222346"
]
}
headers = {
'Authorization': 'Bearer {AuthToken}',
'Content-Type': 'application/json',
'Accept': 'application/json',
'AppIdV3': 'LCUID-LAP-********-****-****-****-************'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()