help with formatting the message text (http send api)

Home Forums iSMS help with formatting the message text (http send api)

Tagged: , ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2727
    Kamran Rana
    Participant

    hi

    I have a number of database fields that contain text that will be used to build up the message text before being sent.

    eg.

    data1:=’hello’

    data2:=’are’

    data3:=’you’

    data3:=’there’

    sms_text=data1+data2+data3+data4

    and used with a get url command

    eg. ‘http://192………..+’&text=’+sms_text;

    the above does not work ? it only works with data1 on its own but when i try to add more eg data2+data3+data4 it does not work.

    There is clearly a formatting issue of some sort?

    The API is not interpreting the joined data ?

    Thanks

    Kamran

    #3830
    Darrik Spaude
    Keymaster

    Kamran,

    What is the actual URL that is being sent to the iSMS?

    #3831
    Kamran Rana
    Participant

    Hi Darrik

    urlstring:=’http://192.168.2.1:81/sendmsg?user=admin&passwd=admin&cat=1&enc=0&priority=2&to=’+mobilenumber+’&text=’+sms_text;

    where mobilenumber:='”07516171888″‘;

    data1:=fieldofchar1;

    data2:=fieldofchar2;

    where sms_text:=data1+data2;

    from what i can work out when composing the full message it falls over when it comes across any spaces

    if data1:= ‘abcde’ and data2:=’it a fine day’

    where sms_text:=data1+data2 — falls over

    where sms_text:=data1 works ok

    thanks

    kamran

    #3832
    Darrik Spaude
    Keymaster

    I’d still like to see the actual string that is received by the iSMS. In the world of URLs, a plus (+) is used in place of a space. I’m assuming you need to encode your message before sending it to the iSMS, but it would be nice to know what the iSMS is actually receiving because then we could determine why it falls over.

    See section 2.2 of RFC 1738:

    http://www.ietf.org/rfc/rfc1738.txt

    This may also be of use:

    http://www.w3schools.com/tags/ref_urlencode.asp

    #3833
    Kamran Rana
    Participant

    Hi Darrik

    thanks your links help to solve my problem

    I just added %20 to each word token where a space was needed before composing the sms message

    best regards

    kamran

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.