Skip to content

PAC Control REST API API

by opto22.com

HTTP BasicIoT
Open documentation ↗

Overview

#### Revised: 6/15/2018 ### Overview This API provides secure access to a SNAP-PAC-R or -S series controller's variable and I/O tags. Confidentiality for API transactions is provided by HTTPS. Authentication uses HTTP Basic Authentication with an API key. An API key ID is submitted in the Basic Authentication userid field and API key value in the password field. **For more information visit:** [developer.opto22.com](http://developer.opto22.com) ### Examples **Read an array** of all the integer32 variables defined in the PAC's strategy. For example, on your SNAP-PAC-R or -S series controller at IP address 1.2.3.4, you would use the URL: ``` https://1.2.3.4/api/v1/device/strategy/vars/int32s ``` and provide appropriate authentication. The GET response will be a JSON array of name-value pairs such as: ```json [ { "nMyVeryFavoriteNumber": 22 }, { "nWidgetsProducedToday": 22222 }, { "DELAY_LOOP_TIME_IN_MSECS" : 200 } ] ``` **Read the engineering units** (EU) of an analog input point configured in the PAC's strategy. For an analog input (I/O point) named aiTemperatureInDegreesF, use `https://1.2.3.4/api/v1/device/strategy/ios/analogInputs/aiTemperatureInDegreesF/eu` The GET response will be a single JSON name-value pair such as: ```json { "value": 72.22 } ``` ### Note on packet sizes: When doing POSTs or GETs, the JSON payload in the body should not exceed 3k (3072 bytes).

PAC Control REST API is an iot API from opto22.com. Requests are authenticated with HTTP Basic auth. It is served over plain HTTP. Its OpenAPI description documents 55 endpoints.

At a glance

Authentication
HTTP Basic
HTTPS
No
CORS
Unknown
Category
IoT
Version
R1.0a
Endpoints
55
Spec updated
2021-06-21

Endpoints

MethodPathWhat it does
GET/deviceReturns controller's type; firmware version; both mac addresses; and uptime in seconds
GET/device/strategyReturns the name, date, time, and CRC of the strategy currently in the controller, and the number of charts currently running. Empty strings and a 0 will be ret
GET/device/strategy/ios/analogInputsReturns the name and engineering units (EU) for all analog input points in the strategy
GET/device/strategy/ios/analogInputs/{ioName}/euReads the value in engineering units (EU) of the specified analog input
GET/device/strategy/ios/analogOutputsReturns the name and engineering units (EU) for all analog output points in the strategy
GET/device/strategy/ios/analogOutputs/{ioName}/euReads the value in engineering units (EU) of the specified analog output
POST/device/strategy/ios/analogOutputs/{ioName}/euSets the value of the specified analog output point
GET/device/strategy/ios/digitalInputsReturns the name and state (true = on, false = off) of all digital input points in the strategy. If there is no strategy in the controller, or the strategy incl
GET/device/strategy/ios/digitalInputs/{ioName}/stateReturns the specified digital input point's state (true = on, false = off)
GET/device/strategy/ios/digitalOutputsReturns the name and state (true = on, false = off) of all digital output points in the strategy
GET/device/strategy/ios/digitalOutputs/{ioName}/stateReturns the specified digital output point's state (true = on, false = off)
POST/device/strategy/ios/digitalOutputs/{ioName}/stateSets the value of the specified digital output point
GET/device/strategy/tables/floatsReturns an array of the name and length of all the float tables in the strategy
GET/device/strategy/tables/floats/{tableName}Read table elements
POST/device/strategy/tables/floats/{tableName}Write table elements
GET/device/strategy/tables/floats/{tableName}/{index}Read specified table element
POST/device/strategy/tables/floats/{tableName}/{index}Write specified table element
GET/device/strategy/tables/int32sReturns an array of the name and length of all the integer32 tables in the strategy
GET/device/strategy/tables/int32s/{tableName}"Read a range of table elements from the specified integer32 table"
POST/device/strategy/tables/int32s/{tableName}"Write a range of table elements"
GET/device/strategy/tables/int32s/{tableName}/{index}Read specified integer32 table element
POST/device/strategy/tables/int32s/{tableName}/{index}Write specified integer32 table element
GET/device/strategy/tables/int64sReturns an array of the name and length of all the integer64 tables in the strategy
GET/device/strategy/tables/int64s/{tableName}"Read a range of table elements from the specified integer64 table"
POST/device/strategy/tables/int64s/{tableName}"Write a range of table elements"
GET/device/strategy/tables/int64s/{tableName}/_string"Read a range of table elements from the specified integer64 table"
POST/device/strategy/tables/int64s/{tableName}/_string"Write a range of table elements"
GET/device/strategy/tables/int64s/{tableName}/{index}Read specified integer64 table element
POST/device/strategy/tables/int64s/{tableName}/{index}Write specified integer64 table element
GET/device/strategy/tables/int64s/{tableName}/{index}/_stringRead specified integer64 table element as string
POST/device/strategy/tables/int64s/{tableName}/{index}/_stringWrite specified integer64 table element as string
GET/device/strategy/tables/stringsReturns an array of the name and length of all the string tables in the strategy
GET/device/strategy/tables/strings/{tableName}"Read a range of table elements from the specified string table"
POST/device/strategy/tables/strings/{tableName}"Write a range of table elements"
GET/device/strategy/tables/strings/{tableName}/{index}Read specified table element
POST/device/strategy/tables/strings/{tableName}/{index}Write specified table element
GET/device/strategy/vars/downTimersReturns the name and current value of all down timers in the strategy
GET/device/strategy/vars/downTimers/{downTimerName}/valueReturns current value of the specified down timer
GET/device/strategy/vars/floatsReturns the name and value of all (single-precision) float variables in the strategy
GET/device/strategy/vars/floats/{floatName}Returns value of the specified float variable
POST/device/strategy/vars/floats/{floatName}Sets the value of a float variable
GET/device/strategy/vars/int32sReturns the name and value of all integer32 variables in the strategy
GET/device/strategy/vars/int32s/{int32Name}Returns value of the specified integer32 variable
POST/device/strategy/vars/int32s/{int32Name}Sets the value of an integer32 variable
GET/device/strategy/vars/int64sReturns the name and value of all integer64 variables in the strategy
GET/device/strategy/vars/int64s/_stringReturns the name and value as a string of all integer64 variables in the strategy
GET/device/strategy/vars/int64s/{int64Name}Returns value of the specified integer64 variable
POST/device/strategy/vars/int64s/{int64Name}Sets the value of an integer64 variable
GET/device/strategy/vars/int64s/{int64Name}/_stringReturns value of the specified integer64 variable as a string
POST/device/strategy/vars/int64s/{int64Name}/_stringSets the value of an integer64 variable as a string
GET/device/strategy/vars/stringsReturns the name and value of all string variables in the strategy
GET/device/strategy/vars/strings/{stringName}Returns value of the specified string
POST/device/strategy/vars/strings/{stringName}Sets the value of a string variable
GET/device/strategy/vars/upTimersReturns the name and current value of all up timers in the strategy
GET/device/strategy/vars/upTimers/{upTimerName}/valueReturns current value of the specified up timer

