bradfeehan / desk-php

PHP client for Desk.com v2 API, based on Guzzle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

replace vs. append for phone numbers, addresses, emails

benkr94 opened this issue · comments

From the Desk API, update customers section:

*By default, passing an array to this field will append the new elements to the existing set. It can optionally be entirely replaced by setting the corresponding addresses_update_action, emails_update_action, or phone_numbers_update_action param to replace. The action may also be set to append for explicit control. An empty array with the param set to replace will clear all values for the field.

Does this project provide this functionality?

I haven't implemented this functionality as it wasn't available at the time I was creating the library. I'd welcome any pull request that adds this functionality but I don't have the time to implement it myself.

Could you good people give usage examples? should we be adding that to the rest of the data and doing like so { addresses_update_action: true} or should we are to the url as a query parameter like so:
/?addresses_update_action=true the desk documentation was vague on that.

I know this is old, but I landed here on a google search. I contacted Desk.com support and they indicated the xxx_update_action should be part of the JSON request:

"emails": [
    {
      "type": "work",
      "value": "johnny@acme.com"
    }],
"emails_update_action": "replace"