Assign person to group
Use case
Here we will review how to assign a person to the customer group. Let us assign a private person, Trevor Tuum, to a business customer group.
Use case data
API parameters with values
A private person with personId: ID-3392
...persons/ID-3392/person-groups
A customer group for business customers
Sample API cal
To assign a person to the customer group, make the following API call.
Sample request
Below is the example body request of the API call for assigning a person to the group.
{
"personGroupCode": "BUSINESS"
}
curl -L 'https://person-api.sandbox.tuumplatform.com/api/v2/persons/ID-3392/person-groups' \
-H 'x-channel-code: system' \
-H 'x-auth-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHBpcnlEVGltZSI6IjIwMjMtMDYtMjFUMjE6Mjk6NDgiLCJyb2xlcyI6WyJBRE1JTiJdLCJuYW1lIjoiSm9obiBPZmZpY2VyIiwiZW1wbG95ZWVJZCI6IjEiLCJ0ZW5hbnRDb2RlIjoiTUIiLCJleHAiOjE2ODczODI5ODh9.pPztGj-fAiRrRmZAOKYDuJSGrvZuUis59WKDAfcuE7A' \
-H 'Content-Type: application/json' \
-d '{
"personGroupCode": "BUSINESS"
}'
Sample response
Here you find an example response body to the API call above.
Response
{
"errors": null,
"validationErrors": null,
"data": {
"personGroupId": "ID-1489",
"personId": "ID-3392",
"personGroupCode": "BUSINESS",
"validityRange": {
"endTime": null,
"startTime": "2023-06-21T20:48:57.250757Z"
}
}
}
Result
The user ID-3392
is assigned to the BUSINESS customer group.