Documentation

API Reference :: contactgroups

GET

Get contact group information

  • customerid - optional string - customerid of the subaccount you want to get a contact group list for.
  • id - optional string - Contact group id of the contact group you want to get. If absent, the call will return a list of contact groups. Getting a specific contact group belonging to a subaccount requires customerid to be set.

Request example:

curl -X GET 'https://api.nodeping.com/api/1/contactgroups'

Response example:

{
  "201205050153W2Q4C-G-3QJWG": {
    "type": "group",
    "customer_id": "201205050153W2Q4C",
    "name": "Example Group",
    "members": [
      "SLS78SDG",
      "9ZODE0VF"
    ]
  } ...
}

POST and PUT

Create (POST) or update (PUT) a contact group

  • customerid - optional string - customerid of the subaccount to which the contact group list belongs.
  • id - required string on update - the contact group id you want to modify
  • name - optional string used as a label for the group.
  • members - optional JSON string - An array of address ids like: ["1664V","K5SP9CQP"] (those are two different addresses/contact methods)
curl -X POST -d'json={"members":["9GJ7EHJX","GFRWVKD9"],"name":"An Example Group"}' 'https://api.nodeping.com/api/1/contactgroups'

Response example:

{
    "_id": "201205050153W2Q4C-G-1ZIYU",
    "type": "group",
    "customer_id": "201205050153W2Q4C",
    "name": "An Example Group",
    "members": [
        "9GJ7EHJX",
        "GFRWVKD9"
    ]
}

DELETE

Delete a contact group

  • customerid - optional string - customerid of the subaccount to which the contact group list belongs. Not needed if the contact group belongs to your primary account.
  • id - required string - Contact group id of the contact group you want to delete.

Request example:

curl -X DELETE 'https://api.nodeping.com/api/1/contactgroups/201205050153W2Q4C-G-1ZIYU'

Response example:

{"ok":true,"id":"201205050153W2Q4C-G-1ZIYU"}

If you have any questions, get in touch at support@nodeping.com, or use our Contact form.