Jump to content

Recommended Posts

What is the API protocol?

Is it an HTTP based REST API?

 

You should be able to use message composer, and also the buffer tools in order to compose a message that can be sent through a socket.

I've done this with Vision in the past using FB Protocol, or with a simple TCP RAW send. (I've created an API on microsoft Azure, and the V570 sent and received data from it).

Link to comment
Share on other sites

Thank you Saragani,

I am not sure what is the API protocol. Can you figure it out from the attached instructions file? www.sms4free.co.il_api_sms-.pdf

This I got  from a free trial that anybody can have for testing.

In this case i am using V570, but i'm interesting for Unistream as well . is it possible to get any example?

Ofer

Link to comment
Share on other sites

Yes, it is HTTP (using Post), but I'm not sure how the data is structured.

In APIs, data can be sent as JSON, and XML. If you know HTML,  then you can create a small Form with all the inputs of the parameters you need to enter, and have a button send the inputs using POST.

If it works (and the SMS is sent), then you can use WireShark or Fiddler in order to sniff (capture) the TCP packets sent by your browser.

You can then simulate the request on the PLC.

  • Upvote 1
Link to comment
Share on other sites

I don't know HTML but I will get some help and try.

This is an example I received from the provider support for a sting structure to send using POST protocol:

key=yourapikey&user=050123456789&pass=88665599&sender=0501234567&recipient=0501234563;0501234563;0501234562&msg=Hello world

The string should be sent to a URL address. Is it possible to send it to a URL or I must obtain the IP address?

Ofer

Link to comment
Share on other sites

You should compose a message with the following form:

POST http://www.sms4free.co.il/api/sendsms.aspx HTTP/1.1
User-Agent: UniLogic
Host: www.sms4free.co.il
Content-Length: 121

key=12345678&user=050123456789&pass=88665599&sender=0501234567&recipient=0501234563;0501234563;0501234562&msg=Hello world

 

 

I assumed that the key is 12345678, but use whatever you want. The User-Agent is not important (so you can put UniLogic, Visilogic, or whatever).

The Content-Length is the length of the data that you send.

If you compose the data first, then you can calculate it's length (And you can use Message Composer with Raw Data message parts linked to ASCII, or with  Numeric parts for the phone number, key, password etc,

Then I would compose a different message that creates the request that just uses the created buffer as Raw Data, and using the calculated length in the content length,

Or you can combine 2 messages using the buffer tools (For example Copy Buffer part to buffer).

 

Link to comment
Share on other sites

Thank you Guy and Saragani.

I checked with a service provider,  unfortunately it will not be possible to send API to IP address, as the message will not be directed  inside the  server. It must be send to a URL and  I think it is not possible from Vision or Unilogic . is it?

I guess GSM modem or Mail-to-SMS remain the only options left.

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.