Actors
Create Actor
Actor creation follows the guidelines described in How to create/update Actor.
note
The customer must have one of the customer roles with the system name CustomerPerson
or CustomerOrganization
. The response will contain a list of product variants..
Get Actor
- Method:
POST
- URL:
{host_url}/api/actors/Actor/GetActor
Minimal Request:
{
"id": actor_id,
"propertiesToLoad": { "value": <write flags value> }
}
[propertiesToLoad] - Flag Enumeration:
Flag Name | Value |
---|---|
FieldSet | 1 |
WebAddresses | 2 |
Emails | 4 |
Addresses | 8 |
Fields | 16 |
Groups | 32 |
Phones | 64 |
Roles | 128 |
User | 256 |
Relations | 512 |
PaymentInfo | 1024 |
WorkingHours | 2048 |
ExternalDataRecord | 4096 |
To load FieldSet and Emails, use bitwise AND operation or sum their values: 1 + 4 = 5
.
note
propertiesToLoad
is optional. If omitted, all actor properties will be loaded.
Get Actors (Paged)
- Method:
POST
- URL:
{host_url}/api/actors/actor/GetActorsPage
Minimal Request:
{
"sortInfo": [],
"propertiesToLoad": <write flags value>,
"offset": 0,
"count": page_size,
"includeOverallEntryCount": true
}
propertiesToLoad
- flag enumeration with same options that also used in GetActor call (see previous chapter).
Optional Filters:
RoleSystemName
- Filter actors by a specific role.SearchPattern
- Filter actors where person/organization name, phone, email, or customer ID matches the search pattern.ModifiedAtFrom
- Filter actors modified after a specific timestamp.ModifiedAtTo
- Filter actors modified before a specific timestamp.
Examples
Get customers page:
{
"sortInfo": [],
"propertiesToLoad": <write flags value>,
"offset": 0,
"count": 50,
"includeOverallEntryCount": true,
"roleSystemName": {
"value": "Customer"
}
}
Get suppliers page:
{
"sortInfo": [],
"propertiesToLoad": <write flags value>,
"offset": 0,
"count": 50,
"includeOverallEntryCount": true,
"roleSystemName": {
"value": "Supplier"
}
}
Get actors by search pattern within date range:
{
"sortInfo": [],
"propertiesToLoad": <write flags value>,
"offset": 0,
"count": 50,
"includeOverallEntryCount": true,
"modifiedAtFrom": {
"value": "2020-01-01T18:25:43.511Z"
},
"modifiedAtTo": {
"value": "2021-01-01T18:25:43.511Z"
},
"searchPattern": {
"value": "aa"
}
}