REST API format
Endpoints
REST API requests are made to the following endpoints:
- ANY https://apiserv03c.lockly.com/pgsmtlkv2/api/(string: endpoint)
- ANY https://apiserv04c.lockly.com/(string: endpoint)
All documented endpoints use the first listed endpoint, unless stated otherwise.
Message format
All API messages follow the following format.
JSON request fields in the endpoint documentation refer to the contents of the para
field.
- ANY (string: endpoint)
- Request Headers
Authorization – An authorization header obtained through the login process.
Content-Type – Always
application/json
.
- Request JSON Object
ctry (string) – The locale of the app, obtained with Locale.getCountry on Android (e.g.
AU
).dvid (string) – A persistent randomly-generated lowercase v4 UUID with no dashes (e.g.
d23a84a871f24f088d0e04887344d71a
).locale (string) – The locale of the app (e.g.
EN
orEN_GB
).os (string) – The operating system of the app (e.g.
android
).para (string or base64) – Request parameters - often encrypted.
rid1 (string) – A Firebase Cloud Messaging token.
rid2 (string) – A Mi Push token.
tk (string) – A password (used in only a few API requests).
ver (string) – The app version code (e.g.
237
).versionName (string) – The app version name (e.g.
2.3.7
).
- Response JSON Object
cod (int or stringified int) – An error code. 200 is a success. Note that this is not an HTTP status code.
msg (optional string) – A message describing the result of the API request.
Other top-level request parameters may be required for some endpoints. These will be documented as general JSON parameters, like so:
- JSON Parameters
toplevelParameter (string) – A top-level (not part of
para
) parameter.
- Request JSON Object
regularParameter (string) – A regular parameter in
para
.
Warning
Make sure to include the
Content-Type
header in all API requests. Ommiting it will result in unusual errors.Warning
The
cod
response field can be either an integer or a string - make sure to handle both cases.