Page 1
Start-up Guide Grid RESTful API APPLICABILITY & EFFECTIVITY Effective for all systems manufactured after August 2021. Document Revision: 2.A T18663 Grid RESTful API Start-up Guide MSAsafety.com...
Page 2
MSA Safety 1991 Tarob Court Milpitas, CA 95035 Website: www.MSAsafety.com U.S. Support Information: +1 408 964-4443 +1 800 727-4377 Email: smc-support@msasafety.com EMEA Support Information: +31 33 808 0590 Email: smc-support.emea@msasafety.com Grid RESTful API Start-up Guide...
Page 3
Assumptions The following items should be complete before moving forward with Grid RESTful API setup. ✓ Install preferred RESTful client program. ✓ Setup a Grid account. ✓ Login to a computer with access to the internet and web browser. Grid RESTful API Start-up Guide...
Page 4
Quick Start Guide 1. Open the preferred RESTful client. 2. Authenticate with www.FieldPoP.io/rest/login. 3. Test the API. a. Set up a sample b. Run the sample 4. Run GET device data log commands. Grid RESTful API Start-up Guide...
Data Structure ........................43 Using CURL to Generate Grid RESTful API Requests ............44 How to Access the RESTful API Through Fiddler ..............45 Generic Information for Access to the Grid RESTful API ............48 3.4.1 Authenticate via GET Command .................... 48 3.4.2...
NOTE: For general Grid registration and use instructions, see the MSA Grid Start-up Guide. The Grid RESTful API acts as a RESTful server using HTTPS. The API will support authentication, read operations, and write operations, including: • Read (HTTP GET)
Grid RESTful API Supported Functions Grid RESTful API Supported Functions HTTP Usage Most RESTful requests can be made using either POST or GET requests. POST requests must specify parameters in a JSON payload and GET requests must specify parameters as query parameters in the URL.
Grid RESTful API Supported Functions Example JSON Response: "message": "Logged in ok", "data": { "token": "eyJ0eXAiOiJKV1QiLCJhbGcoIoJIUzI1NiJ9.ImlkfDI1MGYxYWIwLWQzMjktNGQyNS1hMTE5LThlOTJhZDc0MzcyZXx0eXBlfH RpbWVzdGFtcHxpc0VuY3J5cHRlZHxvcmlnaW58MTAtMC0yOC0xODFfNTcwMDB8cG9saWN5fDB8dHRsfGluYWN0aXZpdHlf dGhyZXNob2xkfDF8cGVybWlzc2lvblNldEtleXwvT0VNK0FkbWluLy9fTUVTSF9HU1QvfGlzVG9rZW58dXNlcm5hbWV8ZWdnZ XJzamVuc0BnbWFpbC5jb21eMHxKNjZCOFBGR3wwfDBeXiQwfDF8MnxIfDN8SXw0fC0yfDV8Nnw3fCQ4fCQ5fEp8QXwtM11 8QnwkOXxLfEF8LTNdXXxDfER8RXwtMXxGfEddIg.ihjURRHILcXp-iTl4FvjjAma1sI1_CDINGyQuSNacDM" "error": null Data Read/Write 2.3.1 Data Path Parameter Whenever a parameter is specified as a path, this acts as a wildcard and includes all items that appear below the specified path.
Grid RESTful API Supported Functions 2.3.2 All Field Device Types DeviceDataLog Description: Get all data logs available to user, narrowed down by optional parameters. HTTP Verb: GET or POST URL: /rest/method/fieldpop-api/deviceDataLog Parameters: • happn_token - Token obtained from the login request.
Grid RESTful API Supported Functions 2.3.3 Device Type: System View GetDeviceData (System View v.2, v.3) Description: Retrieve the data available under the specified device and data path. HTTP Verb: GET or POST URL: /rest/method/fieldpop-api/getDeviceData Parameters: • happn_token - token obtained from the login request.
Page 19
- the path of the value to set; this must be done at the leaf level “deviceName/propertyName” value - the value to set Example Body Parameters: "parameters": { "deviceID": "blazescowl_VygDWeqmz", "path": "BAC_IP_EVG_1_/BoilerModel", "value": 50 Example JSON Response: "message": "Call successful", "data": null, "error": null Grid RESTful API Start-up Guide...
- must be set to true since default representation might change in the future Example Body Parameters: "parameters": { "deviceID": "bigelf_rkr", "path": "200/analog-value:0/present-value", "options": { "asn1": true Example JSON Response: "message": "Call successful", "data": { "value": 28, "type": "REAL" "error": null Grid RESTful API Start-up Guide...
Page 21
(optional) - priority to set from 1 to 16 Example Body Parameters: "parameters": { "deviceID": "bigelf_rkr", "path": "200/analog-value:0/present-value", "value": { "value": 24, "type": "REAL" "options": { "asn1": true, "priority": 16 Example JSON Response: "message": "Call successful", "data": null, "error": null Grid RESTful API Start-up Guide...
(optional) – an optional object containing: dataFilter – a MongoDB-style sift query object (see ); result https://www.npmjs.com/package/sift objects relating to downstream field devices are only included in the response if they match this filter Grid RESTful API Start-up Guide...
URL: /rest/method/fieldpop-api/createOemUser Query String Parameters: • happn_token - Token obtained from login request. Contact MSA Safety support for credentials with access this method. • email - the email address of the user for which an account should be created. •...
- the semantic versioning (or semver) of firmware to load on the IIoT Gateway Example 3 – POST URL: /rest/method/fieldpop-api/upgradeFirmware?happn_token=eyJ0eXAiOiJKV1QiLC Example 3 – JSON Payload: "parameters": { "deviceID": "cybersparrow_NkWMIrKbyQ", "firmwareVersion": "5.4.2" Example 3 – JSON Response: "message": "Call successful", "data": null, "error": null Grid RESTful API Start-up Guide...
The RESTful API will provide access to all data retained on the Grid. The duration for which data is retained on the Grid is an operation decision outside the scope of this document. 3.1.4 Data Structure All data will be returned in a self-describing JSON format. Grid RESTful API Start-up Guide...
Troubleshooting Using CURL to Generate Grid RESTful API Requests When using CURL to generate REST API requests, the URL must be in quotes when specifying URL parameters. Here are some examples: deviceDataLog curl -v -L 'https://www.fieldpop.io/rest/method/fieldpop-api/deviceDataLog?deviceID=enter-device-id- here&happn_token=enter-token-here' getDeviceData curl -v -L -H "Content-Type: application/json" -X POST -d '{"parameters": {"deviceID": "enter-device-id- here","path": "1001/analog-input:1/present-value","options": {"asn1": true}}}'...
5. Set the HTTP verb to GET from the dropdown menu and enter the following HTTPS address: https://www.fieldpop.io/rest/login?username=<username>&password=<password> NOTE: For the italisized portions of the address above (“<username>” and “<password>”), the authenticated username and password must be added. No brackets should be included (“<” or “>”). Grid RESTful API Start-up Guide...
Page 46
11. Select the JSON box below to see the JSON data response from the RESTful API. 12. Record the data.token value. NOTE: The token is the authentication token needed to get the device data logs. Grid RESTful API Start-up Guide...
Page 47
20. Select JSON to see the response in JSON format. 21. Copy the token. 22. Compose the URL again to get the device data logs (https://www.fieldpop.io/rest/method/fieldpop- api/deviceDataLog). 23. Pass the copied token as a query parameter (deviceID=deviceID&happn_token=authtoken&startUTCsec=1477388259&endUTCsec=1500000 000). Grid RESTful API Start-up Guide...
Troubleshooting Generic Information for Access to the Grid RESTful API NOTE: In the tables that follow, italicized characters indicate placeholder text that must be filled in by the user with the correct information. 3.4.1 Authenticate via GET Command Method https://www.fieldpop.io/rest/login?username=username&password=password...
• Click “Forgot Password” on the MSA Grid Login Screen. • Once the Password Reset Window appears, enter the email address of the MSA Grid account and click Submit. Then close the window that appears. • Click on the “Reset Your Password” button in the email sent from notification@fieldpop.io to reset the MSA Grid password.
(port 80 and 443). To connect to a ProtoNode via MSA Grid, a device tunnel is created that has a unique subdomain in the URL. Therefore, the best way to configure a firewall rule is to use a wildcard domain: *.tunnel.fieldpop.io...
Open a web browser on the local PC and go to www.smccloud.net. • Move the cursor to the padlock icon ( ) next to the website address. • Click the padlock icon to open a dropdown menu for website information and browser settings. Grid RESTful API Start-up Guide...
Page 52
Troubleshooting • Review the information and click the Certificate button. • Examine the certificate as needed. NOTE: To download the certificate, click the Details tab and click the ‘Copy to File’ button. Grid RESTful API Start-up Guide...
MSA Safety warrants its products to be free from defects in workmanship or material under normal use and service for two years after date of shipment. MSA Safety will repair or replace any equipment found to be defective during the warranty period. Final determination of the nature and responsibility for defective or damaged equipment will be made by MSA Safety personnel.
Need help?
Do you have a question about the Grid RESTful API and is the answer not in the manual?
Questions and answers