With the script step Insert from URL you can use that url to talk to any other API out there on the Internet.
As johanhedman said in his posting you don't need to worry about CURL. With INSERT FROM URL, you can access most APIs out there. If you need even more control, you can combine INSERT FROM URL with a microservice and basically do anything.
INSERT FROM URL has been around since FMP 12. I use it extensively.
Just figure out your GET or POST (post was added in FMP 13) requests first.
HOPE THIS HELPS.
Below is the php code they give to communicate, with their system. Should I pass all the code to an $url variable and place it in the insert from url , that is what you saying ?How to pass to the code the WhatsApp number? that is stored in a field in my database.
$INSTANCE_ID = 'YOUR_INSTANCE_ID_HERE'; // TODO: Replace it with your gateway instance ID here
$CLIENT_ID = "YOUR_CLIENT_ID_HERE"; // TODO: Replace it with your Forever Green client ID here
$CLIENT_SECRET = "YOUR_CLIENT_SECRET_HERE"; // TODO: Replace it with your Forever Green client secret here
$postData = array(
'number' => '12025550108', // TODO: Specify the recipient's number here. NOT the gateway number
'message' => 'Howdy! Is this exciting?'
$headers = array(
$url = 'http://api.whatsmate.net/v2/whatsapp/single/message/' . $INSTANCE_ID;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($postData));
$response = curl_exec($ch);
echo "Response: ".$response;
1 of 1 people found this helpful
You need to use Headers in your Insert from URL, but never the whole PHP-code.
With FM16 you can use cURL and you can learn of that in FileMaker Help or read this article