BrazeEx.Api.CatalogsCatalogItemsAsynchronous (braze_ex v1.0.22)
API calls for all endpoints tagged CatalogsCatalogItemsAsynchronous
.
Link to this section Summary
Functions
Delete Multiple Catalog Items
Use this endpoint to delete multiple items in your catalog.
Edit Multiple Catalog Items
Use this endpoint to delete multiple items in your catalog.
Create Multiple Catalog Items
Use this endpoint to create multiple items in your catalog.
Update Multiple Catalog Items
Use this endpoint to update multiple items in your catalog.
Link to this section Functions
catalogs_catalog_name_items_delete(connection, catalog_name, opts \\ [])
@spec catalogs_catalog_name_items_delete(Tesla.Env.client(), String.t(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t()}
delete-multiple-catalog-items
Delete Multiple Catalog Items
Use this endpoint to delete multiple items in your catalog.
Each request can support up to 50 items. This endpoint is asynchronous.
prerequisites
Prerequisites
To use this endpoint, you’ll need an API key with the catalogs.delete_items
permission.
rate-limit
Rate limit
This endpoint has a shared rate limit of 16,000 requests per minute between all asynchronous catalog item endpoints, as documented in API rate limits.
path-parameters
Path parameters
Parameter | Required | Data Type | Description |
---|---|---|---|
catalog_name | Required | String | Name of the catalog. |
request-parameters
Request parameters
Parameter | Required | Data Type | Description |
---|---|---|---|
items | Required | Array | An array that contains item objects. The item objects should contain an id referencing the items Braze should delete. Up to 50 item objects are allowed per request. |
example-request
Example request
curl --location --request DELETE 'https://rest.iad-03.braze.com/catalogs/restaurants/items' --header 'Content-Type: application/json' --header 'Authorization: Bearer YOUR-REST-API-KEY' --data-raw '{
"items": [
{"id": "restaurant1"},
{"id": "restaurant2"},
{"id": "restaurant3"}
]
}'
response
Response
There are three status code responses for this endpoint: 202
, 400
, and 404
.
example-success-response
Example success response
The status code 202
could return the following response body.
{
"message": "success"
}
example-error-response
Example error response
The status code 400
could return the following response body. Refer to Troubleshooting for more information about errors you may encounter.
{
"errors": [
{
"id": "items-missing-ids",
"message": "There are 1 item(s) that do not have ids",
"parameters": [],
"parameter_values": []
}
],
"message": "Invalid Request",
}
troubleshooting
Troubleshooting
The following table lists possible returned errors and their associated troubleshooting steps.
Error | Troubleshooting |
---|---|
catalog-not-found | Check that the catalog name is valid. |
ids-too-large | Item IDs can't be more than 250 characters. |
ids-not-unique | Check that the item IDs are unique in the request. |
ids-not-strings | Item IDs must be of type string. |
items-missing-ids | There are items that do not have item IDs. Check that each item has an item ID. |
invalid-ids | Item IDs can only include letters, numbers, hyphens, and underscores. |
request-includes-too-many-items | Your request has too many items. The item limit per request is 50. |
parameters
Parameters
connection
(BrazeEx.Connection): Connection to servercatalog_name
(String.t):opts
(keyword): Optional parameters:"Content-Type"
(String.t)::Authorization
(String.t):
returns
Returns
{:ok, nil}
on success{:error, Tesla.Env.t}
on failure
catalogs_catalog_name_items_patch(connection, catalog_name, opts \\ [])
@spec catalogs_catalog_name_items_patch(Tesla.Env.client(), String.t(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t()}
edit-multiple-catalog-items
Edit Multiple Catalog Items
Use this endpoint to delete multiple items in your catalog.
Each request can support up to 50 items. This endpoint is asynchronous.
prerequisites
Prerequisites
To use this endpoint, you’ll need an API key with the catalogs.delete_items
permission.
rate-limit
Rate limit
This endpoint has a shared rate limit of 16,000 requests per minute between all asynchronous catalog item endpoints, as documented in API rate limits.
path-parameters
Path parameters
Parameter | Required | Data Type | Description |
---|---|---|---|
catalog_name | Required | String | Name of the catalog. |
request-parameters
Request parameters
Parameter | Required | Data Type | Description |
---|---|---|---|
items | Required | Array | An array that contains item objects. The item objects should contain an id referencing the items Braze should delete. Up to 50 item objects are allowed per request. |
example-request
Example request
curl --location --request DELETE 'https://rest.iad-03.braze.com/catalogs/restaurants/items' --header 'Content-Type: application/json' --header 'Authorization: Bearer YOUR-REST-API-KEY' --data-raw '{
"items": [
{"id": "restaurant1"},
{"id": "restaurant2"},
{"id": "restaurant3"}
]
}'
response
Response
There are three status code responses for this endpoint: 202
, 400
, and 404
.
example-success-response
Example success response
The status code 202
could return the following response body.
{
"message": "success"
}
example-error-response
Example error response
The status code 400
could return the following response body. Refer to Troubleshooting for more information about errors you may encounter.
{
"errors": [
{
"id": "items-missing-ids",
"message": "There are 1 item(s) that do not have ids",
"parameters": [],
"parameter_values": []
}
],
"message": "Invalid Request",
}
troubleshooting
Troubleshooting
The following table lists possible returned errors and their associated troubleshooting steps.
Error | Troubleshooting |
---|---|
catalog-not-found | Check that the catalog name is valid. |
ids-too-large | Item IDs can't be more than 250 characters. |
ids-not-strings | Item IDs must be of type string. |
ids-not-unique | Item IDs must be unique in the request. |
invalid-ids | Item IDs can only include letters, numbers, hyphens, and underscores. |
invalid-fields | Confirm that all fields you are sending in the API request already exist in the catalog. This is not related to the ID field mentioned in the error. |
invalid-keys-in-value-object | Item object keys can't include . or $ . |
items-missing-ids | There are items that do not have item IDs. Check that each item has an item ID. |
item-array-invalid | items must be an array of objects. |
items-too-large | Item values can't exceed 5,000 characters. |
request-includes-too-many-items | Your request has too many items. The item limit per request is 50. |
too-deep-nesting-in-value-object | Item objects can't have more than 50 levels of nesting. |
unable-to-coerce-value | Item types can't be converted. |
parameters
Parameters
connection
(BrazeEx.Connection): Connection to servercatalog_name
(String.t):opts
(keyword): Optional parameters:"Content-Type"
(String.t)::Authorization
(String.t)::body
(String.t):
returns
Returns
{:ok, nil}
on success{:error, Tesla.Env.t}
on failure
catalogs_catalog_name_items_post(connection, catalog_name, opts \\ [])
@spec catalogs_catalog_name_items_post(Tesla.Env.client(), String.t(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t()}
create-multiple-catalog-items
Create Multiple Catalog Items
Use this endpoint to create multiple items in your catalog.
Each request can support up to 50 items. This endpoint is asynchronous.
prerequisites
Prerequisites
To use this endpoint, you’ll need an API key with the catalogs.add_items
permission.
rate-limit
Rate limit
This endpoint has a shared rate limit of 16,000 requests per minute between all asynchronous catalog item endpoints, as documented in API rate limits.
path-parameters
Path parameters
Parameter | Required | Data Type | Description |
---|---|---|---|
catalog_name | Required | String | Name of the catalog. |
request-parameters
Request parameters
Parameter | Required | Data Type | Description |
---|---|---|---|
items | Required | Array | An array that contains item objects. The item objects should contain all of the fields in the catalog. Up to 50 item objects are allowed per request. |
example-request
Example request
curl --location --request POST 'https://rest.iad-03.braze.com/catalogs/restaurants/items' --header 'Content-Type: application/json' --header 'Authorization: Bearer YOUR-REST-API-KEY' --data-raw '{
"items": [
{
"id": "restaurant1",
"Name": "Restaurant1",
"City": "New York",
"Cuisine": "American",
"Rating": 5,
"Loyalty_Program": true,
"Created_At": "2022-11-01T09:03:19.967+00:00"
},
{
"id": "restaurant2",
"Name": "Restaurant2",
"City": "New York",
"Cuisine": "American",
"Rating": 10,
"Loyalty_Program": true,
"Created_At": "2022-11-02T09:03:19.967+00:00"
},
{
"id": "restaurant3",
"Name": "Restaurant3",
"City": "New York",
"Cuisine": "American",
"Rating": 3,
"Loyalty_Program": false,
"Created_At": "2022-11-03T09:03:19.967+00:00"
}
]
}'
response
Response
There are three status code responses for this endpoint: 202
, 400
, and 404
.
example-success-response
Example success response
The status code 202
could return the following response body.
{
"message": "success"
}
example-error-response
Example error response
The status code 400
could return the following response body. Refer to Troubleshooting for more information about errors you may encounter.
{
"errors": [
{
"id": "fields-do-not-match",
"message": "Fields do not match with fields on the catalog",
"parameters": [
"id"
],
"parameter_values": [
"restaurant2"
]
}
],
"message": "Invalid Request"
}
troubleshooting
Troubleshooting
The following table lists possible returned errors and their associated troubleshooting steps.
Error | Troubleshooting |
---|---|
catalog-not-found | Check that the catalog name is valid. |
ids-not-strings | Item IDs must be of type string. |
ids-not-unique | Item IDs must be unique in the request. |
ids-too-large | Item IDs can't be more than 250 characters. |
invalid-ids | Item IDs can only include letters, numbers, hyphens, and underscores. |
invalid-fields | Confirm that the fields in the request exist in the catalog. |
invalid-keys-in-value-object | Item object keys can't include . or $ . |
item-array-invalid | items must be an array of objects. |
items-missing-ids | There are items that do not have item IDs. Check that each item has an item ID. |
items-too-large | Item values can't exceed 5,000 characters. |
request-includes-too-many-items | Your request has too many items. The item limit per request is 50. |
too-deep-nesting-in-value-object | Item objects can't have more than 50 levels of nesting. |
unable-to-coerce-value | Item types can't be converted. |
parameters
Parameters
connection
(BrazeEx.Connection): Connection to servercatalog_name
(String.t):opts
(keyword): Optional parameters:"Content-Type"
(String.t)::Authorization
(String.t)::body
(String.t):
returns
Returns
{:ok, nil}
on success{:error, Tesla.Env.t}
on failure
catalogs_catalog_name_items_put(connection, catalog_name, opts \\ [])
@spec catalogs_catalog_name_items_put(Tesla.Env.client(), String.t(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t()}
update-multiple-catalog-items
Update Multiple Catalog Items
Use this endpoint to update multiple items in your catalog.
If a catalog item doesn’t exist, this endpoint will create the item in your catalog. Each request can support up to 50 catalog items. This endpoint is asynchronous.
prerequisites
Prerequisites
To use this endpoint, you'll need an API key with the catalogs.replace_item
permission.
rate-limit
Rate limit
This endpoint has a shared rate limit of 16,000 requests per minute between all asynchronous catalog item endpoints, as documented in API rate limits.
request-parameters
Request parameters
Parameter | Required | Data Type | Description |
---|---|---|---|
catalog_name | Required | String | Name of the catalog. |
item_id | Required | String | The ID of the catalog item. |
request-parameters-1
Request parameters
Parameter | Required | Data Type | Description |
---|---|---|---|
items | Required | Array | An array that contains item objects. The item objects should contain fields that exist in the catalog except for the id field. Only one item object is allowed per request. |
example-request
Example request
curl --location --request PUT 'https://rest.iad-03.braze.com/catalogs/restaurants/items' --header 'Content-Type: application/json' --header 'Authorization: Bearer YOUR-REST-API-KEY' --data-raw '{
"items": [
{
"id": "restaurant1",
"Name": "Restaurant",
"Loyalty_Program": false,
"Location": {
"Latitude": 33.6112,
"Longitude": -117.8711
},
"Open_Time": "2021-09-03T09:03:19.967+00:00"
},
{
"id": "restaurant3",
"City": "San Francisco",
"Rating": 2
}
]
}'
response
Response
There are three status code responses for this endpoint: 200
, 400
, and 404
.
example-success-response
Example success response
The status code 200
could return the following response body.
{
"message": "success"
}
example-error-response
Example error response
The status code 400
could return the following response body. Refer to Troubleshooting for more information about errors you may encounter.
{
"errors": [
{
"id": "invalid-fields",
"message": "Some of the fields given do not exist in the catalog",
"parameters": [
"id"
],
"parameter_values": [
"restaurant1"
]
}
],
"message": "Invalid Request"
}
troubleshooting
Troubleshooting
The following table lists possible returned errors and their associated troubleshooting steps.
Error | Troubleshooting |
---|---|
catalog_not_found | Check that the catalog name is valid. |
ids_not_string | Confirm that each item ID is a string. |
ids_not_unique | Check that each item ID is unique. |
ids_too_large | Character limit for each item ID is 250 characters. |
item_array_invalid | items must be an array of objects. |
items_missing_ids | Confirm that each item has an ID. |
items_too_large | Item values can't exceed 5,000 characters. |
invalid_ids | Supported characters for item ID names are letters, numbers, hyphens, and underscores. |
invalid_fields | Confirm that the fields in the request exist in the catalog. |
invalid_keys_in_value_object | Item object keys can't include . or $ . |
too_deep_nesting_in_value_object | Item objects can't have more than 50 levels of nesting. |
request_includes_too_many_items | Your request has too many items. The item limit per request is 50. |
unable_to_coerce_value | Item types can't be converted. |
parameters
Parameters
connection
(BrazeEx.Connection): Connection to servercatalog_name
(String.t):opts
(keyword): Optional parameters:"Content-Type"
(String.t)::Authorization
(String.t)::body
(String.t):
returns
Returns
{:ok, nil}
on success{:error, Tesla.Env.t}
on failure