If you are using Postman to test the Provider Directory API, use the following steps:
- Launch Postman and open a new tab.
- Select the POST method and enter the following Auth URL:
https://api.geisinger.org/oauth/v1/token?grant_type=client_credentials
- Click Authorization and select type OAuth 2.0.
- Enter the following parameters in the Authorization section:
- Token Name: This is your application name
- Grant Type: Client Credentials
- Access Token URL: https://api.geisinger.org/oauth/v1/token
- Client ID: This is the Client ID for your registered application. You can obtain the Client ID for your application from the My Applications page
- Client Secret: This is the Client Secret that was assigned to your application. You can obtain the Client Secret for your application from the My Applications page.
- Scope: Scope provides the beneficiary granular choice over what data they would like to share with the application. For e.g. scope=openid profile/*
- Client Authentication: Send as Basic auth header
- Click Get New Access Token.
- On the Postman screen, click Use Token to append access token to your request.
- Click Send.
- You should be able to view the API response with 200 OK status. Here’s a sample response for a GET request:
{
"token_type": "Bearer",
"access_token": "AwJmxSthAxdSb7JQOihlC1cA4A6n",
"issued_at": "1614186295512",
"expires_in": "3599"
}
- Copy the access_token received in the response to test the API products.
- Create a new GET request to test your Provider Directory products and paste the following request URL:
https://api.geisinger.org/ghp/fhir4/providerdirectory/v1/<resource_name>
- Replace the resource_name with the Provider Directory resource name.
- Enter the Bearer Token (access_token) you copied in step 9.
- Additionally, you can set the parameters in the Params section before calling any of the Provider Directory endpoints and click Send.
You should be able to view the API response. A sample response is described as follows:
{
"resourceType": "Bundle",
"id": "82e00a3c-29ad-4c88-ad78-1772d03fbdd0",
"meta": {
"lastUpdated": "2021-03-25T06:20:40.117+00:00"
},
"type": "searchset",
"total": 1,
"link": [
{
"relation": "self",
"url": "https://api.geisinger.org/ghp/fhir4/providerdirectory/v1/HealthcareService?identifier=HCS03"
}
],
"entry": [
{
"fullUrl": "https://api.geisinger.org/ghp/fhir4/providerdirectory/v1/HealthcareService/HCS03",
"resource": {
"resourceType": "HealthcareService",
"id": "HCS03",
. . . . .
This is only a subset of the entire output