There are functions in our wrapper library classes that convert your contact object to the formatted XML and submit that as the body of the requests made to our API. the makeRequest function in the CTCTRequest class (Authentication.php file of the wrapper library), is the function that makes the HTTP request via cURL to our API, so you can add code to this function to capture the contents of the $body variable, which should include the formatted XML that is being submitted with your request.
I hope this helps. One you have the XML, we can offer some additional advice or assistance in troubleshooting, if needed.
The first step I would take from your side is to use that XML to create a manual API request using RESTClient. This helpful utility allows you to set up and manually make HTTP requests to REST API services like ours, and it will provide the HTTP status response, and any error message contained in the response body. Wrapper libraries may not pass the response body along to you, and it often contains a more precise message that identified the source of 400 errors.
... View more