Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter radkosedlak

    (@radkosedlak)

    That’s it. Thank you! <3

    Thread Starter radkosedlak

    (@radkosedlak)

    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 ??

    Forum: Plugins
    In reply to: [CF7 to Webhook] PUT method
    Thread Starter radkosedlak

    (@radkosedlak)

    Wow, that was quick. Thank you, Mario!

Viewing 3 replies - 1 through 3 (of 3 total)