Contact list Phone number Callable using API

Hi Team,

We are trying to change our Phone status from Callable False to True, so this can be called when certain wrap up happens. Our contact list has multiple phone number such as Phone1, 2, 3, 4

Below is the API we are using

PUT /api/v2/outbound/contactlists/:contactListId/contacts/:contactId

With the help of below payload we can able to change the status between true to false vice versa-

But the issue is when we implement this into the data action, the Input contracts does not supporting nested object because we have callable value under phoneNumberStatus >> Phone 1.

Also tried multiple ways on the Request body template in the data action configuration, nothing was helpful

have any one tried this? any help would be appreciated.

The ask is to change the Phone callable status to True on certain wrap up conditions. Not all phones will be either True or False it may have to get changed based on a wrap up occurs.

{
    "callable": true,
  "phoneNumberStatus": {
    "Phone1": {
      "callable": true
    },
"Phone2": {
      "callable": true
    },
"Phone3": {
      "callable": true
    },
"Phone4": {
      "callable": false
    }
  }
}

Here is the response -

{
    "id": "d17d732c25c8dfa833cf191b18790531",
    "contactListId": "b4a2dcd0-4c05-4107-ab8a-79615b84984b",
    "data": {
        "Name": "abc",
        "Phone1": "5142313243",
        "Phone2": "5142313242",
        "Phone3": "5142313244",
        "Phone4": "5142313245"
    },
    "callRecords": {
        "Phone1": {
            "lastAttempt": "2025-02-12T16:50:56.919Z",
            "lastResult": "2d7b4b23-e43e-4b6e-87d7-c520a56b29b2"
        },
        "Phone3": {
            "lastAttempt": "2025-02-12T16:51:01.674Z",
            "lastResult": "ININ-OUTBOUND-NUMBER_COULD_NOT_BE_DIALED"
        },
        "Phone2": {
            "lastAttempt": "2025-02-12T16:50:58.925Z",
            "lastResult": "ININ-OUTBOUND-NUMBER_COULD_NOT_BE_DIALED"
        },
        "Phone4": {
            "lastAttempt": "2025-02-12T16:51:00.091Z",
            "lastResult": "ININ-OUTBOUND-NUMBER_COULD_NOT_BE_DIALED"
        }
    },
    "callable": true,
    "phoneNumberStatus": {
        "Phone1": {
            "callable": true
        },
        "Phone3": {
            "callable": true
        },
        "Phone2": {
            "callable": true
        },
        "Phone4": {
            "callable": false
        }
    },
    "contactableStatus": {
        "Email": {
            "contactable": true
        }
    },
    "dateCreated": "2025-02-12T16:43:49.419Z",
    "selfUri": "/api/v2/outbound/contactlists/b4a2dcd0-4c05-4107-ab8a-79615b84984e/contacts/d17d732c25c8dfa833cf191b18790531"
}

Data Actions Platform API

Are the phone names always Phone1, Phone2, Phone3, and Phone4, or was that just an example?

Will you always be setting values for all of the phones?

Depending on what exactly you need send will alter the solution, but no matter what I would expect that you would be using the velocity #if( $variable_name) capability to implement it.

Another option is if you already have the request you want to send created in architect, you could escape the json, pass it to the data action as a string, then unescape it in the request template.

--Jason

Hi @Jason_Mathison

Thanks for the quick response, we do have 4 phone numbers such as phone 1, 2, 3, 4.
And we will not change the callable boolean to True for all numbers.. Based on the interaction for specific number we will have a wrap up condition and change the callable condition only to that number.

Solution from Architect - yes right not i ran a data action to get the contact list information using GET. This will get executed after the dialer call compeltes. this means i will have the information and at this point i know which phone number to get reflected as Callable as TRUE using above PUT API. But the problem im facing is how do we dynamically configure the input parameters and Request Body Template.Please advise

To me it seems like the easiest solution would be to configure the data action to have inputs for contactListId, contactId, and 4 booleans for the callable status for each phone.

Then in your request template you would have something like

{
    "callable": true,
  "phoneNumberStatus": {
    "Phone1": {
      "callable": ${input.phone1}
    },
"Phone2": {
      "callable": ${input.phone2}
    },
"Phone3": {
      "callable": ${input.phone3}
    },
"Phone4": {
      "callable": ${input.phone4}
    }
  }
}

Hi @Jason_Mathison ,

I tried the above parameters on the request body template. But under input contracts unable to add callable for each phone entries such as Phone1, 2, 3, 4.

the callable i'm adding represents the callable at the very first line in the above code not the under phonenumberstatus. Please find the screenshot-

Do you have this working in the API explorer so you can verify that you know what the request should look like, and that it works the way you expect?

What is the error or behavior now?

Im made sure i have a column called "Name, Phone1, Phone2, Phone3, Phone4", however getting below error as follows -

Request body from Insomnia/postman -
{
"Name": "Abc",
"contactListId": "b4a2dcd0-4c05-4107-ab8a-79615b84984e",
"data": {
"Phone1": "${input.Phone1}",
"Phone2": "${input.Phone2}",
"Phone3": "${input.Phone3}",
"Phone4": "${input.Phone4}"
},
"callable": true,
"phoneNumberStatus": {
"Phone1": {
"callable": "false"
},
"Phone2": {
"callable": "false"
},
"Phone3": {
"callable": "false"
},
"Phone4": {
"callable": "false"
}
}
}

==

Response error
{
"message": "An attempt was made to update a Contact in an invalid way. Details: Contact d17d732c25c8dfa833cf191b18790531 is missing the following columns: [Name]. ",
"code": "contact.missing.columns",
"status": 400,
"messageWithParams": "An attempt was made to update a {entity} in an invalid way. Details: {CONTACT_MISSING_COLUMNS}",
"messageParams": {
"CONTACT_MISSING_COLUMNS": "Contact d17d732c25c8dfa833cf191b18790531 is missing the following columns: [Name]. ",
"entity": "Contact"
},
"contextId": "fff29a3e-99a2-438d-838b-b5b34dfbd95c",
"details": [],
"errors": []
}

==

I would suggest opening up a support ticket for this, as this is really a question about the contact list API, not data actions.

Hi @Jason_Mathison - the inputs you provided above worked. i tried it last week no case needed.

Thank you so much for the help!!

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.