Adding custom fields to contact

Ok, I’ve read almost all the threads regarding this issue but still I am unable to resolve mine.
Here is my database field name.

Booking Type List Box BookingType

And here my the API response for custom fields.

I know the id should be numeric. But on the API response I don’t see all the id value to be numeric.
Here is what I am passing to API.

stdClass Object
[content] => stdClass Object
[_BookingType] => SATURDAY 90 MINUTE CLASS

[id] => 89

It’s always failing, I don’t know If I am passing the data wrong way or what.



If your post is accurate then you are trying to pass an un-converted object (not a json string) and that won’t work.

I am using PHP SDK that is why I am sending an Object.

If I pass a json i get the following response.
Input could not be converted to a valid request

That means that the json is formatted wrong for the receiving schema. Start with the example code again. If you convert to an object, don’t change the object, just the values. Personally, I find it easier sometimes just to insert the variables in place of the values directly into json…but dealer’s choice.

Saw this post second. So you don’t send json with the sdk. That is an xml-rpc. If you want to use REST then use REST but the xml-rpc has it’s own functions with parameters as methods on the object.