Legacy Dev Forum Posts

 View Only

Sign Up

patchUser() is not working with addresses

  • 1.  patchUser() is not working with addresses

    Posted 06-05-2025 18:02

    raltaie | 2018-10-12 00:52:44 UTC | #1

    ar body = {

    "addresses": [ {"display": "(7123)", "mediaType": "PHONE", "type": "WORK"}], "title": "New title", "version": 26

    };

    var apiInstance = new platformClient.UsersApi();

    var userId = "userId"; // String | User ID

    // Object | User

    apiInstance.patchUser(userId, body) .then(function(data) { console.log(patchUser success! data: ${JSON.stringify(data, null, 2)}); }) .catch(function(err) { console.log('There was a failure calling patchUser'); console.error(err); });

    i am using the code above and once i add address to address i get this error

    "{"status":400,"code":"bad.request","message":"The requested operation failed with status 400","contextId":"a4e9f292-efe8-4085-bb31-3a08c6c9c33b","details":[],"errors":[]}"

    if i make "addresses" :[], that will work and will clear all address but it won't work when i pass address to it all other fields seems to be working with no issues

    Note i got same issue with python SDK as well


    anon28885283 | 2018-10-12 04:34:23 UTC | #2

    Hi, objects in the addresses should also contain the extension/DID value.

    7123 seems like an extension so your addresses should be:

    "addresses": [ {"display": "7123", "mediaType": "PHONE", "type": "WORK", extension: "7123"}]

    NOTE: Make sure that the extension is already declared in an extension pool.

    For DIDs use 'address' instead of 'extension':

    {address: "+13175550000", display: "+1 317-555-0000", mediaType: "PHONE", type: "WORK"}


    raltaie | 2018-10-12 22:53:52 UTC | #3

    Thank you Prince ! it works now


    system | 2018-11-12 22:53:53 UTC | #4

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