Sorry, you need to enable JavaScript to visit this website.

Create contact group

 

Service version: 1
Last edit: 2020.05.21

On this page

Purpose

This endpoint creates a new contact group.

Request data

HTTPS method: POST

URL format

For ease of viewing and identification:

  • Required constants and parameters are shown in bold text.
  • Optional parameters are shown in plain text.
https://baseURL/notifications/versionNumber/groups?key=Your_API_Key

curl command

curl -v -XPOST -H "Content-type: application/json" -d
'{
   "name": "group_name",
   "webhookUrls": [],
   "emails": []
 }'
'https://baseURL/notifications/versionNumber/groups?key=Your_API_Key

POST Request body (JSON)

{
  "name": "group_name",
  "webhookUrls": [],
  "emails": []
}

Request parameters

The following table describes the parameters that can be used in a Request.

  • Required parameters must be used or the call will fail.
  • Optional parameters may be used.
  • If there is a default value that will be assumed when an optional parameter is not used, it is shown in the table.
  • The order of Request parameters is not important.
Required parameters
Parameter Description
baseURL
string
The base URL for calling the API.
Value: api.tomtom.com
versionNumber
string
Service version number.
Value: 1
key
string
An API Key valid for the requested service.
Value: Your valid API Key.
Optional parameters
This endpoint does not have any optional parameters.

Request fields

The following table describes all of the fields that can appear in a Request.

Primary fields
Field Description
id
string
The UUID of the contact group.
name
string
(Optional) The name of the contact group.
String with a length of up to 255 characters.
webhookUrls
array(string)
The list of URLs to receive the message.
Max: Maximum amount of URLs is 20.
emails
array(string)
The list of email addresses to receive the message.
Max: Maximum amount of email addresse is 20.

▲ Return to top

Response data

Response body

{
  "id": "group_id",
  "name": "group_name",
  "webhookUrls": [],
  "emails": []
}

Response fields

The following table describes all of the fields that can appear in a Response.

Primary fields
Field Description
id
string
The UUID of the contact group.
name
string
(Optional) The name of the contact group.
webhookUrls
array(string)
The list of URLs to receive a message.
emails
array(string)
The list of email addresses to receive a message.

HTTP Response codes

Code Meaning and possible causes
201 Created
400 Bad request:
  • Group name is too long.
  • Emails amount has been exceeded.
  • WebhookUrls amount has been exceeded.
  • All ways of sending notifications are empty.

▲ Return to top

Examples

Request URL

https://api.tomtom.com/notifications/1/groups?key=Your_API_Key

POST Request body

{
  "name": "Alert webhooks",
  "webhookUrls": [
    "http://my.page.co/jenkins/0fd2efd6-349c-4990-a340-f0e789bf5a0c",
    "http://my.page.com/graphana/82402a7a-9f14-4390-9721-c49e3ecb4bcb",
    "http://my.page.com/alertforwarder/8bfbcf59-7b51-49be-8d87-acea4adfb464"
  ],
  "emails": [
    "john.smith@example.com"
  ]
}

Response body (JSON)

{
  "id": "cfde72d8-4b9f-4f6d-83c8-87ae0465fd5d",
  "name": "Alert webhooks",
  "webhookUrls": [
    "http://my.page.co/jenkins/0fd2efd6-349c-4990-a340-f0e789bf5a0c",
    "http://my.page.com/graphana/82402a7a-9f14-4390-9721-c49e3ecb4bcb",
    "http://my.page.com/alertforwarder/8bfbcf59-7b51-49be-8d87-acea4adfb464"
  ],
  "emails": [
    "john.smith@example.com"
  ]
}

▲ Return to top