WebHooks Integration

For publishing the events to your system, the Rackspace Team requires the following:

  • Callback URL - URL where events are published
  • API Key - Secret key between Rackspace and you for verifying authentication headers using HMAC algorithm

Securing Webhooks

When publishing the events to the callback URL, the following headers are sent:

  • timestamp - number of seconds passed since January 1, 1970
  • token - randomly generated string
  • signature - hexadecimal string generated by HMAC algorithm

To verify the event is coming from Rackspace, you should concatenate timestamp and token values, encode the resulting string with the HMAC algorithm (using the API Key as a key and SHA256 digest mode), and compare the resulting hexdigest to the signature.

Below is a Python code sample used to verify the signature.

import  hashlib, hmac

def verify(api_key, token, timestamp, signature):
  return signature == hmac.new(
      key=api_key.encode('ascii'),
      msg='{}{}'.format(timestamp, token).encode('ascii'),
      digestmod=hashlib.sha256).hexdigest()

Event Parameters

These are the most relevant response parameters of an event.

NameTypeDescription
idstringThe unique ID (UUID) of the event updated and published
eventTimeStringTime the event was published to the webhook. Note: this is not the time of last update as publishing delays could result in a timestamp later than when the actual event occurred.**
typeStringThe type of event. Available event types are CREATE, if a new ticket was created, and UPDATE if an existing record was updated. This typically occurs during ticket status changes or comments being added to the ticket.
ticket.ticketIdStringticket ID.
ticket.accountIdStringaccount ID or tenantID
ticket.lastUpdatedStringDate and time the ticket was last modified either through status change or comment additions.
ticket.resourcesListDevices associated with the ticket. These are provided in a format consistent with the Rackspace Resource API.
ticket.subjectStringSubject originally provided at creation time.
ticket.descriptionStringDescription originally provided at creation time.
ticket.categoryStringCategory of the ticket
ticket.subcategoryStringSubcategory of the ticket
ticket.classificationStringClassification of the ticket
ticket.statusStringThe new status of the ticket. Available statuses are Pending Rackspace, Pending Customer, Solved, Closed, Archived, Unavailable. Note: Not all events publish a status.
ticket.createdStringTimestamp of ticket creation.
ticket.severityStringSeverity of the ticket
ticket.versionStringVersion of the ticket json
ticket.commentString/ObjectThis is either a blank string (“”) if no comment occurred within the event or an object if the event was triggered by a new comment.
comment.authorStringThe creator of this comment, can either be a Racker or a user within your organization.
comment.authorTypeStringThe type of user who created the request. Available types are Rackspace or Customer.
comment.createdStringTimestamp of comment creation.
comment.idStringUnique ID of the comment.
comment.textStringThe text of the comment. Note: At this time, the length of the comment is limited to 10240 characters.
comment.attachmentsListURLs of the attachments associated with the comment. These are provided in a format consistent with our ConsolidatedTicketing API.

Event example

{
  "event": {
      "eventTime": "2018-07-27T03:47:06.446363Z",
      "id": "bb3a9766-914f-11e8-961c-0050561a0171",
      "type": "UPDATE",
      "ticket": {
        "accountId": "hyrbid:123456789",
        "category": "DNS/IP",
        "subcategory": "Assign additional IP",
        "lastUpdated": "2018-07-27T03:47:06.297537Z",
        "resources": [],
        "subject": "Request for Information",
        "ticketId": "180717-0000000",
        "severity": "NORMAL",
        "version": "1",
        "comment": {
          "author": "Racker",
          "authorType": "Rackspace",
          "created": "2018-07-27T03:47:06.297537Z",
          "id": "180727-iad-0000000",
          "text": "We are researching a solution now."
        }
  }
}
{
  "event": {
      "eventTime": "2018-07-27T03:47:06.446363Z",
      "id": "bb3a9766-914f-11e8-961c-0050561a0171",
      "type": "UPDATE",
      "ticket": {
        "accountId": "hyrbid:123456789",
        "category": "DNS/IP",
        "subcategory": "Assign additional IP",
        "lastUpdated": "2018-07-27T03:47:06.297537Z",
        "resources": [],
        "subject": "Request for Information",
        "ticketId": "180717-0000000",
        "severity": "NORMAL",
        "version": "1",
        "comment": {
          "author": "Racker",
          "authorType": "Rackspace",
          "created": "2018-07-27T03:47:06.297537Z",
          "id": "180727-iad-0000000",
          "text": "Testing attachments..",
          "attachments": ["https://ticketing.api.rackspace.com/tickets/180717-0000000/auth/attachments/969005?filename=test.png"]}
        }
  }
}