Update an invitation
To update an invitation, enter the invitation_id of the invitation returned in the create invitation flow. If you do not know the invitation_id, you can search for an invitation using search_tag or invite_email_address.
Request
POST {base URL}/invitation/{invitation_id}
-
HEADER:
-
Include TID OAuth Bearer token for your application
-
Add a
Content-Typeofapplication/JSON.
-
-
PARAMETERS:
-
send_email: Query parameter accepts boolean values to raise or suppress email notification. This value is optional, and the default value is false. -
custom_templates: Customized templates for sending invitations. This value is optional.The provided template needs to include a variable
invitation_urlwhich will be overridden with theinvite_link.
-
-
BODY: (See example below)
Example request body
{
"webhook_secret_token": "4316299750", "metadata_json": { "optional_object" }, "search_tag": "example", "entitlement_activation_ids": ["TRN_activation_id"], "entitlement_roles": [ { "account_id": "account_id_string", "role": "role_to_assign", } ], "custom_templates": { "new_user": { "template_id": "template_id_1", "variables":
{ "variable_1": "value_1", "variable_2": "value_2" }
}, "existing_user": { "template_id": "template_id_2", "variables":
{ "variable_1": "value_1", "variable_2": "value_2" }
} }}If entitlement_activation_ids and entitlement_roles are passed as empty, the existing activation and roles, if any, will be removed. metadata_json is optional, and if given, it will replace the entire JSON object provided during the create invitation operation.
Error handling
If the update is successful, the status_code 200 is returned with an empty response body. If there is any error while updating the entitlement_activation_ids or entitlement_roles in Trimble Entitlement, the status_ code 207 is returned along with the error details and invitation_id in the response. Refer to the following example for details:
{ "invitation_id": "ad8c2590-1888-4ae6-b1ee-4ca26b6c470b", "orchestration_error": [ { "system": "EMS", "element": "TRN_activation_id", "message": "Error received from entitlements API. Invalid activation id.", "operation": "Assign Activation", "error_code": "400" }
]}The operation attribute value displayed under orchestration_error message can display either Assign Activation or Assign Role.