-2

I am using webaroo api for sending message, I am new in this field, please guide me how to use this api to send message. Here is the api :-

<?php

$method = 'gupshup.getPublicStream';                     
$from = '9749633368';
$to = '9749633368';
$skipadult=true;


$url = "http://api.smsgupshup.com/GupshupAPI/rest?skipadult=$skipadult&from=$from
&range=$to&method=$method&v=1.0&format=xml";


$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$curl_scraped_page = curl_exec($ch);
curl_close($ch);

echo $curl_scraped_page;
?>
avinashse
  • 1,440
  • 4
  • 30
  • 55
  • This is not the way stackoverflow works. We're here to help you when you run in to problems / errors, not to write tutorials. Please read the FAQ: http://stackoverflow.com/faq/ – Robert Jul 02 '12 at 07:27
  • I am using that code to send message but `its showing 109The parameter "v" is required. Please resend request. error`, how to remove that error , I am using v=1.0..dont know about it. – avinashse Jul 02 '12 at 07:44

2 Answers2

0

i think you are trying to access "HTTP" url, simply use file_get_contents method

Sathishkumar
  • 3,394
  • 4
  • 20
  • 23
  • http://stackoverflow.com/questions/555523/file-get-contents-vs-curl-what-has-better-performance That is why I am using curl.. – avinashse Jul 02 '12 at 07:36
0

Codeigniter is already have CURL library

Example :

$this->load->library('curl');
echo $this->curl->simple_get('http://api.smsgupshup.com/GupshupAPI/rest?skipadult=$skipadult&from=$from&range=$to&method=$method&v=1.0&format=xml');

see this : http://codeigniter.com/wiki/Curl_library/

Sathishkumar
  • 3,394
  • 4
  • 20
  • 23
  • Thanks for the reply,now its working perefctly,Can you tell me how can I change the senders id, now what actually happening is that when I am sending message , in my mobile its comes like TD-2342 instead I want users number to be there, how this can be achieved. I am using `"http://enterprise.smsgupshup.com/GatewayAPI/rest?method=SendMessage&send_to=$to&msg=Welcome%20to%20SMS%20GupShup%20API&msg_type=TEXT&userid=$userid&auth_scheme=plain&password=$password&v=1.1&format=text";` as my url – avinashse Jul 02 '12 at 08:03
  • New TRAI Policy from Feb 1 2012, there will only be 2 categories of messages- Transactional (Bank alerts, Railway & Airline alerts, Messages to parents from school etc) and Non transactional or Promotional (all remaining categories). Only transactional messages will have full branded sender id (like TA-HDFCBANK) for others, there will be a digit code (like TA-n12345 or TA-nABCDE) for more info contact your sms service provider. – Sathishkumar Jul 02 '12 at 08:39