API Masterclass:
Activity Guide
PagerDuty University
[Link]
Proprietary & Confidential
Developer Account
Proprietary & Confidential
Developer Account: Generate API Key
Proprietary & Confidential
Developer Account: Generate API Key
Proprietary & Confidential
Developer Account: Generate API Key
Proprietary & Confidential
Developer Account: Generate API Key
Proprietary & Confidential
The API Reference
[Link]
● The complete resource for
public REST API
● Details on all required and
optional fields for each
endpoint request schema
● Details on the contents of
each response
Proprietary & Confidential
API Docs : Users : Create User Deep Dive
Proprietary & Confidential
API Docs : Users : Create User Deep Dive
Proprietary & Confidential
API Docs : Users : Create User Deep Dive
Proprietary & Confidential
API Docs : Users : Create User Deep Dive
Hover over to see
available options
Proprietary & Confidential
Basic Workflow using the API Reference
● Click on “Try It”
● Set the required and
optional headers
● Click on Body
Proprietary & Confidential
Basic Workflow using the API Reference
● Create the desired
request body
● Use API Reference as a
guide to use required
and optional fields as
needed
Proprietary & Confidential
Code Generators!
Proprietary & Confidential
PagerDuty API: Extra Credit Activity
Proprietary & Confidential
Postman Setup for PagerDuty API
Visit Postman ([Link] and install.
Proprietary & Confidential
Postman Setup for PagerDuty API
Visit Postman ([Link] and install.
Proprietary & Confidential
Import PagerDuty API Postman Collection
Visit PagerDuty’s API Reference ([Link] and click on “Run in Postman”
Proprietary & Confidential
Setup PagerDuty Postman Collection
Proprietary & Confidential
Using Postman
In the PagerDuty Postman Collection, open the ‘Users’ endpoint folder. Double click on the ‘List Users’
request to open.
Proprietary & Confidential
Setup the Postman Request
Proprietary & Confidential
Setup the Postman Request
● Under the request’s ‘Headers’ section, add the following configurations to set the ‘Authorization’
header to use the desired API Tokens.
● Press ‘Save’. Multiple values can be entered and toggled on/off for specific use.
Proprietary & Confidential
Setup the Postman Request
● Under the request’s ‘Params’ section, add the ‘total’, ‘limit’ and ‘offset’ params.
● These will be required for API requests to endpoints that support pagination and 100’s-1000’s of
results may exist.
● Save the request.
Uncheck
these!
Proprietary & Confidential
Setup the Postman Request
● Under the request’s ‘Params’ section, add the ‘total’, ‘limit’ and ‘offset’ params.
● These will be required for API requests to endpoints that support pagination and 100’s-1000’s of
results may exist.
● Save the request.
Proprietary & Confidential
Run the Request
● Toggle on/off or set ‘params’ based on your API request requirements.
● Press ‘Send’ to execute the API query.
● In this example, the first 25 users are retrieved and displayed in the response body.
● Scrolling to the bottom of the response body shows ‘more’ is true indicating there are more users
available.
Proprietary & Confidential
Get Test Data
[Link]
Proprietary & Confidential
Get Test Data
[Link]
Proprietary & Confidential
GET Teams : Pagination Activity
Proprietary & Confidential
GET Teams : Pagination Activity
Proprietary & Confidential
GET Teams : Pagination Activity
Proprietary & Confidential
GET Teams : Pagination Activity
Proprietary & Confidential
GET Teams : Pagination Activity
Proprietary & Confidential
PagerDuty Events API: Activity
Proprietary & Confidential
PagerDuty Events API: Activity
Proprietary & Confidential
PagerDuty Events API: Activity
Add Folder
Name Folder
Proprietary & Confidential
PagerDuty Events API: Activity
Add Request Name Request
Proprietary & Confidential
PagerDuty Events API: Activity
Setup Request
Proprietary & Confidential
PagerDuty Events API: Activity
Build Request
Proprietary & Confidential
PagerDuty Events API: Activity
Response
Proprietary & Confidential
PagerDuty Events API: Activity
Proprietary & Confidential
PagerDuty Events API: Activity
dedup_key
identifies
incident to be
acknowledged
Proprietary & Confidential
PagerDuty Events API: Activity
HTTP Response Code
Proprietary & Confidential
API Errors Activity
Take one of the API call you made in POSTMAN today and purposefully mess it up by doing one (or
more) of the following.
● Remove your API Key from the Authorization header
● Change the endpoint to something incorrect like “/team” instead of “/teams”
● Mess up the body of the Event request we just made
Look at the response you receive and answer these questions:
● Which HTTP response code was given?
● Which error code?
● What was the error message?
● How would you handle this type of response in your code?
Proprietary & Confidential
terraform init
Proprietary & Confidential
terraform plan
Proprietary & Confidential
Proprietary & Confidential
terraform apply
Proprietary & Confidential
Proprietary & Confidential