Add an Emergency Contact

Add an emergency contact for a tenant.

Request URL

POST {base_url}/uc-cconfig/api/v1/emergency-contacts

Request parameters

Headers
Parameter Required Type Description
Authorization Yes String The access token used for authentication.

Format: Bearer {access_token}.

x-tenant-code Yes String The tenant name.
Note: You can obtain tenant name using the Query Tenants interface.
Body parameters
Parameter Required Type Description
contactType Yes String The type of emergency contact.
Valid value:
  • specific: Add an internal user as an emergency contact.
  • custom: Add an external user as an emergency contact.
contactName No String The name of the external contact.
Note: This parameter is required when contactType is set to custom.
userIds No Array<String> The IDs of the internal users who receive the notification.
Note:
sendEmail No Boolean Whether to send a notification by email.
Valid value:
  • true: Enabled
  • false: Disabled
Note: When enabled, make sure an email address is configured for the contact.
  • When contactType is set to specific, make sure the internal user's email address is configured.

    You can specify the email address using the PUT /uc-cconfig/api/v1/users/{id} interface with email parameter.

  • When contactType is set to custom, specify the email address using the email parameter.
email No String The email address that receives the notification.
callExtension No Boolean Whether to send a notification by calling the extension number.
Valid value:
  • true: Enabled
  • false: Disabled
Note: This parameter is available only when contactType is set to specific.

Response parameters

Parameter Type Description
requestId String The unique ID of the request, which can be used to quickly locate the request.
code String The HTTP status code of the request.
  • 200: Request succeeded.
  • Non-200 value: Request failed.
message String The status message of the request.
detailMessage String The detailed error information.

When the request is successful, this parameter returns empty.

result Object<Contact_Detail> The details of the emergency contact.
Contact_Detail
Parameter Type Description
id String The unique identifier of the emergency contact.
contactType String The type of the emergency contact.
  • specific: Internal user.
  • custom: External contact.
contactName String The name of the external contact.
Note: This parameter is returned with a value only when contactType is custom.
userIds Array<String> The IDs of the internal users.
Note: This parameter is returned with a value only when contactType is specific.
sendEmail Boolean Whether email notification is enabled.
  • true: Enabled
  • false: Disabled
email String The email address that receives the notification.
Note: This parameter is returned only when contactType is custom.
callExtension Boolean Whether phone call notification to an extension is enabled.
  • true: Enabled
  • false: Disabled
version Integer The version number of the contact, incremented with each update to prevent outdated data from overwriting new data.

Example

Request example

POST /uc-cconfig/api/v1/emergency-contacts HT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8hfh9Vzlgl8XM8Z1yale_jNdJZgYmyQQ
Content-Type: application/json
x-tenant-code: jint
{
  "contactType": "custom",
  "contactName": "Emergency IT",
  "sendEmail": true,
  "email": "it-alert@example.com"
  
  
  
}

Response example

HTTP/1.1 200 OK
{
  "requestId": "2e7024d2c84dfded10e32cc9541c3797",
  "code": "200",
  "message": "SUCCESS",
  "result": {
    "id": "353467466842984448",
    "contactType": "custom",
    "contactName": "Emergency IT",
    "userIds": [],
    "sendEmail": true,
    "email": "it-alert@example.com",
    "callExtension": false,
    "version": 1
    
    
    
  }
}