Welcome Guest, Not a member yet? Register   Sign In
http request for an SMS API
#1

[eluser]TornUp[/eluser]
Hi all,

Im currently working on a user signup system for a nightclub events company, and it is required to verify their data.

this done by a simple "e-mail activation"(nothing new there!)
and
A SMS activation.

we use a company called trinitymobile.co.uk for all our SMS marketing, and they have an API for sending SMS messages.

The problem im facing, is how do i get my CI code to fire off a HTTP request to the API?

The API is as follows:

http://appserver.trinitymobile.co.uk/mes...me=usernam
e&Password=password&MSISDN=msisdn&CostCentre=costcentre&CampaignName=campaignname&Brand=br
and&Originator=originator&Channel=channel&Message=message&TrackingId=trackingId

it all looks pretty simple, and i seem to understand how to populate the bits i need with the infomation i wish to send.... i just don't know how to post it..

could somone help me with the code?

many thanks!

Tom Kirby.
#2

[eluser]mjsilva[/eluser]
Just use Curl Library http://codeigniter.com/wiki/Curl_library/ by Phil Sturgeon

And do something like this:

Code:
$url = 'http://appserver.trinitymobile.co.uk/messaginginterfaces/a.msg?Command=SendMessage&UserName=usernam
e&Password=password&MSISDN=msisdn&CostCentre=costcentre&CampaignName=campaignname&Brand=br
and&Originator=originator&Channel=channel&Message=message&TrackingId=trackingId';

$response = $this->curl->simple_get($url);
#3

[eluser]TornUp[/eluser]
perfect! Smile

thought it would be a simple task! heh

im guessing that because you have assigned "$this->curl->simple_get($url)" to $response, that the CURL library returns a response for validation?

many thanks mjsilva!
#4

[eluser]mjsilva[/eluser]
Yes, in $response you should get the response of your request and then you can validate it.
#5

[eluser]Unknown[/eluser]
hii,


This is the HTTP Request to send the message "The medium is the message" to user "12432". ... Here are the the required parameters in the HTTP POST request.



Ladies Designer Clothing




Theme © iAndrew 2016 - Forum software by © MyBB