Skip to content

Instantly share code, notes, and snippets.

@Nakort
Last active January 30, 2017 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nakort/ff0dabd4d295192eb5de20e0da5daaf0 to your computer and use it in GitHub Desktop.
Save Nakort/ff0dabd4d295192eb5de20e0da5daaf0 to your computer and use it in GitHub Desktop.
User handoff

We will send over a token when the patient requests to see a dermatologist. This token will be used in step 4.

https://www.exampledermatologist.com?token=abcdefg1234567

To interact with MDLIVE’s API you must first obtain a jwt token using a set of credential.

POST https://mdlqa4-api.mdlive.com/auth/auth_token
 
Include in body: 
{
  "auth": {"api_key": "90998f8741348wecc9c76", "password": "f766448ewcwecw5a0976"}
}

Example Successful Response: 

{
  "jwt": "eyJ0eXAiOiJKVkokmomooiGciOiJIUzI1NiJ9.eyJleHAiOjE0njnjnhnhnhnhs1ZCI6ZmFsc2UsInN1YiI6NH0.wUPvZ6TZ0cQYwaWpo9K6Kxa1e39HfrkSBMytpkmbxMU"
}

Set Authorization Header to jwt token to make authenticated requests to our api.

Authorization:  Bearer eyJ0eXAiOiJKVkokmomooiGciOiJIUzI1NiJ9.eyJleHAiOjE0njnjnhnhnhnhs1ZCI6ZmFsc2UsInN1YiI6NH0.wUPvZ6TZ0cQYwaWpo9K6Kxa1e39HfrkSBMytpkmbxMU

With the authenticated header set above, send token to our system to get patient information.

https://mdlqa4-api.mdlive.com/api/v1/sso_tokens/abcdefg1234567

Example Successful Response: 

{
  "patient": {
    "id": 52,
    "birthdate": "1986-06-21",
    "first_name": "demopatient1",
    "last_name": "demopatient1",
    "gender": "Male",
    "email": "demopatient1@md.com"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment