Step 5: Submit task data
Each task in a journey requires specific data to be submitted before it can be completed. This could include identity information, uploaded documents, or other verification inputs.
This guide explains how to submit task data using the GBG GO API.
When to submit task data
You need to submit task data when:
- A task requires user input (e.g., name, address, document)
- You’ve retrieved the schema for the task
- You want to mark a task as complete and move the journey forward
Prerequisites
Make sure you have:
- Access token – Get this from the Authenticate step
- Instance ID – Returned when you Start a journey
- Task ID – Retrieved using Retrieve tasks
- Schema – Defines the required fields for submission. See Manage schemas and User data schema for an explanation of the schema for passing customer data.
Submit task data (API request)
Send a POST
request to the /journey/task/update
endpoint. Your request should be in the following format depending on the user data schema:
The "intent": "COMPLETE"
value is required to mark the task as finished. Make
sure the data
object follows the correct structure based on the task schema (user
data schema).
What happens after submitting
Once your task data is submitted:
- If valid, then the task is marked as complete
- If more tasks remain, then Retrieve tasks to see what’s next
- If your data is incorrect or missing required fields, then the API returns a validation error
Handling validation errors
If the API returns a validation error:
- Review the error message and field names
- Compare your request against the schema
- Fix the incorrect or missing fields
- Retry the request
Best practices
- Always validate your input locally against the schema before sending
- If you’re dynamically generating forms, make sure to use the task schema structure
- Only use
"intent": "COMPLETE"
when the task is ready to be finalized
Next step
Go to Fetch journey state to check whether the journey has completed or if more tasks remain.