API :: Related records¶
Note
You can obtain the list of link names at Administration > Entity Manager > click relationships on a specific entity type > 4th column. Actual types: parent-to-children, one-to-many, many-to-many.
List related records¶
GET {entityType}/{id}/{link}
GET parameters:
maxSize
- (int) max sizeoffset
- (int) offsetwhere
- (array) filtersorderBy
- (string) attribute to sort byorder
- (string: 'asc' | 'desc') sort directionselect
- (string) list of attributes to be returned, separated by comma; if not specified, then all fields will be returned
You can find more info about search params here.
Example:
GET Account/5564764442a6d024c/opportunities
Returns:
{
"list": [... array of records...],
"total": {totalCountOfRecords}
}
See more info about search parameters.
Link¶
POST {entityType}/{id}/{link}
Relates two records.
Payload:
id
- ID of the record to relate withids
- array of IDs of the records to relate withmassRelate
- optional, false or true, whether to use search criteria that will be used instead of specific idswhere
- optional search criteria
Headers:
Content-Type: application/json
Example:
POST Account/5564764442a6d024c/opportunities
Payload:
{
"id": "55646fd85955c28c5"
}
Unlink¶
DELETE {entityType}/{id}/{link}
Unrelates two records.
Payload fields:
id
- ID of related record to removeids
- array of IDs of related records to remove
Headers:
Content-Type: application/json
Example:
DELETE Account/5564764442a6d024c/opportunities
Payload:
{
"id": "55646fd85955c28c5"
}