How to get from REST API list of available capabilities of operations

Hello,
I’m using a free trial with the latest version of cumulocity. I’m working on integrating the external system with cumulocity through REST API. I want to output all available operations with capabilities (seems that sometimes it is named fragments). For example, when I connect my smartphone through Cumulocity Sensor App I can retrieve a list of available operations: c8y_Message and c8y_Relay . In the documentation, we find that c8y_Relay operation has two states: OPEN, CLOSED . But can anyone suggest whether these states can be obtained through the REST API?

Thank you!

Hi,

do you mean the current state for a specific device or all the possible states?

The current state of the device is stored in the c8y_Relay fragment of the managed object (I guess you know that already). The possible states are not available via the REST API.

Best regards

Hi,
yes, I need all available states. If we could get them via REST, we could build commands that would cover all possible cases. For example, we could create a commands to turn the phone on and off without adding any special conditions that have to be added manually.

Thanks!
Best regards, Vitalii

Unfortunately that is not available via the REST API as it actually does not enforce that you use just the documented state.

c8y_Relay can be also an array e.g.:

{
   "c8y_RelayArray": [
      "OPEN",
      "CLOSED",
      "OPEN"
   ]
}

Also here I saw only “OPEN” or “CLOSED” as possible entries.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.