I am having a problem connecting to one of my partners API.
I can connect to the API, via cURL inside of PHP with the following code (It will try to make the request for 30 seconds and then timeout, with the 504 Gateaway Timeout)
<?php
// get cURL resource
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, 'https://api.scanpay.dk/');
// set method
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
// return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// send the request and save response to $response
$response = curl_exec($ch);
// stop if fails
if (!$response) {
die('Error: "' . curl_error($ch) . '" - Code: ' . curl_errno($ch));
}
echo 'HTTP Status Code: ' . curl_getinfo($ch, CURLINFO_HTTP_CODE) . PHP_EOL;
echo 'Response Body: ' . $response . PHP_EOL;
// close curl resource to free up system resources
curl_close($ch);
The code should return Forbidden, because the API key i'sent provided. I have tried to make the same call just with cURL from the servers terminal, and i still gets this error
I have also tried to contact my host, but they cant help me.
Im thinking that is have somthing to do with the firewall.
Thanks for the help.