Change to API for handling payloads to that email/phone on a Person?

Previously (past couple months), I’ve been able to update a Person’s email/phone through the REST API by sending a payload like:

{
  "email": "test@test.com",
  "phone": "123"
}

But today I started getting reports from folks in my company that were experiencing an issue with updating emails/phones on people (using this integration I’ve made).

Now I’ve found I have to send the same data like:

{
  "email": [
    {
      "value": "test@test.com",
      "primary": true
    }
  ],
  "phone": [
    {
      "value": "123",
      "primary": true
    }
  ]
}

Just thought I’d share in case anyone else experienced the same issue/change.

I do see that the documentation points out that an array is expected for those fields (without specifying the form for the items in the array), but it would’ve been nice if there was an announcement if a change to the API was made that affected this.

2 Likes

Not working for us. On top of that, while making the update api call for the person, it is removing the contact details.

We are experiencing the same issue and cannot find anything on the changelog??

I can confirm that we have the same issue. Everything worked until YESTERDAY. Emails of persons that we update ALWAYS gets cleared completely, no matter if we use

‘email’ => ‘x@x.de’, ‘email’ => [‘x@x.de’], ‘emails’ => [‘x@x.de’], or ‘primary_email’ => ‘x@x.de’.

Seems to be a (quite critical?) bug that has been introduced in the API since yesterday.

Since yesterday 2PM, you have to send value, primary and label in order for phone to be set.

persons()->update(USER_ID, [
            'phone' => [[
                'value' => '01234567890',
                'label' => 'work',
                'primary' => true
            ]]
        ]);

EDIT: Issue raised to customer support.

Thanks a lot, @mediatoolkit. Your solution works.

Hello :wave:

Thank you all for notifying about this! We are looking into this and will keep you posted.

Hello

It was indeed a mistake from our side, which has now been fixed. We apologize for the inconvenience this has caused!

Updating a person’s email and/or phone data works in both ways:

{
  "email": "test@test.com",
  "phone": "123"
}

or

{
  "email": [
    {
      "value": "test@test.com"
    }
  ],
  "phone": [
    {
      "value": "123"
    }
  ]
}

We have included this info to our API documentation for POST /persons and PUT /persons/{id}.