• Manoj M
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies

Creating sessionId is working fine:

https://developer.salesforce.com/docs/atlas.en-us.live_agent_rest.meta/live_agent_rest/live_agent_rest_SessionId.htm

I am trying to create a chat visitor session but I am getting the error: "Session required but was invalid or not found". 
https://developer.salesforce.com/docs/atlas.en-us.live_agent_rest.meta/live_agent_rest/live_agent_rest_ChasitorInit.htm

 

Headers:
  Authorization: 'Bearer xxxx',
    'X-LIVEAGENT-API-VERSION': '48',
    'X-LIVEAGENT-SESSION_KEY': 'xxxxxxxx', // key from sessionId request
    'X-LIVEAGENT-AFFINITY': 'xxxxxxxx', // affinityToken from sessionId 
    'X-LIVEAGENT-SEQUENCE': '1'

Request Body:
    sessionId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
    organizationId: '00Dxxxxxxxxxxxxx',
    deploymentId: '572xxxxxxxxxxxx',
    buttonId: '573xxxxxxxxxxxx',
    userAgent: '',
    language: 'en-US',
    screenResolution: '2560x1440',
    visitorName: 'Test',
    prechatDetails: [],
    prechatEntities: [],
    receiveQueueUpdates: true,
    isPost: true
We want to get the chat messages to/from the Agent to our webhook via REST API. Is it possible with salesforce? There are limited articles here on this and all of them are many years old.