PAC Control REST API R1.0a
Added: 19/02/2019
Updated at: 21/06/2021
#### 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).