You can get a list of all the attributes of an entity by using the following endpoint.
{warning} Don't forget that all endpoints documented here need to be prefixed with
1.0/campaigns/{campaign.id}/
.
Method | URI | Headers |
---|---|---|
GET/HEAD | entities/{entity.id}/attributes |
Default |
{
"data": [
{
"api_key": "",
"created_at": "2019-07-09T19:55:13.000000Z",
"created_by": null,
"default_order": 0,
"entity_id": 4,
"id": 151,
"is_private": false,
"is_pinned": false,
"name": "Force Strength",
"type_id": 1,
"updated_at": "2020-03-11T13:31:34.000000Z",
"updated_by": null,
"value": "5",
"parsed": "5"
}
]
}
To get the details of a single attribute, use the following endpoint.
Method | URI | Headers |
---|---|---|
GET/HEAD | entities/{entity.id}/attributes/{attribute.id} |
Default |
{
"data": {
"api_key": "",
"created_at": "2019-07-09T19:55:13.000000Z",
"created_by": null,
"default_order": 0,
"entity_id": 4,
"id": 151,
"is_private": false,
"is_pinned": false,
"name": "Force Strength",
"type_id": 1,
"updated_at": "2020-03-11T13:31:34.000000Z",
"updated_by": null,
"value": "5",
"parsed": "5"
}
}
To create an attribute, use the following endpoint.
Method | URI | Headers |
---|---|---|
POST | entities/{entity.id}/attributes |
Default |
Parameter | Type | Detail |
---|---|---|
name |
string (Required) |
Name of the attribute |
value |
string |
The attribute's value |
default_order |
integer |
The attribute's order |
type_id |
int |
The attribute's type ID: 1 for standard, 2 for a multiline text block, 3 for a checkbox, 4 for a section, 5 for a random number, 6 for a number, 7 for a list choice. |
is_private |
boolean |
If the attribute is only visible to admin members of the campaign |
is_pinned |
boolean |
If the attribute is "pinned" on the entity view |
api_key |
string (max 20) |
A custom field only shown in the API for you to link attributes to your system ids. |
{success} Code 200 with JSON body of the new attribute.
To update an attribute, use the following endpoint.
Method | URI | Headers |
---|---|---|
PUT/PATCH | entities/{entity.id}/attributes/{attribute.id} |
Default |
The same body parameters are available as for when creating an attribute. The name
field is required.
{success} Code 200 with JSON body of the updated attribute.
To delete an attribute, use the following endpoint.
Method | URI | Headers |
---|---|---|
DELETE | entities/{entity.id}/attributes/{attribute.id} |
Default |
{success} Code 200 with JSON.