QR-code and Barcode Scanner

FREEMIUM
Verified
Door PresentID | Bijgewerkt 5 days ago | Artificial Intelligence/Machine Learning
Populariteit

0.1 / 10

Latency

29ms

Serviceniveau

0%

Health Check

N/A

Terug naar alle discussies

getting error: "Invalid Mashape Key" when using mashape with site2sms in php.

Rapid account: P Chavhan
p.chavhan
7 years ago

My code is this:

<pre><?php

require_once ‘vendor/autoload.php’;
require_once ‘vendor/mashape/unirest-php/src/Unirest.php’;

uid="useridofsite2sms";uid="user id of site2sms"; phone=“phone number”;
msg="message";msg="message"; pwd=“password of site2sms”;

// These code snippets use an open-source library. http://unirest.io/php
Unirest\Request::verifyPeer(false);
response=Unirest\Request::get("https://site2sms.p.mashape.com/index.php?msg=response = Unirest\Request::get( "https://site2sms.p.mashape.com/index.php?msg=msg&phone=phone&pwd=pwd&uid=$uid",
array(
“Authorization” => “Basic ODgxNzM4ODE5NjpwcmF2ZWVuMjIwMA==”,
“X-Mashape-Key” => “my mashape key”,
“Accept” => “text/plain”
)
);

print_r($response);
?></pre>

When I am running this code I am getting following error:

<pre>Unirest\Response Object
(
[code] => 403
[raw_body] => {“message”:“Invalid Mashape Key”}
[body] => stdClass Object
(
[message] => Invalid Mashape Key
)

[headers] => Array
    (
        [0] => HTTP/1.1 403 Forbidden
        [Content-Type] => application/json
        [Date] => Sat, 25 Feb 2017 19:49:13 GMT
        [Server] => Mashape/5.0.6
        [X-Mashape-Proxy-Response] => true
        [Content-Length] => 33
        [Connection] => keep-alive
    )

)</pre>

I tried to find solution for this in PHP but didn’t get any solution. Please provide solution for this issue asap.

Thanks in advance…

Doe mee aan de discussie - voeg hieronder een opmerking toe

Log in / Schrij u in om nieuwe opmerkingen te plaatsen