LogoLogo
  • Genie Partner API
  • Getting Started
    • Quick Start Guide
    • Requesting Access
    • Installation & Configuration
    • Features
    • FAQ
    • What is FHIR?
    • Using Postman
    • Versioning & Release Notes
      • Release Notes
      • Release Notes Archive
  • API
    • Partner API
      • Capability Statement
  • Tutorials & Examples
    • Connecting with Postman
      • Setup and Config
      • Your Account Details
      • Calling the API
    • Machine-to-Machine Authentication
      • Setup and Config
  • Downloadable Resources
    • Getting Started
    • All FHIR Collections
Powered by GitBook
On this page
  • Prerequisites
  • Steps
  1. Tutorials & Examples
  2. Machine-to-Machine Authentication

Setup and Config

Prerequisites

The key variables you will need to do requests to the Partner API are API_URL,API_KEY AUTH_URL, TOKEN_URL, CLIENT_ID, CLIENT_SECRET, SCOPES

Steps

  1. Request tokens: From the authorized application, request an Access Token for your API.

  2. Call API: Use the retrieved Access Token to call your API.

Example of requesting token:

curl --request POST \
  --url 'https://TOKEN_URL/oauth2/token' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data grant_type=client_credentials \
  --data client_id=CLIENT_ID \
  --data client_secret=CLIENT_SECRET \
  --data scope="<scopes>"

Example response:

If all goes well, you'll receive an HTTP 200 response with a payload containing access_token, token_type, and expires_in values:

{
  "access_token": "eyJz93a...k4laUWw",
  "token_type": "Bearer",
  "expires_in": 86400
}

Call API

To call the Partner API the application must pass the retrieved Access Token as a Bearer token in the Authorization header of your HTTP request:

curl --request GET \
  --url https://<API_URL>/EligibilityRequest \
  --header 'authorization: Bearer ACCESS_TOKEN' \
  --header 'content-type: application/json'
  --header 'x-api-key: API_KEY'
PreviousMachine-to-Machine AuthenticationNextGetting Started

Last updated 2 years ago