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.
Name | Type | Description |
---|---|---|
id | string | The unique ID (UUID) of the event updated and published |
eventTime | String | Time 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.** |
type | String | The 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.ticketId | String | ticket ID. |
ticket.accountId | String | account ID or tenantID |
ticket.lastUpdated | String | Date and time the ticket was last modified either through status change or comment additions. |
ticket.resources | List | Devices associated with the ticket. These are provided in a format consistent with the Rackspace Resource API. |
ticket.subject | String | Subject originally provided at creation time. |
ticket.description | String | Description originally provided at creation time. |
ticket.category | String | Category of the ticket |
ticket.subcategory | String | Subcategory of the ticket |
ticket.classification | String | Classification of the ticket |
ticket.status | String | The new status of the ticket. Available statuses are Pending Rackspace , Pending Customer , Solved , Closed , Archived , Unavailable . Note: Not all events publish a status. |
ticket.created | String | Timestamp of ticket creation. |
ticket.severity | String | Severity of the ticket |
ticket.version | String | Version of the ticket json |
ticket.comment | String/Object | This 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.author | String | The creator of this comment, can either be a Racker or a user within your organization. |
comment.authorType | String | The type of user who created the request. Available types are Rackspace or Customer . |
comment.created | String | Timestamp of comment creation. |
comment.id | String | Unique ID of the comment. |
comment.text | String | The text of the comment. Note: At this time, the length of the comment is limited to 10240 characters. |
comment.attachments | List | URLs 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"]}
}
}
}