Introduction
The journey session API creates a journey session based on a journey template and a leadId. After each successful creation, a URL is returned which can then be used to display the new journey session in an iFrame or a new window — allowing you to collect further information from your customers or prospects and store it against an existing lead. After submitting the journey session, the session is then closed.
Resource URL
POST
https://<your_domain>/api/v2/journey-response-sessions
Where <your_domain> is your complete FLG 360 domain. For example:
https://demo.flg360.co.uk/api/v2/journey-response-sessions
Resource Information
Request headers
| Header | Datatype | Description |
|---|---|---|
| authorization | string | This is a string in the form Bearer <api_key> (without the quotes). |
Where <api_key> is an access key with Journeys permissions. This is set in Settings > Configuration > Access Keys — check the ‘Allow access to Journeys’ option.
Request body parameters
| Parameter | Datatype | Description |
|---|---|---|
| lead | string | The ID of the lead you want to create a new journey session on. |
| journey | string | A UUID that is the ID of the journey you want to run. It must belong to the same lead group as the lead, or be marked for all lead groups. To retrieve the Journey ID, go to Settings > Journeys and select the relevant journey. Click the options icon (three dots) in the top right corner and select Properties. |
| public | boolean | Whether the session is marked as public and available to be used outside of FLG in an iFrame or on a website. |
Example Request
Header
authorization: Bearer 6Pr9827YMLXhVkSk0LoABgRQasbaXYrM
Body
{
"lead": "108123759",
"journey": "39594a1c-72db-4990-a63f-8d5139a5e4e1",
"public": true
}Example Response
The publicUrl value is the one you use to display the journey session in an iFrame or in a new window.
{
"sessionId": "0260be7f-7c73-45ae-a1d0-2c7328151d38",
"lead": "108123758",
"journey": "4da80d92-e6fb-432e-a631-aea2b1e97a05",
"open": true,
"complete": false,
"expired": false,
"public": true,
"closesAt": null,
"journeySnapshot": {
"title": "Example Journey",
"leadGroup": null,
"body": [
{
"text": "First name",
"type": "input",
"dataField": "firstname",
"journeyFieldId": "d076ef67-70dc-439d-8cc5-4bdb8c6b0562",
"readOnly": false,
"required": true
},
{
"text": "Last name",
"type": "input",
"dataField": "lastname",
"journeyFieldId": "858cc41a-ed93-472b-9eb7-e3b0d3ebdc8d",
"readOnly": false,
"required": true
}
],
"pages": [
{
"title": "Page 1",
"pageId": "e5cb6895-3bd9-447f-a165-299e72948530"
}
],
"templateName": "JURL_EXAMPLE_JOURNEY",
"journeyId": "4da80d92-e6fb-432e-a631-aea2b1e97a05",
"createdAt": 1571315201314,
"createdBy": "10",
"modifiedAt": 1571315204314,
"modifiedBy": "10"
},
"values": {},
"page": 1,
"publicUrl": "https://platform.getflg.com/journeys/run/4/0260be7f-7c73-45ae-a1d0-2c7328151d38",
"createdAt": 1571315620606,
"createdBy": "10",
"modifiedAt": 1571315620606,
"modifiedBy": "10"
}HTTP Responses
| Response code | Description |
|---|---|
| 200 | POST request was sent successfully and the session was created. |
| 400 | The journey or lead were not specified or could not be found. Or the lead’s lead group did not match the journey’s lead group. |
| 401 | The authorization token or key is invalid. |
| 403 | The authorization token or key was valid, but it did not have the necessary permissions set. |
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article