Thank you Mario,
I am still new to PHP, so sorry if I ask “not so smart” questions.
Thank you for link provided. I figured out something out of it. Right now my JSON looks like this:
{
"data": [
{
"Contact": {
"email": "[email protected]",
"mobile": "+42600003456",
"main_company": "ABC a.s.",
"your-message": "test text"
},
}
]
}
But I still need to add those fields:
“overwrite”: true,
“contact_tags_overwrite”: true,
“overwrite_companies”: true,
“company_tags_overwrite”: true,
above “data” to the JSON body part.
This is my PHP function:
add_filter( 'ctz_post_request_args', 'radkosedlak_ctz_post_request_args' );
function radkosedlak_ctz_post_request_args( $args ) {
$args['method'] = 'PUT';
$args['headers']['Authorization'] = 'Token XXXX';
$body = json_decode( $args['body'] );
$body = array(
'data' => array(
array(
'Contact' => $body,
),
),
);
$args['body'] = json_encode( $body );
return $args;
}
Could you please help me out of this? I promise, that after that I’m going to give you a break ??