http request for an SMS API |
[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.
[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
[eluser]TornUp[/eluser]
perfect! ![]() 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!
[eluser]mjsilva[/eluser]
Yes, in $response you should get the response of your request and then you can validate it.
[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 |
Welcome Guest, Not a member yet? Register Sign In |