Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  External Contact by ANI - GET/api/v2/externalcontacts/reversewhitepageslookup

    Posted 2 hours ago

    Hi all,

    Can someone give me some assistance.

    I simply want my call flow to check if the ANI that is being used on an inbound call, is assigned to an external contact.

    I think the GET - /api/v2/externalcontacts/reversewhitepageslookup is the best bet for this, but I might be wrong.

    I can see when I run a test ANI through the API - it gives me a list of contact attributes, number, address etc, and Type "Curated"

    I'd like for my data action to search by ANI, return "Type": Curated (hopefully)

    Then in architect run a decision afterwards to define a success if curated and fail if anything else.

    I'm no good at creating data actions it would seem, so some help would be greatly appreciated.

    Many thanks,


    #DataActions

    ------------------------------
    Nicholas Squires
    Resource Planning, Telephony Data Analyst
    ------------------------------


  • 2.  RE: External Contact by ANI - GET/api/v2/externalcontacts/reversewhitepageslookup

    Posted 2 hours ago
    Edited by Phaneendra Avatapalli 2 hours ago

    Hi Nicholas,

    From my understanding, you're on the right track, and this is how you could implement it.

    You can create a Data Action that takes the ANI as input, calls:

    GET /api/v2/externalcontacts/reversewhitepageslookup

    and maps the returned type field (e.g. Curated) as an output.

    Then in Architect:

    • Pass in the ANI (e.g. Call.Ani)
    • Use a Decision:
      • If contactType == "Curated" → success
      • Else → fail

    One thing to watch is the ANI format - it should match what's stored in External Contacts, ideally E.164 format (e.g. +614...), otherwise the lookup may not return a match.

    Also, if your goal is simply to check whether the ANI exists in External Contacts, you could also consider the native Search External Contacts action in Architect, which may be simpler than building a custom Data Action.

    https://help.genesys.cloud/articles/search-external-contacts-action/

    Hope this helps and someone from community might add more to this.



    ------------------------------
    Phaneendra
    Technical Solutions Consultant
    ------------------------------



  • 3.  RE: External Contact by ANI - GET/api/v2/externalcontacts/reversewhitepageslookup

    Posted 2 hours ago

    Thank you Phaneendra.

    For some strange reason, the 'Search External Contact' action is not available in call flows 🤣 - it's restricted to digital channels.

    But what you've suggested in regards to the data action is exactly what I'm trying to do.

    I just don't have a lot of experience creating data actions and translation mapping etc.

    Would you possibly be able to help with an import action that might do what I'm looking for?

    Many thanks,



    ------------------------------
    Nicholas Squires
    Resource Planning, Telephony Data Analyst
    ------------------------------



  • 4.  RE: External Contact by ANI - GET/api/v2/externalcontacts/reversewhitepageslookup

    Posted an hour ago

    Hi Nicholas,

    I hadn't realised the Search External Contact action was only available for digital channels thank you for pointing that out.

    In that case, a Data Action is the right approach. Below is something you can test with as a starting point.

    Input Contract

    {
      "type": "object",
      "properties": {
        "ani": {
          "type": "string"
        }
      },
      "required": ["ani"]
    }

    Output

    {
      "type": "object",
      "properties": {
        "contactType": {
          "type": "string"
        },
        "contactId": {
          "type": "string"
        }
      }
    }

    Request url

    GET

    /api/v2/externalcontacts/reversewhitepageslookup?phoneNumber=${input.ani}

    Response

    {
      "translationMap": {
        "contactType": "$.entities[0].type",
        "contactId": "$.entities[0].id"
      },
      "translationMapDefaults": {
        "contactType": "\"NotFound\"",
        "contactId": "\"\""
      },
      "successTemplate": "{ \"contactType\": ${contactType}, \"contactId\": ${contactId} }"
    }

    I haven't tested this exact action end-to-end, so you may need to tweak the JSON paths depending on the response you get back in your org, but this should give you a starting point.

    Then in Architect, after calling the Data Action, you can add a Decision:

    • If contactType == "Curated" , treat as success (matched external contact)
    • Else,  follow the non-match path

    Alternatively, a safer check would be:

    • !IsNotSetOrEmpty(contactId) - contact found
    • Else - not found

    Hope this helps.



    ------------------------------
    Phaneendra
    Technical Solutions Consultant
    ------------------------------