patchUser() is not working with addresses

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

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"}

Thank you Prince !
it works now

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