====== Static Widget API ====== This API allows you to interact with your widgets via static HTTP POST/GET calls vs. dynamic scripting. This enables direct and open access to your widgets to support third-party desktop and mobile applications. The API is simple enough for mobile phones to control and monitor widgets and robust enough to support LabVIEW applications. ===== Get the "widgetID" ===== A widget created on the ioBridge.com Interface created an embed tag for use on websites. To connect the API calls to the widget you will need the the "widgetID". {{:api:widgetid.jpg|}} ===== API Access ===== To access the API, you can use GET or POST calls. You can also use "http" or "https" to send API calls. ==== HTTP GET ==== http://www.iobridge.com/widgets/static/id=[widgetID] ==== HTTP POST ==== http://www.iobridge.com/widgets/static id=[widgetID] ===== Parameters ===== To send additional parameters to the API, use an "&" as a delimiter for each parameter passed. Here is an example: http://www.iobridge.com/widgets/static/id=[widgetID]&value=1&format=xml Here are the parameters that you can send to the API: ==== id ==== //Required// - widgetID of widget created on the ioBridge.com Interface ==== value ==== //Optional// - Value to be passed to the widget (URL encoded) * **Logic High/On/1** - value=1 * **Logic Low/Off/0** - value=0 ==== format ==== //Optional// - Type of format for the API response (Default is Text) * **Plain Text** - format=text * **HTML** - format=html * **WAP/WML** - format=wml * **XML** - format=xml * **JSON** - format=json * **VoiceXML** - format=vxml * **TwiML** - format=twiml * **TwiML SMS** - format=twimlsms ==== callback ==== //Optional// - Callback parameter for JSONP objects and cross-domain scripting ===== API Responses ===== A call to the API returns a response depending on the success and type of request. The response will be wrapped in the appropriate headers if the format parameter is passed. Here are the following possible responses: ==== Sent ==== //If you send a command to a control widget and the command was issued successfully, you will get the word "Sent" returned back to you// ==== Error ==== //If you send a command to a control or monitor widget and the command was issued unsuccessfully, you will get the word "Error" returned back to you// ==== Offline ==== //If the module is offline, the response will be "Offline"// ==== Values ==== //If you send a call to a monitor widget, you will receive a scaled or labeled value depending on the widget settings// ===== Example Applications ===== ==== Secure HTML Form ==== This is an HTML form that uses HTTP POST to send a value to a control widget. Static Widget API with HTML Form

==== WAP/WML Page ==== This example is a WML formatted page to control a digital output using HTTP GET calls.

On

Off