Using Web Services to Post to StatusPage

This how-to article will help administrators to use a Workflow Web Service in TDAdmin to create a post to a StatusPage account. The user must have the Admin or App Admin permissions to create this.

Overview

This article serves as an example of adding a ticket workflow step that will post information to StatusPage. This could be used to do something like sending out details on a Problem or Major Incident that arises within an IT Department and wants to inform their audience of details pulled from the ticket.

Learn more about setting up and using web service steps.

Step 1: Get an API Key (Token) from Statuspage

  1. Log in to your account at https://manage.statuspage.io/login.
  2. In the top right, click your avatar to access the user menu.
  3. Click API Info.
  4. Click Create Key.
  5. Name the key and click to save it.

For more information go to the Statuspage Developer Portal.

Make sure you save your API key to a secure location.

Step 2: Get your StatusPage Page ID

  1. Log in to your account at https://manage.statuspage.io/login.
  2. In the top left corner, use the dropdown to select the page you want to post incidents to, then click Incidents on the left.
  3. Copy the Page ID from the URL bar. The Page ID is the alphanumeric string after /pages
    1. E.g., if the URL is https://manage.statuspage.io/pages/abcd1efghjk1/incidents, the Page ID is abcd1efghjk1

Step 3: Create a Web Services Provider

To create a Web Service Provider: 

  1. Navigate to your Ticketing application in TDAdmin via Applications > [Ticketing App] > Workflow Web Services
  2. Select Web Service Providers
  3. Click +New
  4. Enter a Name
  5. For Base Web Services Provider URL, enter https://api.statuspage.io
  6. Check the Active box
  7. Click Save

Step 4: Construct the Payload

When creating or updating a StatusPage incident via web service steps, you will need to send a payload in JSON format. The format of the payload is very important. Every curly bracket, quote, and comma has to be correct or the payload won't be valid.

Here are a few example payloads:

Let's break down the payload examples:

  • The name is whatever title you want this incident to have in StatusPage.
    • The name is required when creating an incident, but you can omit it when updating
  • The body is the longer text with full details about the incident.
  • The status is the status of the incident in StatusPage.

Including Ticket Data in the Payload

You can insert information from the TeamDynamix ticket into the name or body of the incident using {{parameters}}. In our examples, we use a parameter called {{systemName}} to insert the name of the affected system into the both the name and body. Parameters can be named whatever you want and don't need to match ticket field names.
To create a parameter, wrap a parameter name (letters, numbers, and underscores only) within two sets of curly brackets. Two example parameters are {{this}} or {{this_2nd_example_parameter}}

Additional Supported Payload Fields

There are more fields other than the name, body, and status that you can add to the payload when creating or updating an incident in StatusPage. For a full list of other fields you can send, see StatusPage's API documentation:

Step 5: Create a Web Service Method

Once you have constructed the body, you can create a Web Service Method.

This guide covers two scenarios:

  1. Posting a new incident to StatusPage
  2. Updating an existing StatusPage incident