• Resolved fataloverdose

    (@fataloverdose)


    is there more documentation about using the rest api with metforms?
    any example code?

    i try to use the rest api integration to add some rules for sending an email with the form data but somehow my code seems to do nothing. when i test it with postman it seems to work just fine.

    <?php

    header(“Access-Control-Allow-Origin: *”);
    header(“Content-Type: application/json; charset=UTF-8”);

    $text = “”;

    foreach($_REQUEST as $key => $value) {
    if($value != “”) {
    $mailArr[$key] = $value;
    $text = $text . $key . “: ” .$value . “\n”;
    }
    }

    //apply the rules

    //send mail
    $empfaenger = “[email protected]”;
    $betreff = “Die Mail-Funktion”;
    $from = “From: Vorname Nachname <[email protected]>”;

    mail($empfaenger, $betreff, $text, $from);

    $json_response = json_encode($mailArr);
    echo $json_response;
    ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey @fataloverdose ,

    Currently we have only option for sending form data via POST/GET method to the API end point. Also have option to send the form data to admin/user. If you want to customize or add some custom rules to the form you have to do it on your own or hire someone who will do it for you.

    Don’t worry, we’re continuously adding new features according to our customer’s needs. So, if you want to get this feature please make a feature request here. We will try to give this feature on our future update.

    Regards,
    Benjir

    Thread Starter fataloverdose

    (@fataloverdose)

    that does not answer my question.
    my problem is, that no matter which method i use, my script/api endpoint does not seem to get any data from the form. when i use postman to send data to my script it works. i tried both methods (GET/POST) but it looks like the script does not get called at all.

    Hello @fataloverdose ,

    I have forwarded this issue to our development team and they are checking it. We will get back to you with an update as soon as we have more information about it. Till then stay with us.

    Regards,
    Benjir

    Hi fataloverdose.
    We are receiving data from the metform-form. Here you might having issue with the mail system.

    We created index file locally and sent data there using both POST and GET methods http://prntscr.com/103iucp

    Please provide us with any video of what exactly you want to do.
    Note: watch this video to learn how to create webhook properly Webhook to receive metform rest api data

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

The topic ‘REST intergation’ is closed to new replies.