Context endpoint
In a regular conversation that takes place with Seamly through the Web UI, you will use the Window API to interact with the conversation. However, in some cases (like a closed chat in an app) you will no longer be able to call the Window API. In case this happens you can use the Context endpoint to set variables in the conversation's context.
How to use the Context endpoint
Seamly Web UI provides you with session data in the client. They will be provided to you through your Storage provider of choice. Among this data you can find the accessToken and conversationUrl that belong to the currently active conversation. You can use these two properties to call the Context endpoint.
You will need to prefix the conversationUrl depending on the environment:
- For your cdn-test or cdn-uat script, use:
https://api.uat.seamly-app.com - For your production cdn script, use:
https://api.seamly-app.com
Additionally you will need to place a suffix of /context.
Example for cdn-test or cdn-uat:
conversationUrlfrom the storage:/channels/api/v3/client/[api-key]/srv_id/[srv-id]/conversations/[conversation-id]- Endpoint to call:
https://api.uat.seamly-app.com/channels/api/v3/client/[api-key]/srv_id/[srv-id]/conversations/[conversation-id]/context
Once you have your endpoint URL, create a PATCH-request and use the accessToken as bearer token in a header like so: Authorization: Bearer [accessToken].
A complete specification of the Context endpoint, and the data you can send, can be found in the Channel API OpenAPI spec.