function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bern RudisillBern Rudisill 

live agent REST API setting breadcrumb

I notice using the native Live Agent API the chat agent is able to see the URL the chat is coming from along with recent visited URLs, how can I do the same using the Live Agent REST API? I have tried using the https://hostname/chat/rest/Visitor/Breadcrumb URI but it does not seem to do anything. Does anyone have any suggestions?
Best Answer chosen by James Loghry
Bern RudisillBern Rudisill
Setting the Breadcrumb for the live agent is what I was trying to do. I was finally able to get this working, the RESTful API documentation is not correct. When using https://<hostname>/chat/rest/Visitor/Breadcrumb you must also supply the following Query Parameters
org_id
deployment_id
sid

and the request body should be
{location="<URL>"}

 

All Answers

James LoghryJames Loghry
Bern,

That API is for setting Breadcrumbs that the live agent user can see, and doesn't return any response. It looks like there is some RESTful call you can make that can retrieve breadcrumbs via a "NewVisitorBreadcrumb" response, but I'm not sure how you structure those calls.  In fact, this is all I can find on it: https://developer.salesforce.com/docs/atlas.en-us.live_agent_rest.meta/live_agent_rest/live_agent_rest_response_bodies.htm#NewVisitorBreadcrumb
Bern RudisillBern Rudisill
Setting the Breadcrumb for the live agent is what I was trying to do. I was finally able to get this working, the RESTful API documentation is not correct. When using https://<hostname>/chat/rest/Visitor/Breadcrumb you must also supply the following Query Parameters
org_id
deployment_id
sid

and the request body should be
{location="<URL>"}

 
This was selected as the best answer
James LoghryJames Loghry
Good to know.  I'm going to go ahead and mark your answer as Best Answer.  In the future, please be sure to mark the best answer for any of your questions.  Thanks!
Jaya Koti MuleJaya Koti Mule
Hi Bern Rudisill,

I have the same requirement where I need to set a Breacrumb value to the Agent from the Visitor.
Can you post the code what you did to make the Breadcrumb REST call. It will help me a lot.
Thanks in advance.
Marcel dos SantosMarcel dos Santos
Just complementing what Bern Rudisill said, the sid is the session id that you can get using either /chat/rest/System/SessionId or chat/rest/Visitor/VisitorId?org_id=<org_id>&deployment_id=<deployment_id>.

The session id is  the value before the first !. Don't mistake it with the key.

Another important detail is include the X-LIVEAGENT-API-VERSION header.

A valid breadcrumb POST request would be something like:
Header: X-LIVEAGENT-API-VERSION: 36
URL: https://d.la1-c2cs-iad.salesforceliveagent.com/chat/rest/Visitor/Breadcrumb?org_id=00Dg0000005AbcD&deployment_id=57211000000ABCd&sid=8254011a-e123-4545-ba98-ab745871220c
Body: {"location": "https://someurl.com"}