API statusCode 0

Hello,

Please, what does mean a ZERO statusCode in { statusCode: 0, headers: undefined, body: undefined } ? Sometimes, I have this value in the catch bloc while calling getCallsCllId or getConversationsConversationIdEvaluationsEvaluationId. Though second API calls with the same ids give the expected response.

Thanks and regards,
Malick

Can you enable debug tracing to see what kind of responses you're getting?

You might be hitting a timeout from within the sdk itself. So the xhr times out before getting a response from purecloud.

Yes, I can... However I have surprisingly this kind of error :

And when I check the body of the variable with console.log(JSON.stringify(pureCloudSession, null, 4)), I have this:
{ "options": { "environment": "mypurecloud.ie", "strategy": "client-credentials", "clientId": "**********************************", "clientSecret": "************************************************", "timeout": 20000, "storageKey": "pureCloudSessionKey" }, "apiUrl": "https://api.mypurecloud.ie", "authUrl": "https://login.mypurecloud.ie" }

Can you provide a code sample? That doesn't look right. Documentation on how to enable debug logging is at the bottom of the page here: https://developer.mypurecloud.com/api/rest/client-libraries/javascript/

Actually, it looks like you're using the pre-release SDK that was deprecated in July. Try using the new SDK as the pre-release SDK is no longer supported. https://developer.mypurecloud.com/forum/t/javascript-sdk-stable-release-1-0-0/1593/2

Thank you. Tomorrow, I will try the new one and let you know.
Thanks again ...

Tim,

Is the purecloud_api_sdk_javascript package concerned by the deprecation ? I am using this one in my devs.
Thanks

Yes, that has been deprecated and will not receive any updates (and hasn't been updated in 6+ months). You need to use the package in the announcement I linked.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.