...
The advanced questionnaires FHIR resources are in FHIR version 4. This is because Questionnaires and QuestionnaireResponses will be read from our aggregated endpoint.
To access the aggregated endpoint, callers will need to be authenticated using OAuth2.0 ‘client credentials’ grant type.
The PKB Sandbox URL is used throughout this page. This should be replaced in your API calls to match the required environment.
Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Getting a Bearer token
To access the Questionnaire or QuestionnaireResponse endpoints, organisations will need to be authenticated using the OAuth2.0 ‘client credentials' grant type. This can be obtained by providing the client id and client secret in the body of an API call to the token URL.
Example request URL
Code Block |
---|
POST https://iam.sandbox.patientsknowbest.com/auth/realms/pkb/protocol/openid-connect/token |
Example request body
contentType: application/x-www-form-urlencoded
client_id: CLIENT ID
client_secret: CLIENT SECRET
grant_type: client_credentials
To get a client id and client secret for your organisation, please contact your success PM or the PKB integrations team.
Triggering a questionnaire request
...
The notificationFlag parameter is currently mandatory, but will not serve a function while there is no Practitioner acting as the sender of the questionnaire request.
Example request URL
Code Block |
---|
POST https://aggregated-fhir.sandbox.patientsknowbest.com/fhir/Questionnaire/bd17e556-20e3-4f01-8078-30e5f675b0f2/$send-questionnaire-request |
...
x-team-id: 235a397b-1ae8-4755-9c77-1a0e2fbc5314
Example request body
Code Block |
---|
{ "resourceType": "Parameters", "parameter": [ { "name": "target", "valueReference": { "reference": "Patient/a81e46b1-f953-4599-9721-81e66aa67c34" } }, { "name": "notificationFlag", "valueCode": "true" } ] } |
...