my call not initialized and nor ringing when using
/api/v2/conversations/calls/
We use angularjs queue service component to chain these api calls
Note: this is a psuedo-code
$q((resolve, reject) => {
client.loginImplicitGrant(clientId, redirectUri, state)
.then(() => usersApi.getUsersMe()())
.then(selfData => {
userData = selfData;
return notificationsApi.postNotificationsChannels();
})
.then(channel => {
notificationsApi.putNotificationsChannelSubscriptions(userData, channel)
})
.then(() => {
// Invoke API
return conversationsApi.postConversationsCalls(conversationBody);
})
.then(data => {
this.pccallId = data.id;
resolve(data);
})
.catch(err => {
reject(err);
});
});
REQUEST BODY
for putNotificationsChannelSubscriptions
subscriptionBody = [{"id":}]
example
subscriptionBody = [{"id":"v2.users.fa2651e5-acf9-4bea-83fa-ce6980a70a04.conversations"}]
for postConversationsCalls
conversationBody = {"phoneNumber":}
or even
conversationBody = {"phoneNumber":"tel:"}
example
conversationBody = {"phoneNumber":"801097789937"}
RESPONSE
for postNotificationsChannels
200
response = {
"connectUri":"wss://carrier-pigeon.eu-west-1.mypurecloud.ie/v1/channels/8rsnpol3hao3u8tveam7fmrq65",
"id":"8rsnpol3hao3u8tveam7fmrq65",
"expires":"2019-03-14T13:12:38.043Z"
}
for putNotificationsChannelSubscriptions
note: it takes the previous channel response id in its end-point as follows
/api/v2/notifications/channels/8rsnpol3hao3u8tveam7fmrq65/subscriptions
200
response= {
"entities":[{"id":"v2.users.fa2651e5-acf9-4bea-83fa-ce6980a70a04.conversations"}]
}
for postConversationsCalls example
202
response = {
"id":"3f40827f-d9e8-4018-96c6-ea12dc2673df",
"selfUri":"/api/v2/conversations/calls/3f40827f-d9e8-4018-96c6-ea12dc2673df"
}