2.4
User Methods
2.4.1
GetUserInfo
Description: Retrieve info about currently authenticated user, based on token
HTTP Verb: GET
URL:
/rest/method/fieldpop-api/getUserInfo
Query String Parameters:
•
happn_token - Token obtained from login request.
Example GET URL:
/rest/method/fieldpop-api/getUserInfo?happn_token=eyJ0eXAiOiJKV1QiLC
Example JSON Response:
{
"message": "Call successful",
"data": {
"username": "admin@gmail.com",
"firstName": "Joe",
"lastName": "Bloggs",
"email": "admin@gmail.com",
"phoneNumber": "123456789",
"oem": "test oem",
"company": "test company",
"role": "OEM Admin"
},
"error": null
}
2.4.2
GetUserDevices
Description: Retrieve list of devices visible to current user
HTTP Verb: GET or POST
URL:
/rest/method/fieldpop-api/getUserDevices
Query String Parameters:
•
happn_token - Token obtained from login request.
•
List (optional) - set to true to get array of deviceID strings only.
Body Parameters (JSON):
•
List (optional) - set to true to get array of deviceID strings only.
•
Filter (optional) - MongoDB-style query object to filter results
see https://www.npmjs.com/package/sift.
Example 1 – GET URL: (no list parameter set)
/rest/method/fieldpop-api/getUserDevices?happn_token=eyJ0eXAiOiJKV1QiLC
Example 1 – JSON Response:
{
"message": "Call successful",
"data": [
{
"company": "SMC",
"description": "ProtoAir monitoring US and SA weather",
"deviceId": "flickerpalm_N1ytNF-y7",
"location": "-26.13226, 27.90566000000001",
"macAddress": "00:50:4E:60:00:16",
"name": "WeatherLink SA",
"oem": "SMC",
"state": "Normal",
"installationInfo": {
"address": {
"streetAddress": "201 W Passaic St",
"suburb": "Rochelle Park",
"city": "Roodepoort",
"state": "Gauteng",
Grid RESTful API Start-up Guide
Install OpenVPN Client
34
Need help?
Do you have a question about the Grid RESTful API and is the answer not in the manual?
Questions and answers