Access embeddable widget get parse telephone number response

  • 1
  • Idea
  • Updated 2 weeks ago
  • (Edited)
I am using RC embeddable widget with the CRM, I need to do contact/match request to CRM for Inbound calls and outbound calls as well. There is telephone number parse request always dispatching before the actions triggered.
Is there any way to get the telephone-number/parse response to use for my APIs?
I can't directly get the bearer token from local storage for the manual request again for the telephone-parse API.
Photo of sharmilan A

sharmilan A

  • 538 Points 500 badge 2x thumb

Posted 2 weeks ago

  • 1
Photo of Embbnux Ji

Embbnux Ji, Employee

  • 1,198 Points 1k badge 2x thumb
Hi, Sharmilan I am not very clear about why you need to parse phone number. Can we show same details. 
You can use this package to parse phone number in local https://www.npmjs.com/package/@ringcentral-integration/phone-number  this is source code https://github.com/ringcentral/ringcentral-js-widgets/tree/master/packages/phone-number
Photo of sharmilan A

sharmilan A

  • 538 Points 500 badge 2x thumb
Hi, Embbnux Ji,
FYI I am using fake numbers.
I have 2 issues. First,
For outbound calls in the calling screen shows as `Unknown` for contact name, even the same number exists in the CRM. I am attaching snap-shot here.




Second, if number might not match exactly for some reasons, such as not included country code in the CRM. For this scenario, I need to parse the number before send the search request, I will try with your NPM package.
(Edited)
Photo of Embbnux Ji

Embbnux Ji, Employee

  • 1,198 Points 1k badge 2x thumb
I think two issues are same problem. Contact search and contact match use data from different path https://github.com/ringcentral/ringcentral-embeddable/blob/master/docs/third-party-service-in-widget... For match path, widget will send normalized phone numbers array to your event listener. You should reponse a object which use previous normalized phone numbers as object key.

For example:
When you get phone numbers from request: data.phoneNumbers = [+1234567890],
you should response object:

{
  '+1234567890': [matchedContactData]
}
(Edited)
Photo of sharmilan A

sharmilan A

  • 538 Points 500 badge 2x thumb
Thanks, I missed adding inside the array.
{
  '+1234567890': matchedContactData
}

Now works fine.
Photo of Embbnux Ji

Embbnux Ji, Employee

  • 1,198 Points 1k badge 2x thumb
Cool, You are welcome
(Edited)