Getting the following error when trying to run the API with PHP:
Catchable fatal error: Object of class Unirest\Response could not be converted to string
Here is how I am implementing it with PHP:
include_once("…/private/unirest-php/src/Unirest.php");
$dayCostUrl = “https://farebookings-free-and-real-time-currency-conversion.p.mashape.com/devel.farebookings.com/api/curconversor/THB/USD/260/json”;
dayCostUrl,
array(
“X-Mashape-Key” => “RBaR00xcwwmsh87WFynWrdXlO9xzp10N94YjsnKVQlAYBL0WwA”,
“Accept” => “text/plain”
)
);
echo $dayCost;
Please help me solve this issue.
Regards, Chris
Partecipa alla discussione - aggiungi un commento di seguito:
Please see the following code for how to call IP2Currency. You will need to sign up for a free (or paid) license key at http://fraudlabs.com/ip2currency.aspx which you will need to insert into the code below.
$response = Unirest\Request::get(“https://fraudlabs-ip2currency-v1.p.mashape.com/ip2currencywebservice.asmx?LICENSE=<required>”,
array(
“X-Mashape-Key” => “mC3RMkoFezmshtpIjYXY7RO4kvyxp1NnIoKjsnxjR1UU2R3HHs”,
“Accept” => “application/xml”
)
);