Bursts API

This article provides sample API calls to manipulate Bursts.

  • /api/burst: Retrieve, create, send, and delete Bursts.

Prerequisites:

Table of contents:

  1. Access Admin > System > API Toolkit
  2. Configure Bursts
    1. Retrieve Bursts
    2. Create New Burst
    3. Send Burst
    4. Delete Burst

1. Access Admin > System > API Toolkit

2. Configure Bursts

2.1. Retrieve Bursts

  • GET request to /api/burst retrieves all Bursts.
  • GET request to /api/burst/id/<ID> retrieves the specified Burst.
  1. Item: burst
  2. Method: GET
  3. Optionally, enter Burst ID to get only the specified Burst's info.
  4. Enter an API Token.
  5. [Run request]

Example Response

For GET /api/burst:

{
  "bursts": [
    {
      "id": 1,
      "name": "Daily Report Digest",
      "schedule_name": "Every Day at 7 am",
      "subject_template": "[Name] for [Today]",
      "notification_schedule_id": 2,
      "digest_template_id": 9,
      "url": "https://docs.metricinsights.com/notification/burst/1"
    },
    {
      "id": 6,
      "name": "Weekly Report Digest",
      "schedule_name": "Weekly",
      "subject_template": "[Name] for [Today]",
      "notification_schedule_id": 4,
      "digest_template_id": null,
      "url": "https://docs.metricinsights.com/notification/burst/6"
    }
  ]
}

For GET /api/burst/id/<ID>:

{
  "burst": {
    "id": 253,
    "name": "Rob Test Burst",
    "schedule_name": "On Fri at 12:00",
    "subject_template": "[Name] for [Today]",
    "notification_schedule_id": 3,
    "digest_template_id": 8,
    "url": "https://docs.metricinsights.com/notification/burst/253"
  }
}

Fields Description

Parameter NameValue TypeDescription
bursts
arrayArray with all Bursts data.
idintegerBurst ID.
namestringBurst name.
schedule_name
stringName of the Notification Schedule on which the Burst is sent.
subject_template
stringThe template of Email Subject Line.
notification_schedule_id
integerThe ID of the notification Schedule on which the Burst is sent.
digest_template_id
integerThe ID of the Burst’s Email Template.
url
stringBurst Editor URL.

2.2. Create New Burst

  • POST request to /api/burst with body {"name": "<name>", "subject_template": "<template>", "notification_schedule_id": <ID>, "digest_template_id": <ID>} creates a new Burst.
  1. Item: burst
  2. Method: POST
  3. Select JSON request and provide the parameters:
    • name: New Burst Name.
    • subject_template: Template of Email Subject Line.
    • notification_schedule_id: ID of the Notification Schedule.
    • digest_template_id: ID of the Email Template.
  4. Enter an API Token.
  5. [Run request]

2.3. Send Burst

  • PUT request to /api/burst/id/<ID> with body {"call": "send", "send_to": "all"} sends a specified burst Burst.
  1. Item: burst
  2. Method: PUT
  3. Enter the ID of the Burst that needs to be sent.
  4. Actions: Send
  5. Select JSON request and provide the parameters:
    • call: "send"
    • send_to:
      • "me": Send only to the User who executes the API call.
      • "all": Send to everyone on the recipient list.
  6. Enter an API Token.
  7. [Run request]

2.4. Delete Burst

  • DELETE request to /api/burst/id/<ID> deletes a specified Burst.
  1. Item: burst
  2. Method: DELETE
  3. Enter the ID of the Burst that needs to be deleted.
  4. Enter an API Token.
  5. [Run request]