Questions

Does the PAC Control REST API API need an API key?

Yes. The PAC Control REST API API uses HTTP Basic authentication; the documentation explains how to get credentials.

Does the PAC Control REST API API support HTTPS?

The PAC Control REST API API is listed as HTTP only, so avoid sending secrets to it.

How many endpoints does the PAC Control REST API API have?

Its OpenAPI description lists 55 endpoints in version R1.0a. All of them are shown on this page.

What are alternatives to the PAC Control REST API API?

Other IoT APIs include Brain Web API, Adafruit IO REST API, Netatmo, Influx OSS API Service, ClearBlade API.

Compare alternatives →

Brain Web API

IoT

This document describes the [Intellifi Brain](https://intellifi.zendesk.com/hc/en-us/categories/360000685454) Web API specification using the [OpenAPI specification](https://github.com/OAI/OpenAPI-Specification). The Brain Web API is a RESTful API that allows you to interact with the [Intellifi devices](https://intellifi.zendesk.com/hc/en-us/categories/360000685434) and services in a powerful and simple way. Our end-to-end solution allows you to localize your items/assets based on technologies such as RFID and Bluetooth. # Try it out! The API can be tried out and tested using the ['api-doc/tryitout' endpoint on this site](./tryitout/). This UI allows anyone to visualize and interact with the API’s resources without having any of the implementation logic in place. It’s automatically generated from this Specification, with the visual documentation making it easy for back end implementation and client side consumption. # Authentication Applications are required to provide some form of authentication to the API for every secured endpoint. The Brain offers two forms of authentication. - API key (Via an HTTP request header or URL parameter) - Session cookie <!-- ReDoc-Inject: <security-definitions> --> # See also - About Intellifi and what we do: [intellifi.nl](https://intellifi.nl) - Technical and background information: [intellifi.zendesk.com](https://intellifi.zendesk.com)

API key77 endpoints

Adafruit IO REST API

IoT

### The Internet of Things for Everyone The Adafruit IO HTTP API provides access to your Adafruit IO data from any programming language or hardware environment that can speak HTTP. The easiest way to get started is with [an Adafruit IO learn guide](https://learn.adafruit.com/series/adafruit-io-basics) and [a simple Internet of Things capable device like the Feather Huzzah](https://www.adafruit.com/product/2821). This API documentation is hosted on GitHub Pages and is available at [https://github.com/adafruit/io-api](https://github.com/adafruit/io-api). For questions or comments visit the [Adafruit IO Forums](https://forums.adafruit.com/viewforum.php?f=56) or the [adafruit-io channel on the Adafruit Discord server](https://discord.gg/adafruit). #### Authentication Authentication for every API request happens through the `X-AIO-Key` header or query parameter and your IO API key. A simple cURL request to get all available feeds for a user with the username "io_username" and the key "io_key_12345" could look like this: $ curl -H "X-AIO-Key: io_key_12345" https://io.adafruit.com/api/v2/io_username/feeds Or like this: $ curl "https://io.adafruit.com/api/v2/io_username/feeds?X-AIO-Key=io_key_12345 Using the node.js [request](https://github.com/request/request) library, IO HTTP requests are as easy as: ```js var request = require('request'); var options = { url: 'https://io.adafruit.com/api/v2/io_username/feeds', headers: { 'X-AIO-Key': 'io_key_12345', 'Content-Type': 'application/json' } }; function callback(error, response, body) { if (!error && response.statusCode == 200) { var feeds = JSON.parse(body); console.log(feeds.length + " FEEDS AVAILABLE"); feeds.forEach(function (feed) { console.log(feed.name, feed.key); }) } } request(options, callback); ``` Using the ESP8266 Arduino HTTPClient library, an HTTPS GET request would look like this (replacing `---` with your own values in the appropriate locations): ```arduino /// based on /// https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266HTTPClient/examples/Authorization/Authorization.ino #include <Arduino.h> #include <ESP8266WiFi.h> #include <ESP8266WiFiMulti.h> #include <ESP8266HTTPClient.h> ESP8266WiFiMulti WiFiMulti; const char* ssid = "---"; const char* password = "---"; const char* host = "io.adafruit.com"; const char* io_key = "---"; const char* path_with_username = "/api/v2/---/dashboards"; // Use web browser to view and copy // SHA1 fingerprint of the certificate const char* fingerprint = "77 00 54 2D DA E7 D8 03 27 31 23 99 EB 27 DB CB A5 4C 57 18"; void setup() { Serial.begin(115200); for(uint8_t t = 4; t > 0; t--) { Serial.printf("[SETUP] WAIT %d...\n", t); Serial.flush(); delay(1000); } WiFi.mode(WIFI_STA); WiFiMulti.addAP(ssid, password); // wait for WiFi connection while(WiFiMulti.run() != WL_CONNECTED) { Serial.print('.'); delay(1000); } Serial.println("[WIFI] connected!"); HTTPClient http; // start request with URL and TLS cert fingerprint for verification http.begin("https://" + String(host) + String(path_with_username), fingerprint); // IO API authentication http.addHeader("X-AIO-Key", io_key); // start connection and send HTTP header int httpCode = http.GET(); // httpCode will be negative on error if(httpCode > 0) { // HTTP header has been send and Server response header has been handled Serial.printf("[HTTP] GET response: %d\n", httpCode); // HTTP 200 OK if(httpCode == HTTP_CODE_OK) { String payload = http.getString(); Serial.println(payload); } http.end(); } } void loop() {} ``` #### Client Libraries We have client libraries to help you get started with your project: [Python](https://github.com/adafruit/io-client-python), [Ruby](https://github.com/adafruit/io-client-ruby), [Arduino C++](https://github.com/adafruit/Adafruit_IO_Arduino), [Javascript](https://github.com/adafruit/adafruit-io-node), and [Go](https://github.com/adafruit/io-client-go) are available. They're all open source, so if they don't already do what you want, you can fork and add any

API key71 endpoints

Netatmo

IoT

<h3>Welcome to the Netatmo swagger on-line documentation !</h3> This site is a complement to the official <a href="https://dev.netatmo.com/">Netatmo developper documentation</a> using swagger to bring interactivity and easy testing of requests with the "try it" button (authenticate with the authorization code OAuth2 flow by clicking the authenticate button in the methods). You can find the source code for this site can be found in the project <a href="https://github.com/cbornet/netatmo-swagger-ui">netatmo-swagger-ui</a>. You can also use the online <a href="./swagger.json">swagger declaration</a> file to generate code or static documentation (see <a href="https://github.com/cbornet/netatmo-swagger-api">netatmo-swagger-api</a>).

OAuth22 endpoints

Influx OSS API Service

IoT

# Authentication &lt;!-- ReDoc-Inject: &lt;security-definitions&gt; --&gt;

HTTP Basic197 endpoints

ClearBlade API

IoT

A friendly little API to help you interact with the ClearBlade platform.

No auth220 endpoints

Hardware Sentry TrueSight Presentation Server REST API

IoT

Hardware Sentry TrueSight Presentation Server REST API

API key23 endpoints

Listed from APIs.guru (CC0).