Android Question Send sms with api

RUNO

Active Member
Licensed User
Longtime User
How I use this link for send sms
hisms.ws/api.php?send_sms&username=xx&password=xx&numbers=xx&sender=xx&message=xx&date=2009-5-24&time=11:33
I tried but result 404
 

DonManfred

Expert
Licensed User
Longtime User
okhttputils2

I tried but result 404
Where is the code? Where is the full error?

Something like

B4X:
dim j as httpjob
j.initialize("",me)
j.download2("http://hisms.ws/api.php",array as String("username","xx","password","xx"."numbers","xx","sender","xx","date","2009-5-24", "time","11:33"))
 
Last edited:
Upvote 0

RUNO

Active Member
Licensed User
Longtime User

What about ( send_sms or get_balance ) in a link
 
Upvote 0

RUNO

Active Member
Licensed User
Longtime User
In (Postman program ), I wrote
(https://www.hisms.ws/api.php?get_balance&username=xx&password=xx) give me result but in code (404)

In code
B4X:
job1.Download("https://www.hisms.ws/api.php?get_balance"&"username="&us&"password="&pw)

job1.Download("https://www.hisms.ws/api.php?get_balance="&"username="&us&"password="&pw)
job1.Download("https://www.hisms.ws/api.php?"&"get_balance="&"username="&us&"password="&pw)

All these are attempts
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
1. Postman ist not relevant to b4x to 100%
2. if i call this url in a browser i get a result! The Result is "1"
3. It will also work with okhttputils2
B4X:
    Dim j As HttpJob
    j.initialize("",Me)
    j.download2("http://hisms.ws/api.php",Array As String("username","xx","password","xx","numbers","xx","sender","xx","date","2009-5-24", "time","11:33"))
    Wait For (j) JobDone(job As HttpJob)
    If job.Success Then
        Dim res As String = job.GetString
        Log("Result = "&res)
    Else
        Log(job.ErrorMessage)
    End If
    job.Release
Result = 1
 
Upvote 0

RUNO

Active Member
Licensed User
Longtime User
Last edited:
Upvote 0

amorosik

Expert
Licensed User

First thing to understand is if the command works
To do this you should try typing a command line in the address bar of a web browser, such as Firefox, Opera, Chrome, etc.
If the browser works correctly then continue with the attempts from the B4X code
I'll give you an example, I was using a similar system on a Teltonika router to send sms from pc, and the code always returned an error, so I tried with a commercial browser and that also returned an error, in my case it was the router that did not accept the + as an international prefix symbol, he wanted a %2B
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…