SimplyRFiD Pogi API Manual
The Pogi server can be accessed through REST API. Listed on this manual are all the available API and their details.
The API calls can be used for integration with other applications. Details and examples on how to utilize the API calls are available for Javascript and Python 3.
The Pogi APIs can also be tested directly using the Insomnia Workspace application. The Insomnia JSON file can be downloaded from the Pogi API - Insomnia workspace repository or directly imported through the URL https://raw.githubusercontent.com/simplyrfid-dev/pogi-api-insomnia-workspace/main/pogi-api-insomnia-workspace.json
A. /auth/Login
Description: Navigate to login page
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: N/A
Success Response: N/A
Error Response: Possible 404 or No Connection
B. /dashboard/Dashboard
Description: Navigate to landing page after successful login
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: N/A
Success Response: N/A
Error Response: Possible 404 or No Connection
C. token-get
Description: Request a token for mobile access, by sending the mobile's userId and password, which is registered in the database
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params:
{"op": "token-get",
"userId": String,
"password": String}
Success Response: {"response": "OK", "org": String, "token": String}
Error Response: {"response": "error", "message": "Invalid Login"}
D. token-invalidate
Description: Request to invalidate a token
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op":"token-invalidate", "token": String}
Success Response: {"response": "OK"}
Error Response: {"response": "error", "message": ""}
A. version
Description: Get the current version of Pogi Server
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op": "version"}
Success Response:
{"message": String,
"version": String,
"versionWave": String,
"versionPython": String,
"response": "OK"}
Error Response: 500 Internal Server Error
Note: Http Status is still 200 for error responses. Please don't rely on the status
A. history
Description: Fetch the history data based on the filters provided
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params:
{"op": "history",
"fromDate": YYYY-MM-DD,
"fromTime": HH:MM:SS,
"toDate": YYYY-MM-DD,
"toTime": HH:MM:SS,
"event": String,
"zone": String,
"currentLocation": String[on]|null,
"limit": Int,
"offSet": Int,
"namedOnly": String,
"tagAssetSearchType": String,
"tagAndAssetSearchType": String,
"tagAndAsset":"",
"orderColumn": String,
"orderDirection": String[ASC,DESC]}
Success Response: An Array of the History table that resulted from the Query:
{"count":{"total": Int},
"data":[{"uid": String,
"external_id": String,
"tag_id": String,
"image": String,
"image_list": String,
"image_info": String,
"entity": String,
"marker": String,
"deleted": 0,
"json_data": String,
"update_date": "YYYY-MM-DD HH:MM:SS",
"zone": String,
"altitude": Float,
"lon": Float,
"lat": Float,
"state": "present",
"serial_number": String,
"description": String,
"owner": String,
"calibration_due_date": "",
"model_number": String,
"manufacturer": String,
"name": String,
"part_number": String,
}], ... }
Error Response:
{"response": "Warning", "message": "No Result Found" }
{"response": "Error", "message": "SQL Error" }
Note: Http Status is still 200 for error responses. Please don't rely on the status.
B. history-last-date
Description: Get latest date received from history
Method: GET
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op": "history-last-date"}
Success Response: {"date": Datetime}
Error Response: Possible 404 or No Connection
C. track
Description: Get item data on location and status change
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params:
{"op": "track",
"tagId": String}
Success Response:
{"count": {"total": Int},
"data": [{"state": "present|absent",
"tag": tagId,
"eventDate": "YYYY-MM-DD HH:MM:SS",
"zone": String}]}
Error Response: Possible 404 or No Connection
D. ui-edit-fields
Description: Get list of fields enabled for editing and creating tags
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op": "ui-edit-fields"}
Success Response: {"response": "OK", "fields": [[Field data], ... ]}
Error Response: {"response": "Error", "message": "Error (Error Code)"}
E. ui-current-fields
Description: Get Field Headers configured for the inventory table for all data
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op": "ui-current-fields"}
Success Response: {"response": "OK", "fields": [[Field data], ... ]}
Error Response: {"response": "Error", "message": "Error (Error Code)"}
F. ui-history-fields
Description: Get Field Headers configured for the inventory table for current data
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op": "ui-history-fields"}
Success Response: {"response": "OK", "fields": [[Field data], ... ]}
Error Response: {"response": "Error", "message": "Error (Error Code)"}
A. config-get
Description: Get the current version of Pogi Server
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op": "config-get"}
Success Response:
{ "config": {"serverName": String,
"serverProtocol": String,
"versionWave": String,
"rfidPrefix": String,
"version": String,
"instanceType": String},
"response": "OK"}
Error Response: 500 Internal Server Error
Note: Http Status is still 200 for error responses. Please don't rely on the status
B. upload-inventory
Description: Upload the Inventory gathered by the handheld reader
Method: POST
Type: application/json
URL Params: N/A
Data Params: Array of captured tag ids
{"op": "upload-inventory",
"data": {
"location" : [{
"antenna": Int,
"eventDate": Datetime,
"lat": float,
"lon": float,
"marker": String,
"reader": String,
"retVal": Int,
"rssi": float,
"sessionId": String,
"state": String[present|absent],
"tag": String,
"weight": float,
"xmitDate": Datetime,
"zone": String
},…]}
(Array of Tags), …, (Location props)
}
Success Response: {"response": "OK"}
Error Response:
{"response": "Error", "message": "SQL Error" }
{"response": "Error", "message": "No data received"}
A. id-fields
Description: Retrieve all valid fields and their data type applicable for all ID API calls
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op": "id-fields"}
Success Response: {"response": "OK",
"fields": [
[ "tag_id",
"varchar(255)",
"NO",
"PRI",
null,
""],
[ "external_id",
"varchar(255)",
"YES",
"MUL",
null,
""],
[ "name",
"text",
"YES",
"",
null,
""], ... ]}
Error Response: {"response": "Error","message": "SQL Error"}
Note: Http Status is still 200 for error responses. Please don't rely on the status
B. id-add
Description: Add/Push TagID with Asset ID. If the AssetID or RFID is existing, responds with an error
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params:
{"op": "id-add",
"ids": [{"tagId": String,
"zone": String,
"assetId": String,
Optional Params:
"name": String,
"owner": String,
"model_number": String,
"serial_number": String,
"part_number": String,
"calibration_due_date": YYYY-MM-DD HH:MM:SS,
"last_calibration_date": YYYY-MM-DD HH:MM:SS,
"description": String,
"browserTimezone": String,
"lat": Float,
"lon": Float,
"altitude": Float,
"image": String,
"image_list": String,
"image_info": String
}, ... ]}
Note: Browser Timezone is required if date fields are included
Success Response: {"response": "OK"}
Error Response:
{"response": "Warning", "message": "Tag ID is already Existing" }
{"response": "Error", "message": "SQL Error"}
{"response": "Error", "message": "No assetId or tagId found" }
Note: Http Status is still 200 for error responses. Please don't rely on the status
C. id-update
Description: Update data fields of existing RFID TagId
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params:
{"op": "id-update",
"addMissing": "true",
"ids": [{"tagId": String,
Optional Params:
"name": String,
"assetId": String,
"zone": String,
"owner": String,
"model_number": String,
"serial_number": String,
"part_number": String,
"calibration_due_date": YYYY-MM-DD HH:MM:SS,
"last_calibration_date": YYYY-MM-DD HH:MM:SS,
"description": String,
"browserTimezone": String,
"lat": Float,
"lon": Float,
"altitude": Float,
"image": String,
"image_list": String,
"image_info": String
}, ... ]}
Success Response: {"response": "OK"}
Error Response:
{"response": "Error","message": "SQL Error"}
{"response": "Error","message": "No assetId or tagId found"}
Note: Http Status is still 200 for error responses. Please don't rely on the status.
D. id-get
Description: Get tag ID information
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: tagID
Data Params: {"op": "id-get", "tagId": String}
Success Response: {"name": String,
"assetId": String,
"zone": String,
"owner": String,
"model_number": String,
"serial_number": String,
"part_number": String,
"calibration_due_date": YYYY-MM-DD HH:MM:SS,
"last_calibration_date": YYYY-MM-DD HH:MM:SS,
"description": String,
"browserTimezone": String,
"lat": Float,
"lon": Float,
"altitude": Float,
"image": String,
"image_list": String,
"image_info": String
}
Error Response: {"response": "Warning", "message": "No data received."}
E. id-exists
Description: Check if tag ID exists
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op": "id-exists", "tagId": String} or {"op": "id-exists", "id": String} or {"op": "id-exists", "ids": [String]}
Success Response: {"response": "OK", "info": String}
Error Response: {"response": "Warning", "message": "No data received."}
F. id-delete
Description: Delete tag
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: tagID
Data Params: {"op": "id-delete", "tagId": String}
Success Response: {"response": "OK"}
Error Response:
{"response": "Error", "message": "no tagId specified" }
{"response": "Error", "message": [ERROR CODE] }
G. id-deleted-list
Description: Get list of deleted tags
Method: GET
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op":"id-deleted-list"}
Success Response:
{"response":"OK", "data": [
{"delete_date": Datetime,
"uid": String,
"tag_id": String }, … ]}
Error Response: {"response": "Error", "message": "Data Error"}
H. id-deleted-count
Description: Get count of deleted tags
Method: GET
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op":"id-deleted-count"}
Success Response: {"response":"OK", "count": Int}
Error Response: {"response": "Error", "message": "Data Error"}
I. id-deleted
Description: Check if tag has deleted state
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op": "id-deleted", "tagId": String}
Success Response: {"response": "OK"}
Error Response:
{"response": "Error", "message": "no tagId specified" }
{"response": "Error", "message": [ERROR CODE] }
J. id-undelete
Description: Remove tag from deleted state
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op": "id-undelete", "tagId": String}
Success Response: {"response": "OK"}
Error Response:
{"response": "Error", "message": "no tagId specified" }
{"response": "Error", "message": [ERROR CODE] }
K. id-field-values
Description: Retrieve all values under the specified field/column from the database
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op": "id-field-values", "field": String}
Success Response: {"response": "OK",
"values": [Data], ... }
Error Response:
{"response": "Error", "message": "no tagId specified" }
{"response": "Error", "message": [ERROR CODE] }
L. id-update-zone
Description: Insert history event for the specified tagId
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params:
{"op": "id-update-zone",
"tagId": String,
"zone": String }
Success Response: {"response": "OK"}
Error Response:
{"response": "Error", "message": "no tagId specified" }
{"response": "Error", "message": [ERROR CODE] }
M. image-upload
Description: Upload image to server
Method: GET
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params:
{"op": "image-upload",
"name" : String,
"image" : [Data] }
Success Response: {"response":"OK"}
Error Response: {"response": "Error", "message": "Data Error"}
N. id-set-image
Description: Set image id
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params:
{"op": "id-set-image",
"tagID": String,
"source": String }
Success Response: {"response":"OK"}
Error Response: {"response": "Error", "message": "Data Error"}
O. id-set-image-list
Description: Set list image id
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params:
{"op": "id-set-image-list",
"tagID": String,
"source": String }
Success Response: {"response":"OK"}
Error Response: {"message": String[Error message], "tagId": String, "response": "Error"}
P. id-set-image-info
Description: Set info image id
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params:
{"op": "id-set-image-info",
"tagID": String,
"source": String }
Success Response: {"response":"OK"}
Error Response: {"message": String[Error message], "tagId": String, "response": "Error"}
Q. image-resize
Description: Resize image
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params:
{"op": "image-resize",
"sizeX": Int,
"sizeY": Int,
"inFile": String,
"outFile": String }
Success Response: null
Error Response: null
A. marker-list
Description: Get all markers data
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op":"marker-list"}
Success Response: {"response": "OK", "data": [{tag_id, name}]}
Error Response: {"response": "Error", "message": "Data Error"}
B. marker-add
Description: Get all markers data
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params:
{"op":"marker-add",
"tagId": String,
"name": String,
"zone": String}
Success Response: {"response": "OK"}
Error Response:
{"response": "Error", "message": "Data Error"}
{"response": "Error", "message": "No Data Received."}
C. marker-delete
Description: Delete marker
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op":"id-set-image", "tagID": String}
Success Response: {"response": "OK"}
Error Response:
{"response": "Error", "message": [SQL Error Messages] }
{"response": "Error", "message": "no tagId specified" }
A. zone-list
Description: Get Zones/Location List
Method: GET
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op":"zone-list"}
Success Response: Array of zone/location names {"data":[ "Zone1",… ]}
Error Response: Possible 404 or No Connection
B. zone-add
Description: Add a new Zone/Location
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op":"zone-add", "zone": String}
Success Response: {"response": "OK"}
Error Response:
{"response": "Warning", message: "Zone/Location Already Exists", existing: "{Existing Data}"}
{"response": "Error", "message": "Cannot create zone named Commissioned" }
{"response": "Error", "message": "No Data Received"}
{"response": "Error", "message": "SQL Error" }
C. zone-delete
Description: Delete a Zone/Location
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op":"zone-delete", "zone": String}
Success Response: {"response": "OK"}
Error Response: {"response": "Error", "message": "no zone specified" }
A. user-get
Description: Login or get active user
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params:
{"op": "user-get",
"userId": String,
"password": String}
Success Response: N/A
Error Response: Possible 404 or No Connection
B. user-list
Description: Get list of users
Method: GET
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: N/A
Success Response: Array of json obj with user information
{"op":"user-list",
"name": String,
"admin": 1 | 0 [True|False],
"id": String,
"token": String,
"active": 1 | 0 [Existing|New],
"org": String,
"password" : Encrypted String,
"email": String}
Error Response: Possible 404 or No Connection
C. user-add
Description: Add new user
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params:
{"op":"user-add",
"id": String,
"password" : Encrypted String,
"name": String,
"admin": 1 | 0 [True|False],
"email": String}
Success Response: {"response": "ok"}
Error Response:
{"response": "error", "error": "Did not receive data."}
{"response": "error", "error": "(1062 "Duplicate Entry '' for key 'PRIMARY'")"}
D. user-update
Description: Update user information
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params:
{"op":"user-update",
"id": String,
"password" : Encrypted String,
"name": String,
"admin": 1 | 0 [True|False],
"active": 1 | 0 [Existing|New],
"email": String}
Success Response: {"response": "ok"}
Error Response:
{"response": "error", "error": "Did not receive data."}
E. delete-user
Description: Delete user
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params: {"op":"delete-user", "userID" : String}
Success Response: {"response": "ok"}
Error Response: {"response": "error", "error": "Did no receive data."}
F. qr-create
Description: Creates QR for handheld reader login
Method: POST
Type: multiform or x-www-form-urlencoded
URL Params: N/A
Data Params:
{"op":"qr-create",
"userName": String,
"password" : String,
"serverAddress": String}
Success Response: {"response": "ok", "file": String}
Error Response: {"response": "error", "error": "Did no receive data."}