Fetch Interaction
Fetch the current interaction in a GBG GO journey to determine which domain elements to collect from the end user.
POST
/
journey
/
interaction
/
fetch
Fetch Interaction
curl --request POST \
--url https://eu.platform.go.gbgplc.com/v2/captain/journey/interaction/fetch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instanceId": "PiKR2O0IjyUR8KV3RviKt4we"
}
'import requests
url = "https://eu.platform.go.gbgplc.com/v2/captain/journey/interaction/fetch"
payload = { "instanceId": "PiKR2O0IjyUR8KV3RviKt4we" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({instanceId: 'PiKR2O0IjyUR8KV3RviKt4we'})
};
fetch('https://eu.platform.go.gbgplc.com/v2/captain/journey/interaction/fetch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://eu.platform.go.gbgplc.com/v2/captain/journey/interaction/fetch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'instanceId' => 'PiKR2O0IjyUR8KV3RviKt4we'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://eu.platform.go.gbgplc.com/v2/captain/journey/interaction/fetch"
payload := strings.NewReader("{\n \"instanceId\": \"PiKR2O0IjyUR8KV3RviKt4we\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://eu.platform.go.gbgplc.com/v2/captain/journey/interaction/fetch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"instanceId\": \"PiKR2O0IjyUR8KV3RviKt4we\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.platform.go.gbgplc.com/v2/captain/journey/interaction/fetch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"instanceId\": \"PiKR2O0IjyUR8KV3RviKt4we\"\n}"
response = http.request(request)
puts response.read_body{
"instanceId": "Pq_hhIX6-sHUy9FLSDzPLu",
"interactionId": "grn:::gbg:design:interaction:segment1@latest",
"journey": {
"status": "InProgress"
},
"interaction": {
"grId": "grn:::gbg:design:interaction:segment1@latest",
"resource": {
"id": "segment1",
"name": "segment1",
"version": "latest",
"type": "interaction",
"data": {
"pages": [
{
"id": "personal_details",
"label": "Personal details",
"cards": [
{
"id": "NameCard"
},
{
"id": "DateOfBirthCard"
},
{
"id": "IdentifierCardSSN"
},
{
"id": "ControlCard"
}
]
},
{
"id": "contact_details",
"label": "Contact details",
"cards": [
{
"id": "EmailCardPersonalEmail"
},
{
"id": "PhoneCardMobilePhone"
},
{
"id": "ControlCard"
}
]
},
{
"id": "address_details",
"label": "Address details",
"cards": [
{
"id": "AddressCard",
"config": {
"secrets": {
"loqateApiKey": {
"value": "WJ28-WP43-WG34-YD87"
}
}
}
},
{
"id": "ControlCard"
}
]
},
{
"id": "previous_addresses",
"label": "Previous Addresses",
"cards": [
{
"id": "PreviousAddressesCard"
},
{
"id": "ControlCard"
}
]
},
{
"id": "document_capture",
"label": "Document Capture",
"cards": [
{
"id": "DocumentCard"
}
]
}
]
}
},
"collects": [
{
"ref": "FullName",
"spec": "required"
},
{
"ref": "DateOfBirth",
"spec": "required"
},
{
"ref": "CurrentAddress",
"spec": "required"
},
{
"ref": "PreviousAddresses",
"spec": "optional"
},
{
"ref": "MobilePhone",
"spec": "optional"
},
{
"ref": "PersonalEmail",
"spec": "optional"
},
{
"ref": "SSN",
"spec": "optional"
},
{
"ref": "PrimaryDocument",
"spec": "required"
}
],
"consumes": []
},
"outstanding": [
"FullName",
"DateOfBirth",
"CurrentAddress",
"PrimaryDocument"
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Journey instance identifier
Response
Success
- Option 1
- Option 2
Journey instance identifier
Interaction identifier
Current journey state.
Show child attributes
Show child attributes
The current interaction definition, including the resource (pages/cards) and data collection requirements.
Show child attributes
Show child attributes
List of data element references that are still required but not yet collected.
Was this page helpful?
⌘I
Fetch Interaction
curl --request POST \
--url https://eu.platform.go.gbgplc.com/v2/captain/journey/interaction/fetch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instanceId": "PiKR2O0IjyUR8KV3RviKt4we"
}
'import requests
url = "https://eu.platform.go.gbgplc.com/v2/captain/journey/interaction/fetch"
payload = { "instanceId": "PiKR2O0IjyUR8KV3RviKt4we" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({instanceId: 'PiKR2O0IjyUR8KV3RviKt4we'})
};
fetch('https://eu.platform.go.gbgplc.com/v2/captain/journey/interaction/fetch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://eu.platform.go.gbgplc.com/v2/captain/journey/interaction/fetch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'instanceId' => 'PiKR2O0IjyUR8KV3RviKt4we'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://eu.platform.go.gbgplc.com/v2/captain/journey/interaction/fetch"
payload := strings.NewReader("{\n \"instanceId\": \"PiKR2O0IjyUR8KV3RviKt4we\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://eu.platform.go.gbgplc.com/v2/captain/journey/interaction/fetch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"instanceId\": \"PiKR2O0IjyUR8KV3RviKt4we\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu.platform.go.gbgplc.com/v2/captain/journey/interaction/fetch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"instanceId\": \"PiKR2O0IjyUR8KV3RviKt4we\"\n}"
response = http.request(request)
puts response.read_body{
"instanceId": "Pq_hhIX6-sHUy9FLSDzPLu",
"interactionId": "grn:::gbg:design:interaction:segment1@latest",
"journey": {
"status": "InProgress"
},
"interaction": {
"grId": "grn:::gbg:design:interaction:segment1@latest",
"resource": {
"id": "segment1",
"name": "segment1",
"version": "latest",
"type": "interaction",
"data": {
"pages": [
{
"id": "personal_details",
"label": "Personal details",
"cards": [
{
"id": "NameCard"
},
{
"id": "DateOfBirthCard"
},
{
"id": "IdentifierCardSSN"
},
{
"id": "ControlCard"
}
]
},
{
"id": "contact_details",
"label": "Contact details",
"cards": [
{
"id": "EmailCardPersonalEmail"
},
{
"id": "PhoneCardMobilePhone"
},
{
"id": "ControlCard"
}
]
},
{
"id": "address_details",
"label": "Address details",
"cards": [
{
"id": "AddressCard",
"config": {
"secrets": {
"loqateApiKey": {
"value": "WJ28-WP43-WG34-YD87"
}
}
}
},
{
"id": "ControlCard"
}
]
},
{
"id": "previous_addresses",
"label": "Previous Addresses",
"cards": [
{
"id": "PreviousAddressesCard"
},
{
"id": "ControlCard"
}
]
},
{
"id": "document_capture",
"label": "Document Capture",
"cards": [
{
"id": "DocumentCard"
}
]
}
]
}
},
"collects": [
{
"ref": "FullName",
"spec": "required"
},
{
"ref": "DateOfBirth",
"spec": "required"
},
{
"ref": "CurrentAddress",
"spec": "required"
},
{
"ref": "PreviousAddresses",
"spec": "optional"
},
{
"ref": "MobilePhone",
"spec": "optional"
},
{
"ref": "PersonalEmail",
"spec": "optional"
},
{
"ref": "SSN",
"spec": "optional"
},
{
"ref": "PrimaryDocument",
"spec": "required"
}
],
"consumes": []
},
"outstanding": [
"FullName",
"DateOfBirth",
"CurrentAddress",
"PrimaryDocument"
]
}