Note these are reserved APIs for use by Healthcode internal products only. These APIs must not be consumed by external integrators.

Introduction

ePx Diary APIs are internal API’s used by Diary application.

Post Authorization API

The post authorization API allows the diary application to validate the user based on the authorization code received from Healthcode’s Authentication page. This API responds with the access token required for diary application which is utilized in authorizing the user on accessing the other authorized API’s.

Request

curl -X 'POST' \
  'https://api.epractice.dev.healthcode.co.uk/api/auth/postauth' \
  -H 'accept: text/plain' \
  -H 'Content-Type: multipart/form-data' \
  -F 'Code= FS1VJAR2GPY9L8PMX70B' \
  -F 'StateToken='

Where,

FieldTypeDescription
CodestringAuthorization code received from Healthcode’s Auth page. It’s Mandatory.
StateTokenstringAn opaque string that is round-tripped in the protocol meaning it’s returned as a URI parameter. It’s optional.

Response Processing

{
   "access_token": "abCdE12...89mNopq0r",
   "response": 2
}

Where,

FieldTypeDescription
access_tokenstringAccess token generated from diary API.
responseintAPI response status where as value for Unauthorized is 1,
value for Ok is 2 and value for SiteNotMapped is 3

Refresh Token

The refresh token API allows the diary application to get the new token details and share the response with new token details. This refresh token API will calls the Healthcode’s refresh token API with shared client credentials and by using bearer token from the request headers.

Request

curl -X 'POST' \
  'https://api.epractice.dev.healthcode.co.uk/api/auth/refreshtoken' \
  -H 'Authorization: Bearer abCdE12...89mNopq0r' \
  -H 'accept: application/json' \

Response Processing

{
“access_token”: “abCdE12…89mNopq0r”,
“response”: 2
}

Where,

FieldTypeDescription
access_tokenstringAccess token generated from diary API.
responseintAPI response status where as value for Unauthorized is 1,
value for Ok is 2 and value for SiteNotMapped is 3

List Episode Types

This API allows the diary application to fetch all the episode types. This API validates the request by using bearer token from the request header.

Request

curl -X 'GET' \
  'https://api.epractice.dev.healthcode.co.uk/api/episodetypes' \
  -H 'Authorization: Bearer abCdE12...89mNopq0r' \
  -H 'accept: application/json' \

Response Processing

If all verifications succeed, the API returns HTTP 200 status back along with a response body of

{
  "data": [{
    "id": "AkBdF1A5fTWaSG2zYyxsvMjxF",
    "type": "D",
    "description": "Daycase"
  }],
  "success": false,
  "errors": null,
  "status": 200
}

For unauthorized requests, the API returns HTTP 401 Unauthorized without body.

List Appointment Status

This API allows the diary application to fetch all the appointment status. This API validates the request by using bearer token from the request header.

curl -X 'GET' \   'https://api.epractice.dev.healthcode.co.uk/api/appointments/appointmentstatus' \ 
-H 'Authorization: Bearer abCdE12...89mNopq0r' \
-H 'accept: application/json' \  

Response Processing

If all verifications succeed, the API returns HTTP 200 status back along with a response body of

{
  "data": [{
    "id": "0A5gqeuGaCo8trFDvutvnpDgg",
    "status": "Reserved"
  }],
  "success": false,
  "errors": null,
  "status": 200
}

For unauthorized requests, the API returns HTTP 401 Unauthorized without body.

List Recurrence Types

This API allows the diary application to fetch all the recurrence types. This API validates the request by using bearer token from the request header.

Request

curl -X 'GET' \
  'https://api.epractice.dev.healthcode.co.uk/api/recurrencetypes' \
  -H 'Authorization: Bearer abCdE12...89mNopq0r' \
  -H 'accept: application/json' \  

Response Processing

If all verifications succeed, the API returns HTTP 200 status back along with a response body of

{
  "data": [{
    "id": "0BbGH2u7jbOJrHccvR8zPi3oX",
    "type": "D",
    "description": "Daily"
  }],
  "success": false,
  "errors": null,
  "status": 200
}

For unauthorized requests, the API returns HTTP 401 Unauthorized without body.