Appearance
Endpoint: /OAuth
This endpoint will accept valid credentials in return for an access token that will be used in subsequent requests to retrieve data. gEHRiMed user credentials can be used, or custom credentials can be added as needed for server to server communication. OAuth tokens are valid for twenty minutes from the time they are requested. Once a token expires, a user will have to request a new token.
Request : Form-Url-Encoded
Content-Type: application/x-www-form-urlencoded
client_id: my_client_id
client_secret: whatever_my_password_is
grant_type: client_credentialsResponse : JSON
{
"access_token": "pnrl2TRMAsEi0za8...",
"token_type": "bearer",
"expires_in": 1199,
".issued": "Tue, 2 Feb 2016 16:54:10 GMT",
".expires": "Tue, 2 Feb 2016 17:14:10 GMT"
}Subsequent requests should use the token authorization by placing the value of access_token into the Authorization header with the authorization type Bearer, as shown below:
POST /PatientService/Patient/Match HTTP/1.1
Host: service.gehrimed.com
Authorization: Bearer pnrl2TRMAsEi0za8...
x-scope: 2ED3E13EEF0A47FB81E51368D731A4Should this request be to Subscribe to "Send New Customer Notifications" or Get New Customer, the x-scope value can be blank.