jeudi 28 juin 2018

Get SMS history textlocal

I am using textlocal SMS gateway for sending SMS for my application.

Now i want history of sent SMS from account for that i am following the document of textlocal

For this i have done below code

    // Account details
    $apiKey = urlencode('Your apiKey');

    // Prepare data for POST request
    $data = array('apikey' => $apiKey);

    // Send the POST request with cURL
    $ch = curl_init('https://api.textlocal.in/get_history_api/');
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $response = curl_exec($ch);
    curl_close($ch);

    // Process your response here
    echo "<pre>"; print_r($response);

But i am getting

{"errors":[{"code":3,"message":"Invalid login details"}],"status":"failure"}

SO as per the API Documentation you should pass api key which i am sending in curl request still getting Invalid login details response.

Any help would be appreciated.

Thank you!



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2yONQoe
via IFTTT

Aucun commentaire:

Enregistrer un commentaire