agilio | 2023-02-16 20:20:34 UTC | #1
I'm getting errors when trying to call * /api/v2/conversations/calls/{conversationId}/participants/{participantId}/consult* using an implicit grant. I'm able to get other apis like /api/v2/users/me and /api/v2/conversations which are under the user's context to work. Wondering if there is something about this API that would make it different. Here is a quick ajax we mocked up.
$.ajax({
url: https://api.${ENVIRONMENT}/api/v2/conversations/${conversationId}/participants/${customerId}/consult,
type: "POST",
body: JSON.stringify({speakTo: 'BOTH',destination: {address: '+1$$$$$$$$$$',name: 'English'}}),
beforeSend: function (xhr) { xhr.setRequestHeader('Authorization', 'bearer ' + token); },
success: function (data) {
console.log("Me: ", data);
}
});
Access to XMLHttpRequest at 'https://api.usw2.pure.cloud/api/v2/conversations/$$$$10c9-7282-4f10-8583-55fbaf011ed3/participants/0850dc82-$$$$-4b23-85db-831590e$$$$/consult' from origin 'https://myhost.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
Thanks
Anthony
Jerome.Saint-Marc | 2023-02-17 06:02:56 UTC | #2
Hello,
The url in your ajax request seems incorrect. You are missing "calls" in the url path. Your code -> https://api.${ENVIRONMENT}/api/v2/conversations/${conversationId}/participants/${customerId}/consult, Correct Url -> https://api.${ENVIRONMENT}/api/v2/conversations/calls/${conversationId}/participants/${customerId}/consult,
Regards,
agilio | 2023-02-17 15:16:17 UTC | #3
Duh! Thanks, Jerome! That's what I get for not using copy and paste :slight_smile:
system | 2023-03-20 15:17:14 UTC | #4
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 18453