How to help a user that is stuck within a Journey?

Hasan Tariq Updated by Hasan Tariq

In the rare case that a user gets stuck in a Journey it is crucial to address the issue to prevent a frustrating user experience.

Let's dig in on why it happens and how to address it.

How to help a stuck user

TIP: You can also use the process described below, when prototyping and/or testing your service. It allows you to rapidly restart a Journey rather than having to complete it each time.

Use our REST API to end the specific Journey regardless of where the user got stuck in the Journey. From a technical perspective, we refer to deleting the conversation claim. When a user starts a specific Journey on your service, that Journey momentarily owns the conversation so that other Journeys' cannot interrupt the conversation flow. The conversation claims end when the user completes the Journey or if the claim times out. Whichever one comes first. On Turn, the default conversation claim is 5 minutes.

NOTE that if you delete the claim on a user's conversation within a Journey, all progress the user made in their journey will be deleted and if they initiate the Journey again, they will start from the beginning. However, any data saved to a contact's fields will be preserved.

Using the REST API

You can use the following endpoint with a GET call to obtain information about whether a user is claimed by a Journey - the wa_id is the user's phone number or URN, without the leading + symbol:

$ curl -X GET "https://whatsapp.turn.io/v1/contacts/<wa_id>/claim" \
-H "Authorization: Bearer token" \
-H "Accept: application/json"


Response:

> {
"claimed_at" : "2023-05-06T10:19:00.791854Z",
"claimed_until" : "2023-05-09T10:19:00.801389Z",
"inserted_at" : "2023-05-08T10:19:00.801498Z",
"message_uuid" : "6f988bca-462e-407e-afa4-1d7c3a3fc4f6",
"metadata" : {},
"scope" : "stack", # <- note that stack here is a technical term for Journey
"scope_id" => "503db06f-0f29-41f4-8287-57326e9f4217",
"updated_at" : "2023-05-08T10:19:00.801498Z",
"uuid" : "f9dc8f9a-3b77-4a74-aeed-551cd51cb432"
}

The same endpoint can be used to do a DELETE call to delete the claim which will release the user from the Journey they are currently a part of and allow the user to start over again.

$ curl -X DELETE "https://whatsapp.turn.io/v1/contacts/<wa_id>/claim" \
-H "Authorization: Bearer token" \
-H "Accept: application/json"


Response:

> {"claim_uuid": "f9dc8f9a-3b77-4a74-aeed-551cd51cb432"}

If a user is not currently a Journey, you will get the following response:

{"errors":["Not found"]}
For more information on conversation claims refer to https://whatsapp.turn.io/docs/api/extensions#conversation-claiming

Was this article helpful?

Can I format content with bold, italics etc?

How to change our chat service display name?

Contact