You can get a list of all the relations of an entity by using the following endpoint.
{warning} Don't forget that all endpoints documented here need to be prefixed with
api/1.0/campaigns/{campaign.id}/
.
Method | URI | Headers |
---|---|---|
GET/HEAD | entities/{entity.id}/relations |
Default |
{
"data": [
{
"owner_id": 168,
"target_id": 72,
"relation": "Just Friends",
"attitude": 22,
"visibility_id": 1,
"is_star": false,
"colour": null,
"created_at": "2019-01-30T00:01:44.000000Z",
"created_by": 1,
"updated_at": "2019-08-29T13:48:54.000000Z"
}
]
}
To get the details of a single relation, use the following endpoint.
Method | URI | Headers |
---|---|---|
GET/HEAD | entities/{entity.id}/relations/{relation.id} |
Default |
{
"data": {
"owner_id": 168,
"target_id": 72,
"relation": "Just Friends",
"attitude": 22,
"visibility_id": 1,
"is_star": true,
"colour": "/en/api-docs/1.0/relations#22bbff",
"created_at": "2019-01-30T00:01:44.000000Z",
"created_by": 1,
"updated_at": "2019-08-29T13:48:54.000000Z"
}
}
To create a relation, use the following endpoint.
Method | URI | Headers |
---|---|---|
POST | entities/{entity.id}/relations |
Default |
Parameter | Type | Detail |
---|---|---|
relation |
string (Required, max 255) |
Description of the relation |
owner_id |
int (Required) |
The relation's entity |
target_id |
int (Required) |
The relation's target entity |
attitude |
int |
-100 to 100 |
colour |
string |
Hex colour of the attitude (with or without the # ) |
two_way |
boolean |
If set, will duplicate the relation but in the other direction |
is_star |
boolean |
If the relation is visible on the entity's submenu |
visibility_id |
int |
The visibility ID: 1 for all , 2 self , 3 admin , 4 self-admin or 5 members . |
{success} Code 200 with JSON body of the new relation.
To update a relation, use the following endpoint.
Method | URI | Headers |
---|---|---|
PUT/PATCH | entities/{entity.id}/relations/{relation.id} |
Default |
The same body parameters are available as for when creating a relation.
{success} Code 200 with JSON body of the updated relation.
To delete a relation, use the following endpoint.
Method | URI | Headers |
---|---|---|
DELETE | entities/{entity.id}/relations/{relation.id} |
Default |
{success} Code 200 with JSON.
You can get a list of all the relations of a campaign by using the following endpoint.
{warning} Don't forget that all endpoints documented here need to be prefixed with
api/1.0/campaigns/{campaign.id}/
.
Method | URI | Headers |
---|---|---|
GET/HEAD | relations |
Default |