Legacy Dev Forum Posts

 View Only

Sign Up

External Contacts Reversewhitepageslookup Issue

  • 1.  External Contacts Reversewhitepageslookup Issue

    Posted 06-05-2025 18:40

    Jonathan_Jones | 2018-02-08 23:50:19 UTC | #1

    New to Purecloud and the Forum, I can't seem to get my head wrapped around this. All I want to be able to do is input the E164 phone number of our store, have it search the Purecloud external contacts and return (at this point any information), but preferably the firstName, lastName, Title, Address, City, State, PostalCode. So I'm trying to do a search in the External Contacts when a customer calls in to pull back customer specific store information using the phone number that they've called into. Ex. Store A phone number is +1XXXYYYZZZZ, and Store A's address is in our External Contacts, save that variable and push it to the agent script.

    To create this I went to manage actions, add action, choose PureCloud Data Actions. Filled in the Input Contracts and Filled in the Output Contracts Using the Salesforce Get Contact By Phone Number Contracts as an example. In Configuration Request used this { "requestUrlTemplate": "/api/v2/externalcontacts/reversewhitepageslookup", "requestType": "GET", "headers": { "UserAgent": "PureCloudIntegrations/1.0", "Content-Type": "application/x-www-form-urlencoded" }, "requestTemplate": "${input.rawRequest}" }

    And the Response { "translationMap": { "contact": "$.searchRecords" }, "successTemplate": "${contact}" }

    Any help would be appreciated.


    Jason_Mathison | 2018-02-09 14:36:44 UTC | #2

    What are the results when you run your action in test mode?


    Jason_Mathison | 2018-02-09 15:15:58 UTC | #3

    I dug into this API by using our API explorer: https://developer.mypurecloud.com/developer-tools/#/api-explorer Navigate to external contacts -> reverse white pages lookup -> get and verified that I could use the API.

    The API explorer shows exactly what URL and body are sent to the API. Since this is a GET, everything is driven by the URL, there is no body.

    Your configuration is currently sending the value to lookup in the body. That is going to have to be moved to the URL template. One thing that can trip you up is that you will need to URL escape the search value since it will have a "+" in it. That part of your URL template is going to need to look something like $esc.url($input.valuetoserach).


    Jonathan_Jones | 2018-02-09 16:53:17 UTC | #4

    Hi Jason,

    I've ended up re-writing the whole things, thanks to another community member, so now I have a new issue. Test Error/Request&Response attached. ![Error

    690x294](upload://28pNzxKb2uJkVMQ2rOBOTShFewi.JPG)

    ![request

    690x204](upload://nBwr9yO3PTC8mbqUbq2k4m0b63P.JPG)

    ![response

    690x159](upload://yIepMoyiaJpuLMJf8UGYkjTJc92.JPG)


    Jason_Mathison | 2018-02-12 20:07:15 UTC | #5

    This site will let you test JSONPath with custom input: http://jsonpath.com

    You should be able to run a test of your action and then copy and paste the results of the execute step into jsonpath.com and then test your JSONPath from there.

    In this case, it appears that the issue is that your address1 translation map should look like: "address1": "$.contacts[0].address.address1"


    Jonathan_Jones | 2018-02-13 16:04:03 UTC | #6

    Thanks Jason, I knew it would be gap in my understanding of it. I'll give this a try.


    system | 2018-03-16 16:04:09 UTC | #7

    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: 2484