We want to gain a Basic Understanding of the Difference between the Events API v1 (/generic/2010-04-15/create_event.json) and Events API v2 (/v2/enqueue). We tried looking through the documentation as well as the topics in the PagerDuty Community, but couldn’t find a clear and precise answer to our question.
Our client uses PagerDuty Integration (both v1 and v2) for different events. As v1 uses service_key and v2 uses routing_key, is there any way to transform the events from v1 to v2?
Important Note: Our client uses “event_action” as a “trigger” in both v1 and v2 (Shown in the sample payload at the end). This eliminates the difference in the parameters of v1 and v2.
Shall we request our client to stick to a single version of the Events API (v2) and stop using v1?
What would be the consequent behavioral changes/pros and cons of doing the same?
We noticed that executing both v1 and v2 using the common integration key (Services > Event Rules > Default Global Ruleset) triggers alerts in the common page (Incidents > Alerts).
Example Payload for V1:
{
"service_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"event_type": "trigger",
"description": "This is a sample description"
}
Example Payload for V2:
{
"routing_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"event_action": "trigger",
"payload": {
"source": "abc",
"severity": "pqr",
"summary": "This is a sample summary"
}
}
References:
https://developer.pagerduty.com/docs/events-api-v1/overview/
https://developer.pagerduty.com/docs/events-api-v1/trigger-events/
https://developer.pagerduty.com/docs/events-api-v2/overview/
https://developer.pagerduty.com/docs/events-api-v2/trigger-events/