dcsimg
Results 1 to 8 of 8

Thread: API SMS help

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2018
    Posts
    4

    API SMS help

    i looking for code to send SMS
    i have API Parameter from provider
    it is :
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    URL: https://smsmisr.com/api/webapi/?

    Username=*****
    password=******
    language= 1: For English 2: For Arabic 3: For Unicode
    sender= Your Registered And Activated SenderID
    Mobile= 2011XXXXXX,2012XXXXX,2010XXXXX,
    message= this method is triggered when a chip is selected.
    DelayUntil= For scheduling Format: yyyy-mm-dd-HH-mm Ex. 2017-09-13-13-30


    check Post Method: https://smsmisr.com/api/webapi/?user...XXXXXX,2012XXX XXXX,&message=XXX&DelayUntil=2017-09-13-13-30

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    thanks

  2. #2

    Thread Starter
    New Member
    Join Date
    Nov 2018
    Posts
    4

    Re: API SMS help

    ???????????

    Any help

  3. #3
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    3,244

    Re: API SMS help

    Help with what?

    We will try to help you if you can state what is not working.
    Provide the source code of the routine you are using and indicate what part you have a problem with.

    What we don't do is write pieces of code based on fragments of information.

  4. #4
    Lively Member
    Join Date
    Jun 2018
    Posts
    105

    Re: API SMS help

    There are many ways to do this using the methods such as Winsock, WinHTTPRequest, XMLHTTPRequest, ect. You should research on how to make a POST request with parameters to a URL using those methods. I think XMLHTTPRequest with XMLHTTP object is much easier.
    Last edited by PGBSoft; Nov 9th, 2018 at 12:02 PM.

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2018
    Posts
    4

    Re: API SMS help

    i try this code :

    On Error GoTo Handler
    Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
    URl = "https://smsmisr.com/api/webapi/?"
    objHTTP.Open "POST", URl, False
    objHTTP.SetRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
    objHTTP.SetRequestHeader "Content-type", "application/x-www-form-urlencoded"
    objHTTP.send "username=" + txtUser.Text + "&password=" + txtPass.Text + "&sender=" + Text1.Text + "&mobile=" + txtMobile.Text + "&message=" + txtMessage.Text




    MsgBox objHTTP.ResponseText
    Set objHTTP = Nothing
    Exit Sub


    Handler:
    MsgBox Err.Description

    >>>>>>>>>>>>>>>>
    any error at this code ????

  6. #6
    PowerPoster
    Join Date
    Dec 2004
    Posts
    23,870

    Re: API SMS help

    any error at this code ????
    does it work? do you get error message? does it fail? does the recipient get the message?
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  7. #7

    Thread Starter
    New Member
    Join Date
    Nov 2018
    Posts
    4

    Re: API SMS help

    Get one result that the mobile number is null

  8. #8
    PowerPoster
    Join Date
    Dec 2004
    Posts
    23,870

    Re: API SMS help

    do you check the exact content of the textbox when the error occurs
    do a count of characters (len(txtmobile)) to match the visual length of the mobile number
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width