title | description |
---|---|
Start Hosted Pages session |
Create a session for a specific stakeholder to complete activities in a care flow with Hosted Pages |
We recommend reading more about "Awell Hosted Pages" first before moving on.
Please note that this mutation can only be used to create a Hosted Pages session for a care flow that is already active. Have a look at our Start pathway and Hosted Pages session mutation. If you would like to start a pathway and immediately create a session.
- When Awell notifies you via the
activity.created
webhook or through a specific action in the care flow, such as an API call, indicating that a patient/stakeholder needs to complete an activity in a care flow, your application creates a new Hosted Pages Session with this mutation. This will will give you access to a session URL. - You embed (or redirect staeholder to) Hosted Pages as an iframe in your app so the patient can interact with their pending activities.
- The patient completes all their pending activities.
- (optional) When all pending activities are completed, you can subscribe to the
session.completed
webhook to trigger any kind of post-completion logic on your end (view all session-related webhooks).
mutation StartHostedPagesSession($input: StartHostedActivitySessionInput!) {
startHostedActivitySession(input: $input) {
session_id
session_url
}
}
{
"input": {
"pathway_id": "{{PATHWAY_ID}}",
"stakeholder_id": "{{STAKEHOLDER_ID}}",
"success_url": "https://yourdomain.com/success.html",
"cancel_url": "https://yourdomain.com/cancel.html"
}
}
The pathway_id
specifies which care flow/pathway instance there are activities to complete for and the stakeholder_id
specifies the stakeholder.
The success_url
and cancel_url
specify where the stakeholder should be redirected to when the care flow/pathway session is completed or canceled/interrupted respectively. If success_url
and cancel_url
are not specified, then static success and cancel pages will be shown in the Hosted Pages application.
{
"input": {
"pathway_id": "{{PATHWAY_ID}}",
"stakeholder_id": "{{STAKEHOLDER_ID}}",
"success_url": "https://yourdomain.com/success.html",
"cancel_url": "https://yourdomain.com/cancel.html",
"language": "en"
}
}
Languages should be passed as an ISO 639-1 shortcode. If no language is passed, it defaults to English.
Awell Hosted Pages is currently available in the following languages:
- English (en)
- Dutch (nl)
- Estonian (et)
- French (fr)
- Romanian (ro)
- Spanish (es)
- Russian (ru)
A session expires after 60 minutes but the timer is reset after every completion of an activity. A session also expires when there are no pending activities left in a pathway.