Using Postman for trying API endpoint

Postman is a powerful HTTP client for testing the athena API's online, by displaying requests and responses in manageable formats.

Overview

API Developer Portal, provides you with an easy to use collection download options for working with Postman tool.

Collection Options Reference Image
Download API Collection of Bookmarked APIs
Download Bookmarked APIs
Download API collection grouped by APIs published in individual API reference pages.
Try in Postman


Refer to Postman Tutorials for additional reads: https://learning.postman.com/docs/getting-started/introduction/

 

Using Postman

Setup

  1. Create an app.
  2. Download and install Postman: https://www.getpostman.com.
  3. Click the Run in Postman button corresponding to the desired collection from the list above. This sets up the Postman UI and downloads the collection.
  4. Configure the Postman Authorization header.
  5. Configure an environment that defines variables used in endpoints. An environment template is provided for you in the collection and accessed via Manage Environments in Postman settings. Define these variables:
baseurl

Preview Environment 

https://api.preview.platform.athenahealth.com/v1/{practiceid}

Production Environment

 

https://api.platform.athenahealth.com/v1/{practiceid}
practiceid

athena provides a default access to practiceid 195900

Note: ContextId and PracticeId are used interchangeably at athena, both refer the same.

 

Make calls

Once you configure Postman authorization header, requests in the Postman collections here will access your information in Sandbox environment.

For each request, refresh the authorization header:

  1. Oauth 2.0: For OAuth 2.0 headers, select the desired token from the Available Tokens list and click Get New Access Token.

  2. Select the desired endpoint from the collection.

  3. Click Send to issue the API request. Response payload is returned in the Body tab.

    qbo/docs/develop/PostmanSend.jpg

 

Note

Use this tool only for testing and prototyping your API requests.

Configuring the Postman Authorization header

Information in this section provides configuration details for the OAuth authorization header, which is supplied with each request to the athena API. Based on the version of OAuth your app implements, configure either an OAuth 2.0 header . To help you determine the version of OAuth your app uses click here.

OAuth 2.0

Before submitting a request from the collection, Postman must generate an OAuth 2.0 access token based on OAuth 2.0 keys from your app’s dashboard on https://docs.athenahealth.com/api/applications

  1. Sign-on to your developer account on https://docs.athenahealth.com/api/applications and click Applications
  2. Find and open the app you want to use.
  3. Navigate to the Credentials tab on your app’s dashboard. You use the Preview Environment keys for this configuration.

Now, from the Authorization tab on the Postman UI, for Type select OAuth 2.0 and click Get New Access Token. You need the following information when configuring this dialog:

Postman Authorization Field Information from your developer account
Token Name A user defined name for this token. It appears in the Postman Existing Tokens list to use in Send requests.
Grant Type This must be set to client_credentials (for 2-legged applications).
 

Preview:

https://api.preview.platform.athenahealth.com/v1/{practiceid}

Production:

https://api.platform.athenahealth.com/v1/%7Bpracticeid%7D
Access Token URL

Preview:

https://api.preview.platform.athenahealth.com/oauth2/v1/token

Production:

 

https://api.platform.athenahealth.com/oauth2/v1/token
Client ID and Client Secret Obtain these values from the Keys tab on the app profile via My Apps on the developer site. Make sure you get them development keys section on this tab.
Scope Specify: 
athena/service/Athenanet.MDP.*

 

Using the collections in a production environment

To use the collections in a production environment you need the following:

  • Access to your production keys
  • Your production keys will not authorize a practice in preview environment.
  • Set { {baseURL} } to either preview or production environments baseURL as needed.
Was this information helpful? Yes | No Thank you for your feedback! What went wrong? Incomplete or incorrect information | Irrelevant Content | Others
Submit

On this Page