vgsmail - a QX Telecom Ltd service Forum Index vgsmail - a QX Telecom Ltd service

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

http-to-SMS API specs
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    vgsmail - a QX Telecom Ltd service Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
geoff
Site Admin


Joined: 28 May 2004
Posts: 686

PostPosted: Sat May 29, 2004 12:31 pm    Post subject: http-to-SMS API specs Reply with quote

The sms interface has the URL http://www.vgsmail.com/cgi/sendsms.cgi and requires the following parameters (either as GET or POST methods):

userid ---- Your vgsmail userid
password ---- Your vgsmail password
to ---- The destination number
from ---- The originator ID of the message (must be enabled on your account)
text ---- The text you wish to send

So, as an example using the GET method, the following might work

http://www.vgsmail.com/cgi/sendsms.cgi?userid=MYUSERID&password=MYPASSWORD&to=447890123456&text=this+is+a+test

Note that the ‘to’ field can take the destination number in a number of formats:

- Full internation format with spaces, hypens and with or without the leading +:

o 447890123456
o +44 7890-123-456
o +44 (0)7890-123-456
o ...

- National format (this assumes that your registered mobile number is, for example, in the UK:

o 0789012345
o 07890-123-456
o ...

The response you get back will be a single line http page starting with 0 (for failed) or 1 (for success) followed by a text string. Examples:

- 0 Incorrect password
- 0 Destination number invalid
- 1 ok

There is an interface to send MMS messages, but it's still in 'beta' testing and so I don't make any guarantees. In particular, it might not work reliably to destinations outside the UK. To send binary message, simply send use the same parameters, but submit it to the URL http://www.vgsmail.com/cgi/sendbinsms.cgi . The text is in hex format, so an example would be something like

http://www.vgsmail.com/cgi/sendsms.cgi?userid=MYUSERID&password=MYPASSWORD&to=447890123456&text= 0605040B8423F0DC0601AE02056A0045C60C033139322e3136382e302e312f626c616800010370757368000101
Back to top
View user's profile Send private message Send e-mail
mwright



Joined: 28 May 2004
Posts: 109

PostPosted: Sat May 29, 2004 12:56 pm    Post subject: Reply with quote

Just a small point. In the example for binary sms, it should read sendbinsms and not sendsms.

Posted from a mobile
_________________
Just a thought!
Back to top
View user's profile Send private message
steeev



Joined: 23 Jun 2004
Posts: 21

PostPosted: Wed Jun 23, 2004 6:09 pm    Post subject: Reply with quote

this thread should be another one for the faq perhaps?

hi by the way, im the writer of the genietexter script for vgsmail, thanks for mentioning gt on your site and in your newsletter! Smile

Im curious if you have a function for checking the users balance via this API?
_________________
Steeev's Blog: Excellatronic Communications
Back to top
View user's profile Send private message
geoff
Site Admin


Joined: 28 May 2004
Posts: 686

PostPosted: Thu Jun 24, 2004 8:52 am    Post subject: Reply with quote

steeev wrote:

Im curious if you have a function for checking the users balance via this API?


There wasn't, but there is now...

http://www.vgsmail.com/cgi/balance.cgi

with parameters userid and password. You'll get back a single line beginning with 1 (success) or 0 (error). If there is an error, the rest of the line gives a text string describing the error. If there is success, the rest of the line gives the balance.
Back to top
View user's profile Send private message Send e-mail
steeev



Joined: 23 Jun 2004
Posts: 21

PostPosted: Thu Jun 24, 2004 12:32 pm    Post subject: Reply with quote

cool! cheers Smile
_________________
Steeev's Blog: Excellatronic Communications
Back to top
View user's profile Send private message
geoff
Site Admin


Joined: 28 May 2004
Posts: 686

PostPosted: Thu Jun 24, 2004 12:39 pm    Post subject: Reply with quote

Just so that I can maintain a log of where messages are coming from, can you add a parameter client=genietexter parameter to any sendsms.cgi requests you make? That way I can direct new features more intelligently...

And anyone else using the sendsms.cgi API for anything other than personal use, I'd appreciate it if you could do similarly (replacing the genietexter with something relevant of your choice).

Geoff.
Back to top
View user's profile Send private message Send e-mail
steeev



Joined: 23 Jun 2004
Posts: 21

PostPosted: Thu Jun 24, 2004 12:40 pm    Post subject: Reply with quote

no problemo, will put it in the next release
_________________
Steeev's Blog: Excellatronic Communications
Back to top
View user's profile Send private message
steeev



Joined: 23 Jun 2004
Posts: 21

PostPosted: Thu Jun 24, 2004 4:32 pm    Post subject: Reply with quote

hmmm having a little problem with the API

for a succsesful message it returns a 1 followed by a string

but in GT if i search for a 1 in the returned HTML to signify success, i will get false success results because 1 features in the HTTP headers that are returned eg

Received
HTTP/1.1 200 OK
Date: Thu, 24 Jun 2004 16:21:29 GMT
Server: Apache/2.0.48 (Gentoo/Linux) DAV/2 PHP/4.3.4
Content-Type: text/html; charset=ISO-8859-1
Connection: close


Hmmm...
_________________
Steeev's Blog: Excellatronic Communications
Back to top
View user's profile Send private message
geoff
Site Admin


Joined: 28 May 2004
Posts: 686

PostPosted: Thu Jun 24, 2004 4:46 pm    Post subject: Reply with quote

steeev wrote:

but in GT if i search for a 1 in the returned HTML to signify success, i will get false success results because 1 features in the HTTP headers that are returned eg


Could you search for "<newline>1<whitespace>"?

Afraid I know nothing about the scripting GT supports...
Back to top
View user's profile Send private message Send e-mail
steeev



Joined: 23 Jun 2004
Posts: 21

PostPosted: Thu Jun 24, 2004 5:08 pm    Post subject: Reply with quote

unfortunately GT strips out all newlines
and the scripting only supports basic string matching
_________________
Steeev's Blog: Excellatronic Communications
Back to top
View user's profile Send private message
steeev



Joined: 23 Jun 2004
Posts: 21

PostPosted: Thu Jun 24, 2004 11:37 pm    Post subject: Reply with quote

aha ive figured out how to check whether the message was sent ok,
i just search for "1 ok"

but the balance function doesnt return "1 ok" it just returns 1 and the balance.

if you could you add ok into the success return string of the balance function, that would be cool, and would solve the problem Smile
_________________
Steeev's Blog: Excellatronic Communications
Back to top
View user's profile Send private message
steeev



Joined: 23 Jun 2004
Posts: 21

PostPosted: Fri Jun 25, 2004 10:54 am    Post subject: Reply with quote

ive done a workaround for the balance function, though it doesnt work if you are using proxomitron, the web filtering proxy, as that inserts some javascript code into the returned html, which screws up my script.
if you could alter the balance function to return "1 ok" the same as the sendsms function, then i could get the script to work whether they are using proxomitron or not,.

you can download the new vgsmail script called vgsmail-API via the genietexter service manager. This script works much faster than the old one as it doesnt have to read in so much html. It doesnt have any of the "extra functions" that the old script has got though.
_________________
Steeev's Blog: Excellatronic Communications
Back to top
View user's profile Send private message
geoff
Site Admin


Joined: 28 May 2004
Posts: 686

PostPosted: Fri Jun 25, 2004 11:51 am    Post subject: Reply with quote

I'm slightly worried about this implementation, as it slightly goes against the 'protocol' I had defined, which simply says that the first character defines success or failure and the rest of the line should be allowed to change. So the '1 ok' line could quite ligitimately change to '1 hello', and your script should be able to deal with it. It seems that GT scripting is a bit limited.

I've changed the balance script, although again ... not nice.
Back to top
View user's profile Send private message Send e-mail
steeev



Joined: 23 Jun 2004
Posts: 21

PostPosted: Fri Jun 25, 2004 12:25 pm    Post subject: Reply with quote

no need to worry, if the success string changes from ok to hello, i just have to change the script and bingo problem sorted Smile

thanks for changing it, though if you are really worried about it you can change it back to how it was before, im sure there arent that many users usign proxomitron anyway Smile
_________________
Steeev's Blog: Excellatronic Communications
Back to top
View user's profile Send private message
geoff
Site Admin


Joined: 28 May 2004
Posts: 686

PostPosted: Fri Jun 25, 2004 9:27 pm    Post subject: Reply with quote

A new parameter has been added:


time ---- Time to schedule sending of message (default: now)

Examples:
now, now+2 hours
tomorrow
+2 days/hours/minutes
10:30
4/25/2004 10:30
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    vgsmail - a QX Telecom Ltd service Forum Index -> General Discussions All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group