Skip to main content

How To: Using Integration Tokens with Questionnaires

Welcome to the Semble GraphQL API how-to guide. In this guide, we will walk you through the process of using integration tokens with questionnaires to directly match a patient, eliminating the need for patients to re-enter their details every time.

Here are the steps:

Step 1: Authenticate

Before making any requests, make sure you have a valid token. Refer to the Authentication section for more details.

Step 2: Create an Integration Token

To create an integration token, you will need to use the createIntegrationToken mutation.

Integration tokens are valid for one week, here's how to create one in different languages:

curl -X POST https://open.semble.io/graphql \
-H "Content-Type: application/json" \
-H "x-token: yourtoken" \
-d '{
"query": "mutation { createIntegrationToken { id } }"
}'

Step 3: Get Integration Token

To retrieve the integration tokens, use the integrationToken query. Here's how:

curl -X POST https://open.semble.io/graphql \
-H "Content-Type: application/json" \
-H "x-token: yourtoken" \
-d '{
"query": "query { integrationToken { id } }"
}'

Step 4: Append the Integration Token to the Questionnaire URL

Once you have the integration token, you can append it to a questionnaire URL like so:

https://questionnaires.semble.io/:questionnaireToken/:integrationToken

Where:

  • :questionnaireToken is the token of the questionnaire you want the patient to fill.
  • :integrationToken is the token you obtained in the previous steps.

This URL will take the patient directly to the questionnaire without needing to enter their details each time.

Conclusion

Congratulations! You've successfully used integration tokens with questionnaires in the Semble API. This will streamline your patients' experience and improve the efficiency of data collection in your application. Happy integrating!