Closed muhammad-ihsan closed 6 years ago
Hi can you please share your code and i'll see if i can spot why its returning an error
Generate by postman
<?php
$request = new HttpRequest();
$request->setUrl('https://smsgateway.me/api/v4/message/send');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'postman-token' => '16f01a40-21ac-8e4c-660c-ed37ec04c45e',
'cache-control' => 'no-cache',
'content-type' => 'application/json',
'authorization' => 'my-key'
));
$request->setBody('[
{
"phone_number": "08962204xxxx",
"message": "Hello Worldzzzz",
"device_id": 72171
}
]');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
With shell script:
ihsan@zeus:~$ curl --request POST \
> --url https://smsgateway.me/api/v4/message/send \
> --header 'authorization: my-key' \
> --header 'cache-control: no-cache' \
> --header 'content-type: application/json' \
> --header 'postman-token: a20e0853-01ef-35c4-e4b6-3175e2c456cc' \
> --data '[\n {\n "phone_number": "08962204xxxx",\n "message": "Hello Worldzzzz",\n "device_id": 72171\n }\n]'
return
{"status":"fail","message":"Could not process request","data":{"exception":"Invalid input"}}
I have same error
Same error. Is it resolved?
@PanwarInformationTechnology @Saruul-Ulzii i dont know if this package is still maintained. I just downgrade the version of smsgateway.me client
and no longer use this package soon
I tried with postman your api is working well, but if i tried with PHP scripts return:
{"status":"fail","message":"Could not process request","data":{"exception":"Invalid input"}}