POSTing cURL Zapier Webhook

Ich versuche, die POST mit cURL auf einen Zapier webhook.

Zapier ist so konfiguriert, dass wenn ich geben Sie Ihre URL wie so --
https://zapier.com/hooks/catch/n/[email protected]&guid=foobar

Erhalten Sie die post, aber wenn ich versuche, das gleiche zu tun, mit cURL, es nicht scheinen, es zu erhalten.

Hier ist mein code für die Buchung mit cURL -->

<?php
    //Initialize curl
    $curl = curl_init();

    //Configure curl options
    $opts = array(
        CURLOPT_URL             => 'https://zapier.com/hooks/catch/n/abcd',
        CURLOPT_RETURNTRANSFER  => true,
        CURLOPT_CUSTOMREQUEST   => 'POST',
        CURLOPT_POST            => 1,
        CURLOPT_POSTFIELDS      => 'guid='+ $_POST["guid"] + '&video_title=' + $_POST["video_title"] + '&email=' + $_POST["email"], 
    );

    //Set curl options
    curl_setopt_array($curl, $opts);

    //Get the results
    $result = curl_exec($curl);

    //Close resource
    curl_close($curl);

    echo $result;
?>

Wenn ich diesen starte, es zeigt Erfolg, aber Zapier nicht erhalten es.

Auf Zapier ist docs, hat jemand ein Beispiel mit einer richtigen cURL post, wie so -->

curl -v -H "Accept: application/json" \
        -H "Content-type: application/json" \
        -X POST \
        -d '{"first_name":"Bryan","last_name":"Helmig","age":27}' \
        https://zapier.com/hooks/catch/n/Lx2RH/

Ich vermute, dass ich etwas fehlt in der PHP-Datei, Hilfe sehr dankbar!

Schreibe einen Kommentar