When im doing the GET request to get the affinityToken, its come empty


I set the two headers.

req.Headers["X-LIVEAGENT-API-VERSION"] = "34";

req.Headers["X-LIVEAGENT-AFFINITY"] = null;

I'm using C#

Why do I get an empty response?


I found this previous question around a similar issue: Affinity token missing from SessionId call.

To have the sessionId call return the affinity token, along with the X-LIVEAGENT-API-VERSION you also have to send the X-LIVEAGENT-AFFINITY parameter with the value explicitly stated as 'null'.

I suspect the problem might be around what concept of null they actually want here.

It looks like you are explicitly setting the X-LIVEAGENT-AFFINITY header to the C# version of null. Instead, try setting it to a string with the value null. E.g.

req.Headers["X-LIVEAGENT-AFFINITY"] = "null";

I suspect they are looking for that string in the header.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.