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

Live Agent REST API Call Not working

I am trying to make connection with Live Agent Rest API but some how my headers are not getting set.

In the browser console I see the request is going out but when I try to see the request header its missing these two headers instead I only see these under Access-Control-Request-Headers:x-liveagent-affinity, x-liveagent-api-version

Error: Status Code: 400 Bad Request

Any thought?
     dataType: 'json', 
     Accept : "text/plain; charset=utf-8",
     type: 'GET',
     contentType: 'application/x-www-form-urlencoded',
      headers: {
      'X-LIVEAGENT-AFFINITY': 'null'

     error:function(textStatus ){
         console.log(textStatus );
         alert("Error"+textStatus );

ShashankShashank (Salesforce Developers) 
It's probably got to do with how the headers are set in JQuery. Please see if this helps:
Hi Mktdev, 
Have you ever fixed this issue? I am meeting the same problem and cannot figure out how to solve. If you've already found the solution, would you please post it.