Details
List specific service properties of devices in an environment.
This endpoint retrieves the specified service selector property from all devices in the environment on which the property is defined. All properties of a specific service class can be retrieved, by using the name of the service class as the path selector, or a specific property can be retrieved, by using the name of the service class followed by the property name. When specific property names are used, only one property can be retrieved at a time.
For example, use “LightColor” to retrieve all properties of the LightColor service class, among all devices that implement that class. Use “LightColor.hue” to retrieve all values of LightColor.hue among the devices which implement it.
Each property retrieved is contained in its own JSON object within the response array.
If desired, the “refresh” parameter can be used to make sure that service selectors are specified properly. If this parameter is specified, the endpoint will explicitly reject service selectors that do not exist. By default, the endpoint ignores malformed service selectors, and in those cases returns an empty array of property information.
An account token, server token, or user token may be used to run this endpoint.
Parameters
path
- id (required): The ID of the environment.
- selector (required): The fully qualified name of the service, as “SERVICE-NAME.PROPERTY.”
query
- refresh (optional): Refresh the value of a service property, rather than getting its cached value. Default is false.
Responses
200
{
"items": [
{
"ecosystemId": "ECOSYSTEM-ID",
"id": "ENVIRONMENT-ID",
"index": "SERVICE-INDEX",
"modifiedAt": "YYYY-MM-DD HH:MM:SS ENCODED",
"property": "SERVICE-PROPERTY-NAME",
"service": "SERVICE-NAME",
"value": "SERVICE-PROPERTY-VALUE"
}
]
}
400
- Environment Invalid: The standard error structure defines this error as invalid parameters, with an invalid ID linked to the parameter that designates the environment ID. In this context, it means that the ID given for an environment was not valid.
- No Query String Allowed: The standard error structure defines this error as invalid parameters, with additional parameters in the query string. In this context, it means that no query string is allowed at all when calling this endpoint.
- Service Property Invalid: The standard error structure defines this error as invalid parameters, with an invalid selector. In this context, it means that the service property given does not exist in the specified service.
404
- Environment Not Found: This error means that an environment with the given ID was not found. This is distinct from an invalid environment ID being specified; this means that the environment ID once existed, but no longer does.
- Service Not Found: This error means that a service by the given name and/or format was not found.
Examples
HTTP
GET https://ioe.droplit.io/api/environments/ENVIRONMENT-ID/services/SERVICE-SELECTOR HTTP/1.1
authorization: TOKEN
Droplit Console
droplit environment get ENVIRONMENT-ID SERVICE-PROPERTY
Droplit SDK
droplit.environments.getServiceProperty("ENVIRONMENT-ID", "SERVICE-PROPERTY");