Failed to parse XML-RPC request: Unknown type: nil

Trying to update the contact using official PHP SDK, but:

Failed to parse XML-RPC request: Unknown type: nil

I explicitly convert everything to string:

{“Country”:“United States”,“StreetAddress1”:“”,“StreetAddress2”:“”,“City”:“”,“State”:“”,“PostalCode”:“”}

how to debug this? what is nil in InfusionSoft’s opinion? how to update the address for the contact? just not through the REST API, because docs are awful and I don’t have days to figure it out by myself

Well that’s JSON and the xml-rpc doesn’t take JSON passed to it so start there. If you’re using the SDK then why aren’t you using the pre-made method?

https://developer.infusionsoft.com/docs/xml-rpc/#contact-update-a-contact

I didn’t think I needed to explain that part, but okay, I don’t send the json, I send the array through SDK
I added logging to see what’s causing the problem and it’s the example from the log in my app, I can’t write the array in the log, so I use json_encode first to save the example of the data I try to send using the api :slight_smile:

expanded example:

$data = [
    'StreetAddress1' => '',
    'StreetAddress2' => '',
    'City' => '',
    'PostalCode' => '',
    'State' => '',
    'Country' => 'United States'
];

$api->contacts('xml')->update($infusionsoft_id, $data);

and API answers with:

Failed to parse XML-RPC request: Unknown type: nil

What is the value of $infusionsoft_id?

can’t find this job in database anymore, I guess it was synced eventually
but I have if ($infusionsoft_id) in my code, so the job shouldn’t be dispatched if there is no $infusionsoft_id

I’ll keep an eye on it,
but anyway, more informative answers from API would’ve been great