Questionnaire
This is based on the FHIR Questionnaire resource.
Key Information
Fetching a questionnaire in the Bingli API allows you to retrieve all questions associated with a specific survey task. This ensures smooth integration and access to survey content.
Essential Parameters
Task ID
- Description: The unique identifier of the task for which the questionnaire needs to be fetched.
- Usage: Must be provided in the request query to identify the associated questionnaire.
API Environments
Bingli provides multiple environments for different use cases:
- Production EU:
https://fhir-gateway.api.bingli.eu/tenant-api/questionnaire
- Acceptance EU:
https://fhir-gateway.api.acc.bingli.be/tenant-api/questionnaire
- Production US:
https://fhir-gateway.api.bingli.us/tenant-api/questionnaire
Fetching a Questionnaire
GET - Fetch Questionnaire
Endpoint
https://fhir-gateway.api.bingli.eu/tenant-api/questionnaire?identifier=http://fhirgateway.bingli.com/identifier/TaskId|<YOUR-TASK-ID>
Description
This endpoint retrieves all questions associated with a given survey task. The response includes structured questionnaire data following the FHIR standard.
Request Details
Headers
Key | Value |
---|---|
Accept | application/fhir+json |
Authorization | Bearer JWTTOKEN |
Query Parameters
Parameter | Description |
---|---|
identifier | The Task ID reference, formatted as `http://fhirgateway.bingli.com/identifier/TaskId |
Example Request URL
https://fhir-gateway.api.bingli.eu/tenant-api/questionnaire?identifier=http://fhirgateway.bingli.com/identifier/TaskId|12345abcde
cURL Request
To fetch a questionnaire using cURL, use the following command:
curl --location 'https://fhir-gateway.api.bingli.eu/tenant-api/questionnaire?identifier=http://fhirgateway.bingli.com/identifier/TaskId|<YOUR-TASK-ID>' \
--header 'Accept: application/fhir+json' \
--header 'Authorization: Bearer <TOKEN>'
Response Example
{
"resourceType": "Questionnaire",
"id": "123456789",
"status": "active",
"item": [
{
"linkId": "q1",
"text": "What is your name?",
"type": "string"
},
{
"linkId": "q2",
"text": "What is your date of birth?",
"type": "date"
}
]
}
Parameters Explanation
resourceType
: AlwaysQuestionnaire
to define the FHIR resource type.id
: Unique identifier of the questionnaire.status
: Indicates if the questionnaire is active.item
: An array containing all the survey questions.linkId
: The unique identifier for each question.text
: The question text.type
: Specifies the type of response expected (e.g.,string
,date
).
Conclusion
Fetching a questionnaire allows you to retrieve the full list of questions associated with a specific task. For further details, refer to the Bingli API Documentation or contact support@mybingli.com.