ofer.yishai Posted February 16, 2017 Report Share Posted February 16, 2017 Hi everybody, While looking for a MAIL-to-SMS service providers, one told me that their service supports API (Application programming interface) that runs more efficiently than emails. I wonder, would it possible to send API commands from Vision or Unistream PLC? Thanks Link to comment Share on other sites More sharing options...
Saragani Posted February 16, 2017 Report Share Posted February 16, 2017 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 More sharing options...
ofer.yishai Posted February 17, 2017 Author Report Share Posted February 17, 2017 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 More sharing options...
Saragani Posted February 17, 2017 Report Share Posted February 17, 2017 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. 1 Link to comment Share on other sites More sharing options...
ofer.yishai Posted February 21, 2017 Author Report Share Posted February 21, 2017 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 More sharing options...
Guy Sela Posted February 21, 2017 Report Share Posted February 21, 2017 In vision, there is a ladder element that resolves an IP for a domain. In UniLogic there is also an element that resolves the IP Address (element called Resolve DNS). As I understand, the data is not JSON or XML, but rather the same old way as sending the data in the url. Link to comment Share on other sites More sharing options...
Saragani Posted February 21, 2017 Report Share Posted February 21, 2017 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 More sharing options...
ofer.yishai Posted February 23, 2017 Author Report Share Posted February 23, 2017 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 More sharing options...
MsgClub Posted July 20, 2018 Report Share Posted July 20, 2018 Hello, ofer.yishai A Big question that arise after read your post that which API should be used for send sms . if you want to send sms on more then 100 number in single request then you have to to use POST API else GET API. Link to comment Share on other sites More sharing options...
Saragani Posted July 22, 2018 Report Share Posted July 22, 2018 @MsgClub, I smell SPAM. If you'll continue posting your website in this forum, then I will block you and delete your posts. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now