Use Postman with Metronome
Postman is a great way to visually explore the Metronome API without writing code. Before you start, you need to:
- Create a free account with Postman
- Request a Metronome account
- Generate a Metronome API token
Use the OpenAPI spec
The Metronome OpenAPI spec can be imported directly into Postman. The spec is always up to date. To import the OpenAPI spec:
- In Postman, go to File > Import.
- Select Link from the top menu, and enter Metronome's OpenAPI spec link (https://api.metronome.com/v1/docs/openapi).
- On the next pane, select Show advanced settings and make sure the Folder organization is set as Tags.
Set up authorization for the Metronome collection
The Metronome API uses a Bearer Token. To set Auth up in the collection, click on your collection's top-level Metronome folder and select Bearer Token.
We recommend using a Postman variable for the token value. To do this, enter {{api_token}}
in the box below the Type dropdown. A window appears referencing an unresolved variable. In that box, click on Add new variable, add your Metronome API token as the value, and set the scope to Collection: Metronome.
Organize the Metronome collection
A Postman Collection groups requests together in a folder structure, allowing them to be easily organized. You can fork the collection if needed. Forking provides for version control and facilitates collaboration.
Try it out
To test the Metronome API using Postman, create a new customer using the Create customer request. To do so you must configure the Create customer request to use the Bearer Token variable {{api_token}}
.
- Navigate to Customers > POST Create customer.
- Select Authorization, then select Bearer Token from the Type dropdown. Since we scoped
{{api_token}}
for the entire collection, the Token value should automatically be set to{{api_token}}
. If not, just enter{{api_token}}
in the Token box. - Save your changes to the Create customer request.
Now that auth is set, create a new customer using the below JSON as the body of the request. Navigate to Customers > POST Create customer, select Body from the request options in the panel, then enter the following:
{
"name": "Example-Customer"
}
The API response is in the format
{
"data": {
"id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc",
"external_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc",
"name": "Example-Customer"
}
}
Now that the collection is set up, you can continue with the Metronome API.