Seluxit Platform Open API documentation

  1. Methods
    1. GET
    2. PUT
    3. POST
    4. DELETE
    5. Required header for REST calls
    6. Retrieve an object by its ID
      1. Example
      2. Possible errors
    7. Retrieve a list of available objects
      1. Retrieve a list with parent
      2. Example
      3. Retrieve a list without parent
      4. Example
      5. Possible Errors
    8. Update an object
      1. Example
      2. Possible errors
    9. Information from Log
      1. Example
      2. Possible errors
    10. Add a new object
      1. Example
      2. Possible errors
    11. Delete an object
      1. Example
      2. Possible errors
    12. Delete multiple objects
      1. Example
      2. Possible errors
  2. Objects
    1. Hierarchy of objects
    2. Other objects
    3. Location
      1. Location structure
      2. Retrieve a Location by ID
      3. Retrieve list available Locations
      4. Add a new Location
      5. Update a Location
      6. Delete a Location
      7. Delete all Locations
      8. Possible Errors
    4. Group
      1. Group structure
      2. Retrieve a Group by ID
      3. Retrieve a list of Groups from a Location
      4. Add a new Group in one Location
      5. Update a Group
      6. Delete a Group
      7. Delete all the Groups of a Location
      8. Possible Errors
    5. Stream
      1. Stream structure
      2. Retrieve a Stream by ID
      3. Retrieve a list of Streams from a Location
      4. Possible Errors
    6. Subscription
      1. Subscription structure
      2. Retrieve a Subscription by ID
      3. Retrieve a list of Subscriptions from a Stream
      4. Add a new Subscription in one Stream
      5. Update a Subscription
      6. Delete a Subscription
      7. Delete all the Subscriptions of a Stream
      8. Possible Errors
    7. Shape
      1. Shape Structure
      2. Retrieve a Shape by ID
      3. Retrieve a list of Shapes from a Location
      4. Add a new Shape to a Location
      5. Update an Action
      6. Delete a Shape
      7. Delete all the Shapes of a Location
      8. Possible Errors
    8. User
      1. User Structure
      2. Retrieve a User
      3. Retrieve a list of the available Users
      4. Retrieve a list of the Users in one location
      5. Add a new User in one Location
      6. Update a User
      7. Delete a User
      8. Delete all the Users
      9. Possible Errors
    9. Network
      1. Network Structure
      2. Retrieve a Network
      3. Retrieve a list of Networks from a Location
      4. Add a Network in one Location
      5. Update a Network
      6. Delete a Network
      7. Possible Errors
    10. Device
      1. Device Structure
      2. Retrieve a Device
      3. Retrieve a list of Devices from a Network
      4. Add a Device in one Network
      5. Update a Device
      6. Delete a Device
      7. Delete all Devices
      8. Possible Errors
    11. Status
      1. Status Structure
      2. Retrieve a Status by ID
      3. Retrieve a list of Statuses from a Device
      4. Add a new Status in one Device
      5. Update a Status
      6. Delete a Status
      7. Delete all Statuses
      8. Possible Errors
    12. Value
      1. Value Structure
      2. Get a Value by ID
      3. Get a list of Values from a Device
      4. Delete a Value
      5. Possible Errors
    13. State
      1. State Structure
      2. Retrieve a State
      3. Retrieve a list of States in one Value
      4. Add a new State in one Value
      5. Update a State
      6. Delete a State
      7. Delete all States of a Session
      8. Possible Errors
    14. Log
      1. Log structure
      2. Retrieve a Log by ID
      3. Retrieve a list of Logs from a Configuration
      4. Retrieve data from a Log - Update a Log
      5. Add a new Log in one Value
      6. Delete a Log
      7. Delete all Logs of a Value
      8. Possible Errors
    15. Configuration
      1. Configuration structure
      2. Configuration status
      3. Example step 1
      4. Example step 2
      5. Example step 3
      6. Retrieve a Configuration by ID
      7. Retrieve device configurations list
      8. Add new Configuration, one Device
      9. Update a Configuration
      10. Delete a Configuration
      11. Delete all Configurations
      12. Possible errors
    16. Action
      1. Action Structure
      2. Retrieve a Action by ID
      3. Retrieve a list of Actions from a Configuration
      4. Add a new Action in one Configuration
      5. Update an Action
      6. Delete a Action
      7. Delete all the Actions of a Configuration
      8. Possible Errors
    17. Calculation
      1. Calculation Structure
      2. Retrieve a Calculation by ID
      3. Retrieve a list of Calculations from a Configuration
      4. Add a new Calculation in one Configuration
      5. Update a Calculation
      6. Delete a Calculation
      7. Delete all the Calculations of a Configuration
      8. Possible Errors
    18. Calendar
      1. Calendar Structure
      2. Retrieve a Calendar by ID
      3. Retrieve a list of Calendars from a Configuration
      4. Add a new Calendar in one Configuration
      5. Update a Calendar
      6. Delete a Calendar
      7. Delete all Calendars
      8. Possible Errors
    19. Partner
      1. Partner Structure
      2. Get a Partner by ID
      3. Get a list of Partners
      4. Add a new Partner in one Configuration
      5. Update a Partner
      6. Delete a Partner
      7. Delete all the Partners of a Configuration
      8. Possible Errors
    20. Timer
      1. Timer Structure
      2. Retrieve a Timer by ID
      3. Retrieve a list of Timers from a Configuration
      4. Add a new Timer in one Configuration
      5. Update a Timer
      6. Delete a Timer
      7. Delete all the Timers of a Configuratio
      8. Possible Errors
    21. Statemachine
      1. Statemachine Structure
      2. Retrieve a Statemachine by ID
      3. Retrieve a list of Statemachines from a Configuration
      4. Add a new Statemachine in one Configuration
      5. Update a Statemachine
      6. Delete a Statemachine
      7. Delete all the Statemachines of a Configuration
      8. Possible Errors
    22. ACL
      1. ACL Structure
      2. Retrieve an ACL by Location ID
      3. Retrieve a list of ACL
      4. Add a new ACL
      5. Add a User to ACL - Update an ACL
      6. Delete an ACL
      7. Possible Errors
    23. Gateway
      1. Gateway Structure
      2. Retrieve a Gateway
      3. Retrieve a list of Gateways from a Location
      4. Add a new Gateway in one Location
      5. Update a Gateway
      6. Delete a Gateway
      7. Possible Errors
    24. Wifinetwork
      1. Wifinetwork Structure
      2. Retrieve a Wifinetwork
      3. Retrieve a list of Wifinetworks
      4. Add a new Wifinetworks
      5. Update a Wifinetwork
      6. Delete one or more Wifinetworks
      7. Possible Errors
    25. Timezone
      1. Timezone Structure
      2. Retrieve a Timezone
      3. Retrieve a list of Timezone
      4. Add a new Timezone
      5. Update a Timezone
      6. Delete one or more Timezones
      7. Possible Errors
    26. Session
      1. Session structure
      2. Start a new session - login
      3. Get the data of a session
      4. Delete a session
      5. Possible errors
  3. Errors
    1. 400 Gateway already registered
    2. 400 Unsupported type
    3. 400 Invalid Email
    4. 400 Invalid JSON
    5. 400 Password is missing
    6. 400 Username missing
    7. 400 JSON must include type
    8. 400 active configuration
    9. 400 Idle configuration status
    10. 400 Commit configuration status
    11. 400 'wrong event' not valid service
    12. 400 'wrong uuid' is not a valid UUID
    13. 401 Unauthorized
    14. 401 X-session is not valid
    15. 403 Gateway is already registered
    16. 403 Can't list ACL's
    17. 404 Gateway not found
    18. 404 Collection is empty
    19. 404 Not Found
    20. 405 is not allowed
    21. 405 Method Not Allowed
    22. 409 ID is already used
    23. 409 IDs do not match
    24. 409 Username already registered
    25. 500 unsuccessful operations
    26. 500 ID not found in store
    27. 501 Replacing complete collection
    28. 501 No add method for backend
    29. 501 No delete method for backend

1.Methods #

1.1.GET #

The method GET is used to retrieve data from the database.
Yes No

1.2.PUT #

The method PUT is usually used to update the database.

Yes No

1.3.POST #

The method POST is used to add new objects and start a new session.

Yes No

1.4.DELETE #

The method DELETE is used to remove objects from the database.

Yes No

1.5.Required header for REST calls #

  • Accept: application/json
  • Content-Type: application/json
  • X-Session: <session id>

where <session id> is the session ID obtained by creating a new session.

Yes No

1.6.Retrieve an object by its ID #

To retrieve an object, you need to use GET it in the following way

GET <server>:<port>/services/<object type>/<object id>

The API will return the JSON of the object.

Yes No

1.6.1.Example #

Assume that we want to retrieve the information of the Device with ID 2b412da8-9506-4fe6-ada7-c2625c3c95ef. Then we use:

GET <server>:<port>/services/device/2b412da8-9506-4fe6-ada7-c2625c3c95ef

The API will return a similar JSON:

{
  ":type": "urn:seluxit:xml:bastard:device-1.0",
  ":id": "2b412da8-9506-4fe6-ada7-c2625c3c95ef",
  "name": "DONGLE",
  "manufacturer": "Seluxit",
  "product": "1-Gateway",
  "version": "1-2.5.0-1.2.1-4668-1.0.2",
  "serial": "3034F8EE90155B4000000021",
  "protocol": "Lemonbeat",
  "communication": "Always Online",
  "included": "1",
  "status": [list statuses],
  "service": [list services],
  "configuration": [list configurations]
}
Yes No

1.6.7.Retrieve a list of available objects #

To retrieve a list of available objects, we need to make a distinction in relation if the searched objects have a parent or not. To understand the objects’ hierarchy we recall their hierarchy.

Yes No

1.6.7.1.Retrieve a list of available objects with a parent #

To retrieve a list of available objects of one type, use the following command:

GET <server>:<port>/services/<parent type>/<parent id>/<object type>

The API will return the following JSON.

{
  ":type": "urn:seluxit:xml:bastard:idlist-1.0",
  ":id": <parent id>,
  "id": [list children],
  "@type": "urn:seluxit:xml:bastard:<object type>-1.0"
}
Yes No

1.6.7.2.Example #

An example can be useful to understand better what we mean with <parent type>, <parent id> and <object type>.

Assume that we want to find all the available devices in our network and we know that the our network ID is "607f07a0-7739-455b-962b-7669d6a7f083". This means that our <parent type> is "network", our <parent id> is "607f07a0-7739-455b-962b-7669d6a7f083" and our <object type> is "device".

To obtain our list we need to use: GET <server>:<port>/services/network/607f07a0-7739-455b-962b-7669d6a7f083/device

And the API will return:

{
  ":type": "urn:seluxit:xml:bastard:idlist-1.0",
  ":id": "607f07a0-7739-455b-962b-7669d6a7f083",
  "id": [
    "1cda3f63-90a6-40f2-9df0-05e979cfb3d1",
    "a0bcba60-d3ea-11e5-94df-001a65001500",
    "de554bd0-dfbb-11e5-879e-001a65001500"
  ],
  "@type": "urn:seluxit:xml:bastard:device-1.0"
}
Yes No

1.6.7.3.Retrieve a list of available objects without a parent #

To retrieve a list of available objects at the top of a hierarchy (as Locations), you need to GET it in the following way

GET <server>:<port>/services/<object type>

The API will return the following JSON.

{
  ":type": "urn:seluxit:xml:bastard:idlist-1.0",
  ":id": null,
  "id": [list objects],
  "@type": "urn:seluxit:xml:bastard:<object type>-1.0"
}
Yes No

1.6.7.4.Example #

We want to find all the available locations. This means that our <object type> is "location".

To find our locations we need to use: GET <server>:<port>/services/location

And the API will return:

{
  ":type": "urn:seluxit:xml:bastard:idlist-1.0",
  ":id": null,
  "id": [
    "2a1db798-c991-42ba-97bd-782356bf41ed",
    "9cfc6031-5011-4ae0-90c4-509235cc4e43",
    "d4df23d4-31fe-4fb0-bf60-8144337eba95"
  ],
  "@type": "urn:seluxit:xml:bastard:location-1.0"
}
Yes No

1.6.7.8.Update an object #

To update an object, you need to use PUT it in the following way.

PUT <server>:<port>/services/<object type>/<object id>

with the following body:

{
  ":type": "urn:seluxit:xml:bastard:<object type>-1.0",
  <updated JSON>
}

The API will return the JSON of the object.

Yes No

1.6.7.8.1.Example #

Assume that we want to update the name of the Location with ID 37dea70c-1782-44ad-87f1-911fc7555a37. Then we use:

PUT <server>:<port>/services/location/37dea70c-1782-44ad-87f1-911fc7555a37

with the following Body:

{
  ":type": "urn:seluxit:xml:bastard:location-1.0",
  "name": "NewName"
}

The API will update the Location with the new JSON and it will return a similar JSON:

{
  ":type": "urn:seluxit:xml:bastard:location-1.0",
  ":id": "37dea70c-1782-44ad-87f1-911fc7555a37",
  "name": "NewName",
  "network": [],
  "user": [],
  "shape": [],
  "stream": [],
  "group": []
}
Yes No

1.6.7.8.9.Information from log #

To retrieve information from a log, you need to PUT it in the following way

PUT <server>:<port>/services/log/<log id>

with the following body:

{
    ":type": "urn:seluxit:xml:bastard:log-1.0",
    "type": <type>,
    "timestamp": <datetime>
}

where <type> is one of these strings: "Hour", "Day", "Week", "Month", "Year", "Raw". <datetime> is a timestamp in format iso8601. In relation of the type selected, the API will retrieve different RDD data:

  • "Hour" returns a maximum of 60 data with interval of 1 minute
  • "Day" returns a maximum of 24 data with interval of 1 hour
  • "Week" returns a maximum of 7 data with interval of 1 day
  • "Month" returns a maximum of 28, 29, 30 or 31 data, in relation on the month, with interval of 1 day
  • "Year" returns a maximum of 12 data with interval of 30 days
  • "Raw" returns all the data collected in one hour.

Note: The NaN values are ignored.

Yes No

1.6.7.8.9.1.Example #

Suppose that you want to add an Action on the configuration with ID 35e115b8-d3d8-11e5-a061-c7f2006444de, then we use the following command:

POST <server>:<port>/services/configuration/35e115b8-d3d8-11e5-a061-c7f2006444de/action

with the wished Action Body in JSON format

{
  ":type": "urn:seluxit:xml:bastard:action-1.0",
  "report": {
    "my_value_id": "c9b55ffc-014a-11e6-b22c-bf582c6cb431",
    "partner_id": "ca97fe52-014a-11e6-9a9a-1f54bf4f1f89"
  }
}

The API will create the new object and it will return its JSON. In this case:

{
  ":type": "urn:seluxit:xml:bastard:action-1.0",
  ":id": "996328b6-c844-4ccb-a838-b715955901c5",
  "report": {
    "my_value_id": "c9b55ffc-014a-11e6-b22c-bf582c6cb431",
    "partner_id": "ca97fe52-014a-11e6-9a9a-1f54bf4f1f89"
  }
}
Yes No

1.6.7.8.9.2.Possible errors #

1.6.7.8.9.10.Add a new object #

To add a new object, you need to post your new objects in the following way

POST <server>:<port>/services/<parent type>/<parent id>/<objet type>

with the following Body in JSON format

{
  ":type": <object :type>,
  <other JSON objects>
}

If successful, the API will create a new location and it will return a JSON with an object based on your Body.

If not specified, the location ID will be automatically created by the API.

Note: Some objects need to be present on Couchbase before you can add them with your API.

Yes No

1.6.7.8.9.10.1.Example #

Suppose that you want to delete the Action with ID 996328b6-c844-4ccb-a838-b715955901c5, then we use the following command:

DELETE <server>:<port>/services/action/996328b6-c844-4ccb-a838-b715955901c5

The API will delete the selected object and it will return the following JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  ":id": [
    996328b6-c844-4ccb-a838-b715955901c5
  ],
  "message": "Deleted"
}
Yes No

1.6.7.8.9.10.11.Delete an object #

To delete an object, use the following command.

DELETE <server>:<port>/services/<object type>/<object id>

The API will delete the selected object and it will return a JSON with the following data:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  ":id": [
    <object id>
  ],
  "message": "Deleted"
}
Yes No

1.6.7.8.9.10.11.1.Example #

Suppose that you want to delete all the Actions of the Configuration with ID 35e115b8-d3d8-11e5-a061-c7f2006444de. Then you use the following command:

DELETE <server>:<port>/services/configuration/35e115b8-d3d8-11e5-a061-c7f2006444de/action

The API will delete all the selected object and it will return a JSON with the following data:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Cleared"
}
Yes No

1.6.7.8.9.10.11.2.Possible errors #

Yes No

1.6.7.8.9.10.11.12.Delete multiple objects #

To delete more objects, use the following command.

DELETE <server>:<port>/services/<parent type>/<parent id>/<object type>

The API will delete all the selected object and it will return a JSON with the following data:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Cleared"
}
Yes No

1.6.7.8.9.10.11.12.1.Example #

In this example we want to retrieve the week Log a45994d8-f742-11e5-b327-577c8d294329. To do so we use the method:

PUT <server>:<port>/services/log/a45994d8-f742-11e5-b327-577c8d294329

{
    ":type": "urn:seluxit:xml:bastard:log-1.0",
    "type": "Week",
    "timestamp": "2016-02-16T06:00:10Z"
}

This will return the following JSON:

{
  ":type": "urn:seluxit:xml:bastard:log-1.0",
  ":id": "a45994d8-f742-11e5-b327-577c8d294329",
  "type": "Week",
  "timestamp": "2016-02-16T06:00:10Z",
  "data": [
    {
      "timestamp": "2016-02-15T00:00:00Z",
      "data": "13.565768668075485"
    },
    {
      "timestamp": "2016-02-16T00:00:00Z",
      "data": "14.121469907407407"
    },
    {
      "timestamp": "2016-02-17T00:00:00Z",
      "data": "14.371851851851853"
    },
    {
      "timestamp": "2016-02-18T00:00:00Z",
      "data": "14.555833333333334"
    },
    {
      "timestamp": "2016-02-19T00:00:00Z",
      "data": "14.691284722222223"
    },
    {
      "timestamp": "2016-02-20T00:00:00Z",
      "data": "14.37712962962963"
    },
    {
      "timestamp": "2016-02-21T00:00:00Z",
      "data": "14.671793981481482"
    }
  ]
}

Note: Since we assume that the week starts on Monday and the 2016-02-16 is Tuesday, then the data will be starting from Monday 2016-02-15 .

Yes No

1.6.7.8.9.10.11.12.2.Possible errors #

Yes No

2.Objects #

2.1.Hierarchy of objects #

location
 |
 +-- group
 +-- stream
 |  |
 |  +-- subscription
 +-- shape
 +-- user
 +-- network
      |
      +-- device
            |
            +-- status
            +-- service
            |       |
            |       +-- value
            |              |
            |              +-- log
            +-- configuration
                    |
                    +-- action
                    +-- calculation
                    +-- calendar
                    +-- partner
                    +-- timer
                    +-- statemachine
Yes No

2.2.Other objects #

Yes No

2.3.Location #

A Location is…
Yes No

2.3.1.Location structure #

This is an example of a Location:

{
  ":type": "urn:seluxit:xml:bastard:location-1.0",
  ":id": "37dea70c-1782-44ad-87f1-911fc7555a37",
  "name": "Location1",
  "network": [list networks],
  "user": [list users],
  "shape": [list shapes],
  "stream": [list streams],
  "group": [list groups]
}
  • :type : type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:location-1.0".
  • :id : ID of the current Location.
  • name: name of the current Location.
  • network: Gateways that are installed under this Location.
  • user: an array with the Users that have access to this Location
  • shape:
  • stream:
  • group:
Yes No

2.3.2.Retrieve a Location by ID #

To retrieve a Location, you need to GET it in the following way

GET <server>:<port>/services/location/<location id>
Yes No

2.3.3.Retrieve a list of the available Locations #

To retrieve a list of the available Locations use the following command:

GET <server>:<port>/services/location
Yes No

2.3.4.Add a new Location #

POST <server>:<port>/services/location

with the chosen Body in JSON format.

Yes No

2.3.5.Update a Location #

To update a Location use the following command:

PUT <server>:<port>/services/location/<location id>

with the chosen Body in JSON format.

Yes No

2.3.6.Delete a Location #

To delete a Location use the following command:

DELETE <server>:<port>/services/location/<location id>
Yes No

2.3.7.Delete all Locations #

To delete all the Locations use the following command:

DELETE <server>:<port>/services/location/
Yes No

2.3.4.Group #

A group is…
Yes No

2.3.4.1.Group structure #

This is an example of a Group:

{
  ":type": "urn:seluxit:xml:bastard:group-1.0",
  ":id": "27c02958-3b34-45c6-a29c-a1d1286912c3",
  "name": "view1",
  "type": "view",
  "service": [
    {
      "serviceURI": "group/41d39ac1-d793-4596-a35d-f1a048fe81a1",
      "anchor": [0, 0],
      "data": ""
    },
    {
      "anchor": {
        "x": 199.55699114046638,
        "y": 418.46663594374866
      },
      "serviceURI": "service/567c0d54-107b-49ef-be77-c7347ecdf938",
      "data": ""
    }
  ]
}
  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:group-1.0"
  • :id : ID of the current Group
  • name: name of the current Group
  • type: type of the current Group
  • service: it is composed by a "serviceURI" (uri), an "anchor" point (point) and some data.
Yes No

2.3.4.2.Retrieve a Group by ID #

To retrieve a Group, you need to GET it in the following way:

GET <server>:<port>/services/group/<group id>
Yes No

2.3.4.3.Retrieve a list of Groups from a Location #

To retrieve a list of Groups from a Location, use the following command:

GET <server>:<port>/services/location/<location id>/group
Yes No

2.3.4.4.Add a new Group in one Location #

To add a Group to one of your Location you need to post it in the following way:

POST <server>:<port>/services/location/<location id>/group

with the chosen Body in JSON format.

Yes No

2.3.4.5.Update a Group #

To update a Group to one of your Location you need to put it in the following way:

PUT <server>:<port>/services/group/<group id>

with the chosen Body in JSON format.

Yes No

2.3.4.6.Delete a Group #

To delete a Group use the following command:

DELETE <server>:<port>/services/group/<group id>
Yes No

2.3.4.7.Delete all the Groups of a Location #

To delete a Group of a Location use the following command:

DELETE <server>:<port>/services/location/<location id>/group
Yes No

2.3.4.5.Stream #

A stream is…
Yes No

2.3.4.5.1.Stream structure #

This is an example of a Stream:

{
  ":type": "urn:seluxit:xml:bastard:stream-1.0",
  ":id": "f96e1550-ce85-4dfb-a60b-41053cb48527",
  "subscription": [list subscriptions]
}
  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:stream-1.0"
  • :id : ID of the current Stream
  • subscription: an array of the Subscriptions associated with the Stream
Yes No

2.3.4.5.2.Retrieve a Stream by ID #

To retrieve a Stream, you need to GET it in the following way:

GET <server>:<port>/services/stream/<stream id>
Yes No

2.3.4.5.3.Retrieve a list of Streams from a Location #

To retrieve a list of Streams from a Location, use the following command:

GET <server>:<port>/services/location/<location id>/stream
Yes No

2.3.4.5.6.Subscription #

A subscription is…
Yes No

2.3.4.5.6.1.Subscription structure #

This is an example of a Subscription:

{
  ":type": "urn:seluxit:xml:bastard:stream-1.0:subscription",
  ":id": "c317930a-49f3-480b-b736-ae09f992998f",
  "urn": "urn:seluxit:xml:bastard:network-1.0",
  "id": "607f07a0-7739-455b-962b-7669d6a7f085"
}
  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:subscription-1.0"
  • :id : ID of the current Subscription
  • urn:
  • id:
Yes No

2.3.4.5.6.2.Retrieve a Subscription by ID #

To retrieve a Subscription, you need to GET it in the following way:

GET <server>:<port>/services/subscription/<subscription id>
Yes No

2.3.4.5.6.3.Retrieve a list of Subscriptions from a Stream #

To retrieve a list of Subscriptions from a Stream, use the following command:

GET <server>:<port>/services/stream/<stream id>/subscription
Yes No

2.3.4.5.6.4.Add a new Subscription in one Stream #

To add a Subscription to one of your Stream you need to post it in the following way:

POST <server>:<port>/services/stream/<stream id>/subscription
Yes No

2.3.4.5.6.5.Update a Subscription #

To update a Subscription you need to put it in the following way:

PUT <server>:<port>/services/subscription/<subscription id>

with the chosen Body in JSON format.

Yes No

2.3.4.5.6.6.Delete a Subscription #

To delete a Subscription use the following command:

DELETE <server>:<port>/services/subscription/<subscription id>
Yes No

2.3.4.5.6.7.Delete all the Subscriptions of a Stream #

To delete a Subscription of a Stream use the following command:

DELETE <server>:<port>/services/stream/<stream id>/subscription
Yes No

2.3.4.5.6.7.Shape #

A Shape is used to manage the canvas in the front-end that shows the disposition of the rooms in a Location. Each Shape manages one room in our Location..

Yes No

2.3.4.5.6.7.1.Shape Structure #

This is an example of a Shape:

{
  ":type": "urn:seluxit:xml:bastard:shape-1.0",
  ":id": "0571aced-4522-4ff8-8ab3-6580c9d85158",
  "name": "Square shape",
  "name_anchor": {
    "x": 248.5,
    "y": 317.6
  },
  "type": "",
  "contour":
  [
    {
      "anchor": {
        "x": 130,
        "y": 220
      },
      "handle": [
        {
          "x": -12.5,
          "y": -21.69999999999999
        },
        {
          "x": -15.52234296528701,
          "y": -112.26865945028158
        }
      ]
    },
    {
      "anchor": {
        "x": 500,
        "y": 210
      },
      "handle": [
        {
          "x": -79.67386353289328,
          "y": 3.6053218973283947
        },
        {
          "x": 430.3243917451716,
          "y": -25.134931495204853
        }
      ]
    },
    ...
  ]
}
  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:shape-1.0"
  • :id : ID of the current Shape
  • name: name of the current Shape
  • type: type of the current Shape
  • name_anchor: the position of the name of the device
  • contour: the list of the points that delimits the perimeter of the Shape
  • anchor: the position in the canvas of a point of the perimeter
  • handle: the used handle to manage a possible curve line on the perimeter of the Shape
Yes No

2.3.4.5.6.7.2.Retrieve a Shape by ID #

To retrieve a Shape, you need to GET it in the following way:

GET <server>:<port>/services/shape/<shape id>
Yes No

2.3.4.5.6.7.3.Retrieve a list of Shapes from a Location #

To retrieve a list of Shapes from a Location, use the following command:

GET <server>:<port>/services/location/<location id>/shape
Yes No

2.3.4.5.6.7.4.Add a new Shape to a Location #

To add a Shape to one of your Location you need to post it in the following way:

POST <server>:<port>/services/location/<location id>/shape
Yes No

2.3.4.5.6.7.5.Update an Action #

p>To update a Shape you need to put it in the following way:

PUT <server>:<port>/services/shape/<shape id>

with the chosen Body in JSON format.

Yes No

2.3.4.5.6.7.6.Delete a Shape #

To delete a Shape use the following command:

DELETE <server>:<port>/services/shape/<shape id>
Yes No

2.3.4.5.6.7.7.Delete all the Shapes of a Location #

To delete all the Shapes of a Location use the following command:

DELETE <server>:<port>/services/location/<location id>/shape
Yes No

2.3.4.5.6.7.8.User #

2.3.4.5.6.7.8.1.User Structure #

This is an example of a User:

{
  ":type": "urn:seluxit:xml:bastard:user-1.0",
  ":id": "69823cc7-2c7c-4c7c-85fd-5715586315fa",
  "username": "username@domain.com",
  "first_name": "Mark",
  "last_name": "Ren",
  "email": "markren@domain.com",
  "phone": "+452254658260030",
  "notification": true,
  "role": "Boss"
}
  • :type : type of the object that we are looking, in this case it is ""urn:seluxit:xml:bastard:user-1.0"".
  • :id : ID of the current User.
  • username: username of the retrieve User.
  • first_name: (optional) first name of the User
  • last_name: (optional) last name of the User
  • email: (optional) email of the User
  • phone: (optional) phone of the User
  • notification: (optional) boolean that indicates if the user wants notifications or not
  • role: (optional)
Yes No

2.3.4.5.6.7.8.2.Retrieve a User #

To retrieve a User, use the following command:

GET <server>:<port>/services/user/<user id>
Yes No

2.3.4.5.6.7.8.3.Retrieve a list of the available Users #

To retrieve a list of the Users use the following command:

GET <server>:<port>/services/user

The API will return a JSON with the following data:

{
  ":type": "urn:seluxit:xml:bastard:idlist-1.0",
  ":id": null,
  "id": [list users id],
  "@type": "urn:seluxit:xml:bastard:user-1.0"
}
Yes No

2.3.4.5.6.7.8.4.Retrieve a list of the Users in one location #

To retrieve a list of the Users use the following command:

GET <server>:<port>/services/location/<location id>/user

The API will return a JSON with the following data:

{
  ":type": "urn:seluxit:xml:bastard:idlist-1.0",
  ":id": <location id>,
  "id": [list users id],
  "@type": "urn:seluxit:xml:bastard:user-1.0"
}
Yes No

2.3.4.5.6.7.8.5.Add a new User in one Location #

To add a new User in one Location uses the following command:

POST <server>:<port>/services/location/<location id>/user

with the chosen Body in JSON format.

Yes No

2.3.4.5.6.7.8.6.Update a User #

To update a User you need to put it in the following way:

PUT <server>:<port>/services/location/<location id>/user

with the chosen Body in JSON format.

Yes No

2.3.4.5.6.7.8.7.Delete a User #

To delete a User use the following command:

DELETE <server>:<port>/services/user/<user id>
Yes No

2.3.4.5.6.7.8.8.Delete all the Users #

To delete all the Users use the following command:

DELETE <server>:<port>/services/user
Yes No

2.3.4.5.6.7.8.9.Possible Errors #

Yes No

2.3.4.5.6.7.8.9.Network #

2.3.4.5.6.7.8.9.1.Network Structure #

This is an example of a Network:

{
  ":type": "urn:seluxit:xml:bastard:network-1.0",
  ":id": "606f07a0-7739-455b-962b-7669d6a7f085",
  "name": "Network1",
  "device": [list devices]
}
  • :type : type of the object that we are looking, in this case it is urn:seluxit:xml:bastard:network-1.0".
  • :id : ID of the current Network.
  • name: name of the current Network.
  • device: an array with the list of the Devices installed on this Network.
Yes No

2.3.4.5.6.7.8.9.2.Retrieve a Network #

To retrieve a Network, use the following command:

GET <server>:<port>/services/network/<network id>
Yes No

2.3.4.5.6.7.8.9.3.Retrieve a list of Networks from a Location #

To retrieve a list of Networks from a Location, use the following command:

GET <server>:<port>/services/location/<location id>/network
Yes No

2.3.4.5.6.7.8.9.4.Add a Network in one Location #

To add a Network you need to know the ID of the Location and of the gateway that you are going to use. Then you use the following command:

To add a Network in one Location you need to post it in the following way:

POST <server>:<port>/services/location/<location id>/network

with the chosen Body in JSON format. The Network needs to have already a Gateway installed on the database.

Yes No

2.3.4.5.6.7.8.9.5.Update a Network #

To update a Network use the following command:

POST <server>:<port>/services/network/<network id>

with the chosen Body in JSON format.

Yes No

2.3.4.5.6.7.8.9.6.Delete a Network #

To delete a Network use the following command:

DELETE <server>:<port>/services/network/<network id>
Yes No

2.3.4.5.6.7.8.9.10.Device #

2.3.4.5.6.7.8.9.10.1.Device Structure #

This is an example of a Device:

{
  ":type": "urn:seluxit:xml:bastard:device-1.0",
  ":id": "2b412da8-9506-4fe6-ada7-c2625c3c95ef",
  "name": "DONGLE",
  "manufacturer": "Seluxit",
  "product": "1-Gateway",
  "version": "1-2.5.0-1.2.1-4668-1.0.2",
  "serial": "3034F8EE90155B4000000021",
  "protocol": "Lemonbeat",
  "communication": "Always Online",
  "included": "1",
  "status": [list statuses],
  "service": [list services],
  "configuration": [list configurations]
}

Another possible key is "description".

  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:device-1.0"
  • :id : ID of the current Device
  • name: name of the current Device
  • manufacturer: name of the company that create the device.
  • product: type of the device
  • version: version of the used device
  • serial: serial of the device
  • protocol: communication protocol used by the device
  • communication: status of the communication of the device
  • include:
  • description: a description of this device
  • status: an array with the list of the statutes set up on the device
  • service: an array with the list of the services installed on the device
  • configuration: an array with the list of the configurations set up on the device
Yes No

2.3.4.5.6.7.8.9.10.2.Retrieve a Device #

To retrieve a Device, use the following command:

GET <server>:<port>/services/device/<device id>
Yes No

2.3.4.5.6.7.8.9.10.3.Retrieve a list of Devices from a Network #

To retrieve a list of Actions from a Network, use the following command:

GET <server>:<port>/services/network/<network id>/device
Yes No

2.3.4.5.6.7.8.9.10.4.Add a Device in one Network #

To add a device use the following command:

POST <server>:<port>/services/network/<network id>/device

Note that if the Device does not really exist, the API will return an error message.

Yes No

2.3.4.5.6.7.8.9.10.5.Update a Device #

At the moment is not possible to update a Device.

Yes No

2.3.4.5.6.7.8.9.10.6.Delete a Device #

To delete a Device, use the following command:

DELETE <server>:<port>/services/device/<device id>
Yes No

2.3.4.5.6.7.8.9.10.7.Delete all Devices #

To delete all the Device from a Network, use the following command:

DELETE <server>:<port>/services/network/<network id>/device/
Yes No

2.3.4.5.6.7.8.9.10.11.Status #

A Status is used to report errors in the device.

Yes No

2.3.4.5.6.7.8.9.10.11.1.Status Structure #

This is an example of a Status:

{
  ":type": "urn:seluxit:xml:bastard:status-1.0",
  ":id": "35e8efd2-d3d2-11e5-b9ef-001a6500147c",
  "level": "error",
  "type": "application",
  "message": "STATUS_DEVICE_INCLUSION_FAILURE",
  "timestamp": "2016-02-15T10:52:30.574970Z"
}

Another possible key is "data".

  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:status-1.0"
  • :id : ID of the current Status
  • level: the possible levels are "important", "error", "warning", "info" and "debug"
  • type: it contains the type of error. The possible types are "public key", "memory information", "device description", "value description", "value", "parter information", "action", "calculation", "timer", "calendar", "statemachine", "firmware update", "configuration", "exi", "system", "application" and "gateway"
  • message; a code that describe what happen
  • timestamp: it needs to be a dateTime
  • data: optimal data for the Status
Yes No

2.3.4.5.6.7.8.9.10.11.2.Retrieve a Status by ID #

To retrieve a Status, you need to GET it in the following way:

GET <server>:<port>/services/status/<status id>
Yes No

2.3.4.5.6.7.8.9.10.11.3.Retrieve a list of Statuses from a Device #

To get a list of Statuses, use the following command:

GET <server>:<port>/services/device/<device id>/status
Yes No

2.3.4.5.6.7.8.9.10.11.4.Add a new Status in one Device #

The user cannot add Statuses on a Device. The Statuses will be created by the Device.

Yes No

2.3.4.5.6.7.8.9.10.11.5.Update a Status #

The user cannot modify Statuses on a Device. The Statuses will be modified by the Device.

Yes No

2.3.4.5.6.7.8.9.10.11.6.Delete a Status #

To delete a Status, you need to DELETE it in the following way

DELETE <server>:<port>/services/status/<status id>
Yes No

2.3.4.5.6.7.8.9.10.11.7.Delete all Statuses #

To delete all the Statuses of a device, you need to DELETE it in the following way

DELETE <server>:<port>/services/status/device/<device id>/status
Yes No

2.3.4.5.6.7.8.9.10.11.8.Possible Errors #

Yes No

2.3.4.5.6.7.8.9.10.11.12.Value #

A Value is used to describe each possible Values for a specific device. A Value can assign some limit to the values: as min, max or steps.

Yes No

2.3.4.5.6.7.8.9.10.11.12.1.Value Structure #

This is an example of a Value:

{
  ":type": "urn:seluxit:xml:bastard:value-1.0",
  ":id": "0d365991-62d2-4ecd-a7b7-7e4b0eaffca6",
  "name": "soil_humidity",
  "permission": "r",
  "type": "Humidity",
  "number": {
    "min": "0.000000",
    "max": "100.000000",
    "step": "1.000000",
    "unit": "percent"
    },
  "status": "ok",
  "value": [list values]
}

This value check the humidity of the soil. It can be only read by the User and it will have percentage Values between 0% and 100% with one steps of 1%.

Other possibles keys are "virtual", "period", "delta", "set", "string", "blob" and "xml".

  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:value-1.0"
  • :id : ID of the current Value
  • name: name of the current Value
  • permission: permissions of write and reading, it can be "r" (read only), "w" (write only), "rw" or "wr" (read and write)
  • type: indicate the type of the Value we are storing
  • number: contains some limitations of the data that we can receive in our device, as the minimum value, the maximum value, the steps-size between the values and the unit of the value. The unit is in the International System of Units (SI) format.
  • status: it can be "ok", "update" or "pending"
  • virtual: a boolean that specifies if the Value is Virtual or not
  • period:
  • delta:
  • set:
  • string: contains the max length og the string and the used encoding
  • blob: contains a max value and the used encoding
  • xml: contains the xsd file of the value, and possible namespaces.
  • value: an array of the Values connected with the Value

Header needed

To use the methods that follows you need these header:

  • Accept: application/json
  • Content-Type: application/json
  • X-Session: <session ID>
Yes No

2.3.4.5.6.7.8.9.10.11.12.2.Get a Value by ID #

To get a Value, you need to GET it in the following way:

GET <server>:<port>/values/value/<value id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.3.Get a list of Values from a Device #

To get a list of Values from a Device, use the following command:

GET <server>:<port>/values/device/<device id>/value
Yes No

2.3.4.5.6.7.8.9.10.11.12.4.Delete a Value #

To delete a list of Values, use the following command:

DELETE <server>:<port>/values/value/<value id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.5.Possible Errors #

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.State #

A State indicate the state of a Value, for example the temperature of a room or the status ON/OFF of a device. A "Report" state will record the data from the environment where the device lives, a "Control" state will record the data in relation of the changes managed by an User.

A State can have min, max and step in relation of its Value. If the State is not included in the min-max range, then it is capped to be with in this range. If the State do not conform the step size, then it is rounded down.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.1.State Structure #

This is an example of a State:

{
  ":type": "urn:seluxit:xml:bastard:state-1.0",
  ":id": "c2677811-cf12-47dd-81ea-4d3b71794556",
  "type": "Report",
  "timestamp": "2016-02-15T10:52:45.561090Z",
  "data": "5"
  "log": [list logs]
}

This means that a state of

Another possible key is "status".

  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:state-1.0"
  • :id : ID of the current State
  • type: it can be "Report" or "Control"
  • timestamp: it should be a dateTime. Denotes the time when we receive the last data from the Device
  • data: the data received from the device. A data can have min, max and step in relation of its Value. If the State is not included in the min-max range, then it is capped to be with in this range. If the State do not conform the step size, then it is rounded down.
  • status: it can be "Send", "Pending" or "Failed"
  • log: array of the Logs connected with the State
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.2.Retrieve a State #

To retrieve a State, you need to GET it in the following way

GET <server>:<port>/values/state/<state id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.3.Retrieve a list of States in one Value #

To retrieve a list of States from a Value, use the following command:

GET <server>:<port>/values/value/<value id>/state
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.4.Add a new State in one Value #

To add a State to one of your Value you need to post it in the following way:

POST <server>:<port>/values/value/<value id>/state
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.5.Update a State #

To update a State, you need to put it in the following way

PUT <server>:<port>/values/state/<state id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.6.Delete a State #

To delete a State, you need to deleteit in the following way

DELETE <server>:<port>/values/state/<state id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.7.Delete all States of a Session #

To delete a State of a Session use the following command:

DELETE <server>:<port>/values/value/<value id>/state
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.8.Possible Errors #

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.Log #

A Log is…

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.1.Log structure #

This is an example of a Log:

{
  ":type": "urn:seluxit:xml:bastard:log-1.0",
  ":id": "ef4ace4c-14c6-46a1-82c8-07830576b9a9",
  "type": "Hour",
  "timestamp": "2016-02-25T15:04:26.295690Z"
}
  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:log-1.0".
  • :id : ID of the current Log.
  • type: it can be "Hour", "Day", "Week", "Month", "Year" or "Raw"
  • timestamp: it should be a DateTime.
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.2.Retrieve a Log by ID #

To retrieve a Log, you need to GET it in the following way:

GET <server>:<port>/services/log/<log id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.3.Retrieve a list of Logs from a Configuration #

To get a list of Logs, use the following command:

GET <server>:<port>/services/value/<value id>/log
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.4.Retrieve data from a Log - Update a Log #

PUT <server>:<port>/services/log/<log id>

with in the Body what you want to retrieve and update. We send to information from log to obtain more information on the data received by the log.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.5.Add a new Log in one Value #

To add a new Log in one Value you need to post it in the following way:

POST <server>:<port>/services/value/<value id>/log

with the chosen Body in JSON format.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.6.Delete a Log #

To delete a Log ses:

DELETE <server>:<port>/services/log/<log id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.7.Delete all Logs of a Value #

To delete all Logs from a Value uses:

DELETE <server>:<port>/services/value/<value id>/log

NOTE: Since a Value cannot have more than one Log, this command is equivalent to the previous one.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.8.Possible Errors #

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.Configuration #

A Configuration is…

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.1.Configuration structure #

This is an example of a Configuration:

{
  ":type": "urn:seluxit:xml:bastard:configuration-1.0",
  ":id": "d9200c7c-d3ea-11e5-94df-001a65001500",
  "status": "active",
  "limits": {
    "partner": "5",
    "action": "30",
    "calendar": "20",
    "calculation": "30",
    "timer": "15",
    "statemachine": "10",
    "transactions": "40"
  },
  "partner": [list partners],
  "action": [list actions],
  "calendar": [list calendars],
  "calculation": [list calculations],
  "timer": [list timers],
  "statemachine": [list statemachines]
}
  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:configuration-1.0"
  • :id : ID of the current Configuration
  • status: it can be "idle", "active", "failed", "commit" or "started"
  • limits: denotes how many Partners, Actions, Calendars, Calculations, Timers and Statemachines this Configuration can have
  • partner: an array of the Partners associated with the Configuration
  • action: an array of the Actions associated with the Configuration
  • calendar: an array of the Calendars associated with the Configuration
  • calculation: an array of the Calculations associated with the Configuration
  • timer: an array of the Timers associated with the Configuration
  • statemachine: an array of the Statemachines associated with the Configuration
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.2.Configuration status #

To use a Configuration, it is necessary to understand its "status".

An active Configuration is a Configuration that it is in use on the Device. All the possible Actions that exists on the Device will be activated when an event is triggered (for example by a Calendar or by a Timer).

An idle Configuration is an available Configuration that can be activated on the Device. When you want to add (POST) a Configuration, the status of your Configuration must be "idle". Other statuses are not accepted when you POST a Configuration.

A commit Configuration is a Configuration that the User wants to change from status "idle" to status "active". To "commit" a configuration, the user must PUT a status "commit".

A failed Configuration is a Configuration that was refused by the Gateway after the user tried to "commit" it.

A started Configuration is a Configuration that was accepted by the Gateway and it is sent to the Device. Note that if this Configuration is refused by the Device the status will remain "started."

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.3.Example step 1: Retrieve the active Configuration of a Device #

To find the active Configuration of a Device, use the command:

GET <server>:<port>/services/device/67a72ff2-2283-11e6-8ac4-5be0c7178df9/configuration

where "67a72ff2-2283-11e6-8ac4-5abe0c7178df9" is the ID of the Device. This will return the list of the Configurations for the Device. By watching the statuses of the Configuration, the user can retrieve the active Configuration.

This can be done with the command:

GET <server>:<port>/services/configuration/21b3c126-2284-11e6-ab65-df06282d1afc

where "21b3c126-2284-11e6-ab65-df06282d1afc" is ID of the active Configuration.

In this example the following active Configuration on the Device handles a Temperature set point with ID "ad29f8dd-d180-420c-ba23-c8b11b27a31b".

{
  ":type": "urn:seluxit:xml:bastard:configuration-1.0",
  ":id": "35e115b8-d3d8-11e5-a061-c7f2006444de",
  "status": "active",
  "limits": {
    "partner": "5",
    "action": "30",
    "calendar": "20",
    "calculation": "30",
    "timer": "15",
    "statemachine": "10",
    "transactions": "40"
  },
  "partner": [ ],
  "action": [{
    ":type": "urn:seluxit:xml:bastard:action-1.0",
    ":id": "7b9ab4b3-74bd-40f2-a747-ab43c185909d",
    "set": {
      "value_id": "ad29f8dd-d180-420c-ba23-c8b11b27a31b",
      "number": "16"
    }
  }],
  "calendar": [{
    ":type": "urn:seluxit:xml:bastard:calendar-1.0",
    ":id": "ad0ae265-6b03-4b96-839d-444ff5803473",
    "start": "2016-05-25T12:00:00.000Z",
    "action_id": "7b9ab4b3-74bd-40f2-a747-ab43c185909d"
  }],
  "calculation": [],
  "timer": [],
  "statemachine": []
}

In particular, from this Configuration we can understand that on 25th of May 2016 at 12.00 the Temperature set point will be set up to 16°C. By reading step-by-step from the Configuration, we can see that our Calendar will start the 25th of May 2016 at 12.00 and it will call the Action with ID "7b9ab4b3-74bd-40f2-a747-ab43c185909d". In turn, this Action will set up to 16°C a Value with ID "ad29f8dd-d180-420c-ba23-c8b11b27a31b" (our Temperature set point).

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.4.Example step 2: Create a New Configuration #

Now we want to add a Calendar such that it will set up to 16°C also the 26th of May at 12.00. To do this we need to POST a new Configuration in the following way.

POST <server>:<port>/services/67a72ff2-2283-11e6-8ac4-5be0c7178df9/configuration

where "67a72ff2-2283-11e6-8ac4-5abe0c7178df9" is the ID of the Device. As body we can use the following JSON:

{
  ":type": "urn:seluxit:xml:bastard:configuration-1.0",
  "status": "idle",
  "limits": {
    "partner": "5",
    "action": "30",
    "calendar": "20",
    "calculation": "30",
    "timer": "15",
    "statemachine": "10",
    "transactions": "40"
  },
  "partner": [ ],
  "action": [{
    ":type": "urn:seluxit:xml:bastard:action-1.0",
    ":id": "b01e91a4-2282-11e6-84b0-f3747d9da4af",
    "set": {
      "value_id": "ad29f8dd-d180-420c-ba23-c8b11b27a31b",
      "number": "16"
    }
  }],
  "calendar": [{
    ":type": "urn:seluxit:xml:bastard:calendar-1.0",
    ":id": "cabfed96-2282-11e6-8cac-736a4958d1c9",
    "start": "2016-05-25T12:00:00.000Z",
    "action_id": "b01e91a4-2282-11e6-84b0-f3747d9da4af"
  },{
    ":type": "urn:seluxit:xml:bastard:calendar-1.0",
    ":id": "a0683b8e-2282-11e6-977c-ffa0eeff0d44",
    "start": "2016-05-26T12:00:00.000Z",
    "action_id": "b01e91a4-2282-11e6-84b0-f3747d9da4af"
  }],
  "calculation": [],
  "timer": [],
  "statemachine": []
}

Note the following facts:

  • The new Configuration is very similar to the old Configuration with the addition of a Calendar.
  • By adding a new Configuration we are adding new Actions, Calendars, Calculations, Timers, Statemachines and Partners. For this reason we need to assign a new ID to this new Services.
  • The IDs used to refer other objects needs to refer to the correct object. For this reason the "action_id" of the Calendar is changed to the ID of the new Action "b01e91a4-2282-11e6-84b0-f3747d9da4af". But the "value_id" inside the "set" of the Action remains the same since we didn’t create any new Value.
  • We don’t need to insert the ":id" of the new Configuration since it will be generated automatically by the API.
  • The number of Actions (1) and Calendars (2) is smaller than the limits of 30 Actions and 20 Calendars.
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.5.Example step 3: Send the New Configuration to the Device #

To commit this new Configuration to the Device, we need to change the status the Configuration to "commit" in the following way.

PUT <server>:<port>/services/configuration/de337754-2286-11e6-b8f2-8303f8d715c2

where "de337754-2286-11e6-b8f2-8303f8d715c2" is the ID of the new Configuration. As body we can use the following JSON:

{
  ":type": "urn:seluxit:xml:bastard:configuration-1.0",
  "status": "commit"
}

After received this commit Configuration, the API will try to send the Configuration to the Gateway. If the Gateway accepts the new Configuration, it will change the status of the new Configuration in "started". If the Gateway refuses the new Configuration, it will change the status in "failed".

After received this started Configuration, the Gateway will try to send the Configuration to the Device. If the Device accepts the new Configuration, the status of the new Configuration will be changed in "active". At the same time the old active Configuration’s status will e changed in "idle".

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.6.Retrieve a Configuration by ID #

To retrieve a Configuration, you need to GET it in the following way:

GET <server>:<port>/services/configuration/<configuration id>

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.7.Retrieve a list of Configurations from a Device #

To retrieve a list of Configurations from a Device, use the following command:

GET <server>:<port>/services/device/<device id>/configuration

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.8.Add a new Configuration in one Device #

To add a new Configuration use:

POST <server>:<port>/services/device/<device id>/configuration

with the data that you wish the Body. Remember to use "status": idle.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.9.Update a Configuration #

To update a Configuration use:

PUT <server>:<port>/services/configuration/<configuration id>

with the data that you wish the Body. Remember to use "status": commit.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.10.Delete a Configuration #

To delete a Configuration use:

DELETE <server>:<port>/services/configuration/<configuration id>

with the data that you wish the Body. Remember that you cannot delete a Configuration with its status "active".

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.11.Delete all Configurations #

Since there is always an "active" Configuration, it is not possible to delete at once all the Configurations on a Device.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.Action #

An Action is used to get, set, report or invoke a Value on the Device itself or on an other Device. An Action can also start and stop a timer.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.1.Action Structure #

This is an example of an Action:

{
  ":type": "urn:seluxit:xml:bastard:action-1.0",
  ":id": "1b251112-9196-4892-b88c-dcebdf87db92",
  "report": {
    "my_value_id": "14ae70eb-3f92-4617-8963-b49d10635cba",
    "partner_id": "cb42279b-567e-45a5-9c03-95043e57804e"
  }
}

Other possible keys of Action are "get", "set", "invoke", "start_timer" and "stop_time".

  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:action-1.0"
  • :id : ID of the current Action
  • get: this is an example:
  "get": {
    "value_id": "1e3cb6ad-c5d6-45b2-9b44-3839e19f3e85",
    "partner_id": "38637546-fa58-11e5-920f-efa5868a6010",
    "transport_mode": "0"
  }

It means that the Value ID 1e3cb6ad-c5d6-45b2-9b44-3839e19f3e85 should be retrieved from the Device with ID 38637546-fa58-11e5-920f-efa5868a6010. * value_id: (required) ID of the Value to retrieve * partner_id: ID of Device from where the Value should be retrieved. If not specified, the Value is from the Device itself * transport_mode: the transport mode the action should be send with (0: UDP, Fast and simple; 1: TCP, slow but more reliable)

  • set: this is an example:
  "set": {
    "value_id": "1e3cb6ad-c5d6-45b2-9b44-3839e19f3e85",
    "number": "20",
    "transport_mode": "0"
  }

It means that we will set to 20 the data of the Value with ID 1e3cb6ad-c5d6-45b2-9b44-3839e19f3e85. Other keys for set are "string", "hexBinary", "partner_id" and "calculation_id". * value_id: (required) ID of the Value to modify * partner_id: ID of Device from where the Value should be modified. If not specified, the Value is from the Device itself * transport_mode: the transport mode the action should be send with (0: UDP, Fast and simple; 1: TCP, slow but more reliable) * number / string / hexBinary / calculation_id: the value that we want to set in the Value.

  • report: this is an example:
  "report": {
    "my_value_id": "14ae70eb-3f92-4617-8963-b49d10635cba",
    "partner_id": "cb42279b-567e-45a5-9c03-95043e57804e"
  }

It means that we are sending a report to the Value with ID 14ae70eb-3f92-4617-8963-b49d10635cba, in the Device cb42279b-567e-45a5-9c03-95043e57804e. Another key is "transport_mode". * value_id: (required) ID of the Value used in the report * partner_id: ID of Device from where the Value should be reported. If not specified, the Value is from the Device itself * transport_mode: the transport mode the action should be send with (0: UDP, Fast and simple; 1: TCP, slow but more reliable)

  • invoke: this is an example:
  "invoke": {
    "my_value_id": "e5ba51e2-fa58-11e5-a4a7-cb4f6dba6e68",
    "partner_id": "fc2d2d32-fa58-11e5-b8bc-fbf9e3c674d6"
  }

It means that: …

  • start_timer: this is an example:
  "start_timer": {
    "timer_id": "93347ded-171f-4532-b399-d2b982c73b78"
  }

It means that we start the timer with id "timer_id". * timer_id: ID of the Timer.

  • stop_timer: this is an example:
  "stop_timer": {
    "timer_id": "51ea81de-fa59-11e5-bb0e-cb92e97521f1"
  }

It means that we stop the timer with id "timer_id". * timer_id: ID of the Timer.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.2.Retrieve a Action by ID #

To retrieve a Action, you need to GET it in the following way:

GET <server>:<port>/services/action/<action id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.3.Retrieve a list of Actions from a Configuration #

To retrieve a list of Actions from a Configuration, use the following command:

GET <server>:<port>/services/configuration/<configuration id>/action
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.4.Add a new Action in one Configuration #

To add an Action to one of your Configuration you need to post it in the following way:

POST <server>:<port>/services/configuration/<configuration id>/action

with the chosen Body in JSON format.

It is possible to add a Action only if the Configuration where it lives has status "idle". To activate a new Action on the Device remember to "commit" the Configuration where the Action lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.5.Update an Action #

To update an Action you need to put it in the following way:

PUT <server>:<port>/services/action/<action id>

with the chosen Body in JSON format.

It is possible to update a Action only if the Configuration where it lives has status "idle". To activate an updated Action on the Device remember to "commit" the Configuration where the Action lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.6.Delete a Action #

To delete an Action use the following command:

DELETE <server>:<port>/services/action/<action id>

It is possible to delete a Action only if the Configuration where it lives has status "idle". To remove a deleted Action on the Device remember to "commit" the Configuration where the Action lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.7.Delete all the Actions of a Configuration #

To delete an Action of a Configuration use the following command:

DELETE <server>:<port>/services/configuration/<configuration id>/action

It is possible to delete Actions only if the Configuration where it lives has status "idle". To remove the deleted Actions on the Device remember to "commit" the Configuration where the Actions lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.8.Possible Errors #

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.Calculation #

A Calculation consists of one operator and two sides: left and right. Calculations can include other Calculations to generate complex operations. It will return a number or a boolean in relation of the used method.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.1.Calculation Structure #

This is an example of a Calculation:

{
  ":type": "urn:seluxit:xml:bastard:calculation-1.0",
  ":id": "b469060b-6fee-4a05-9d87-924b24ab7895",
  "left": {
    "value_id": "14ae70eb-3f92-4617-8963-b49d10635cba"
    },
  "right": {
      "constant_number": "25"
  },
  "method": "smaller"
}

This Calculation check if the value with ID 14ae70eb-3f92-4617-8963-b49d10635cba is smaller than 25.

  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:calculation-1.0"
  • :id : ID of the current Calculation
  • method: the operation used in the calculation. Possible choices for the used method are "add", "subtract" "multiply", "divide", "modulo", "equal", "not_equal", "smaller", "greater", "smaller_or_equal", "greater_or_equal", "and" and "or".
  • left / right: a side can be a constant value, a reference to a value or another calculation.
  "left": {
    "value_id": "5b9fedbc-6bd1-499a-8e63-1d8b5c10eb8b",
    "is_updated": "true"
  }

Other possible value for left / right are: "partner_id" (with "value_id" and "is_updated"), "calculation_id", "statemachine_id", "timer_id", "calendar_id", "constant_number", "constant_string" and "constant_hxBinary"

Header needed

To use the methods that follows you need these header:

  • Accept: application/json
  • Content-Type: application/json
  • X-Session: <session ID>
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.2.Retrieve a Calculation by ID #

To retrieve a Calculation, you need to GET it in the following way:

GET <server>:<port>/services/calculation/<calculation id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.3.Retrieve a list of Calculations from a Configuration #

To retrieve a list of Calculations from a Configuration, use the following command:

GET <server>:<port>/services/configuration/<configuration id>/calculation
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.4.Add a new Calculation in one Configuration #

To add a Calculation to one of your Configuration you need to post it in the following way:

POST <server>:<port>/services/configuration/<configuration id>/calculation

with the chosen Body in JSON format.

It is possible to add a Calculation only if the Configuration where it lives has status "idle". To activate a new Calculation on the Device remember to "commit" the Configuration where the Calculation lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.5.Update a Calculation #

To update a Calculation to one of your Configuration you need to put it in the following way:

PUT <server>:<port>/services/calculation/<calculation id>

with the chosen Body in JSON format.

It is possible to update a Calculation only if the Configuration where it lives has status "idle". To activate an updated Calculation on the Device remember to "commit" the Configuration where the Calculation lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.6.Delete a Calculation #

To delete a Calculation use the following command:

DELETE <server>:<port>/services/calculation/<calculation id>

It is possible to delete a Calculation only if the Configuration where it lives has status "idle". To remove a deleted Calculation on the Device remember to "commit" the Configuration where the Calculation lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.7.Delete all the Calculations of a Configuration #

To delete all the Calculations of a Configuration use the following command:

DELETE <server>:<port>/services/configuration/<configuration id>/calculation

It is possible to delete Calculations only if the Configuration where it lives has status "idle". To remove the deleted Calculations on the Device remember to "commit" the Configuration where the Calculation lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.8.Possible Errors #

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.Calendar #

A Calendar is used to manage the time schedule of an Action. It says when to start and to end an Action and to repeat.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.1.Calendar Structure #

This is an example of a Calendar:

{
  ":type": "urn:seluxit:xml:bastard:calendar-1.0",
  ":id": "435e6e7d-beb6-499c-bfe7-2a71e8078193",
  "start": "2016-06-08T21:00:00.000Z",
  "action_id": "67aa3e03-8eac-45f0-aaa0-e770fd3e3f6a",
  "end": "2016-06-30T21:00:00.000Z",
  "repeat": "PT2H",
  "weekdays": {
    "monday": true,
    "tuesday": false,
    "wednesday": true,
    "thursday": true,
    "friday": false,
    "saturday": true,
    "sunday": false
  }
}

This means that the action with ID "435e6e7d-beb6-499c-bfe7-2a71e8078193" will have its first execution the 8th of June 2016 at 21:00 ("2016-06-08T21:00:00.000Z"). From that execution, it will repeat the same action every two hours ("PT2H") and it will end this timeschedule the 30th of June 2016 at 21.00 ("2016-06-30T21:00:00.000Z"). The command will not be executed on Tuesday, Friday and Sunday.

  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:calendar-1.0"
  • :id : ID of the current Calendar
  • action_id: ID of the Action that we want to start
  • start: it should be a DateTime. It indicates when to start an Action
  • end: (optional) it should be a DateTime. It indicates when to end a scheduled repetition of an Action
  • repeat: (optional) indicates if the task shall be repeated. The time use ISO 8601 standard. By default it is setup on no repetitions.
  • weekdays: (optional) on which weekdays the task should be executed. By default all the days of the week are setup as true.
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.2.Retrieve a Calendar by ID #

To retrieve a Calendar, you need to GET it in the following way:

GET <server>:<port>/services/calendar/<calendar id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.3.Retrieve a list of Calendars from a Configuration #

To retrieve a list of Calendars from a Configuration, use the following command:

GET <server>:<port>/services/location/<location id>/calendar
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.4.Add a new Calendar in one Configuration #

To add a Calendar to one of your Configuration you need to POST it in the following way:

POST <server>:<port>/services/configuration/<configuration id>/calendar

with the body in JSON format.

It is possible to add a Calendar only if the Configuration where it lives has status "idle". To activate a new Calendar on the Device remember to "commit" the Configuration where the Calendar lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.5.Update a Calendar #

To update a Calendar you need to PUT it in the following way:

PUT <server>:<port>/services/calendar/<calendar id>

with the body in JSON format.

It is possible to update a Calendar only if the Configuration where it lives has status "idle". To activate an updated Calendar on the Device remember to "commit" the Configuration where the Calendar lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.6.Delete a Calendar #

To delete a Calendar uses:

DELETE <server>:<port>/services/calendar/<calendar id>

It is possible to delete a Calendar only if the Configuration where it lives has status "idle". To remove a deleted Calendar on the Device remember to "commit" the Configuration where the Calendar lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.7.Delete all Calendars #

To delete all the Calendars of a Configuration uses:

DELETE <server>:<port>/services/configuration/<configuration id>/calendar/

It is possible to delete Calendars only if the Configuration where it lives has status "idle". To remove the deleted Calendars on the Device remember to "commit" the Configuration where the Calendar lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.8.Possible Errors #

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.Partner #

A Partner is used to map an address to a simple ID to reference other devices by their address by only using an ID.

The partner service also support grouping multiple partners into a group with a id. If the device sends to a group, the message will be send to all the partners in the group.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.1.Partner Structure #

This is an example of a Partner:

{
  ":type": "urn:seluxit:xml:bastard:partner-1.0",
  ":id": "cb42279b-567e-45a5-9c03-95043e57804e",
  "device_id": "1cda3f63-90a6-40f2-9df0-05e979cfb3d1"
}
  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:partner-1.0".
  • :id : ID of the current Partner.
  • device_id: ID of the Device partner of this Configuration
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.2.Get a Partner by ID #

To get a Partner, you need to GET it in the following way:

GET <server>:<port>/services/partner/<partner id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.3.Get a list of Partners #

To get a list of Partners, use the following command:

GET <server>:<port>/services/configuration/<configuration id>/partner
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.4.Add a new Partner in one Configuration #

To add a Partner to one of your Configuration you need to post it in the following way:

POST <server>:<port>/services/configuration/<configuration id>/partner

with the chosen Body in JSON format.

It is possible to add a Partner only if the Configuration where it lives has status "idle". To activate a new Partner on the Device remember to "commit" the Configuration where the Partner lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.5.Update a Partner #

To update a Partner to one of your Configuration you need to put it in the following way:

PUT <server>:<port>/services/partner/<partner id>

with the chosen Body in JSON format.

It is possible to update a Partner only if the Configuration where it lives has status "idle". To activate an updated Partner on the Device remember to "commit" the Configuration where the Partner lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.6.Delete a Partner #

To delete a Partner use the following command:

DELETE <server>:<port>/services/partner/<partner id>

It is possible to delete a Partner only if the Configuration where it lives has status "idle". To remove a deleted Partner on the Device remember to "commit" the Configuration where the Partner lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.7.Delete all the Partners of a Configuration #

To delete all the Partners of a Configuration use the following command:

DELETE <server>:<port>/services/configuration/<configuration id>/partner

It is possible to delete Partners only if the Configuration where it lives has status "idle". To remove the deleted Partners on the Device remember to "commit" the Configuration where the Partner lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.8.Possible Errors #

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.Timer #

A Timer will execute an Action with a delay.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.1.Timer Structure #

This is an example of a Timer:

{
  ":type": "urn:seluxit:xml:bastard:timer-1.0",
  ":id": "db068851-5403-44b3-8a88-bd81a128a18c",
  "after": "15000",
  "action_id": "a9096ba1-c6aa-4e7e-9b96-d851c0ab3051"
}

Another possible key is "calculation_id".

  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:timer-1.0"
  • :id : ID of the current Timer
  • after: the delay in millisecond managed by the Timer
  • action_id: the Action ID of the Action that should be delayed
  • calculation_id: the timer will execute only if the Calculation is true
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.2.Retrieve a Timer by ID #

To get a Timer, you need to GET it in the following way:

GET <server>:<port>/services/timer/<timer id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.3.Retrieve a list of Timers from a Configuration #

To get a list of Timers, use the following command:

GET <server>:<port>/services/configuration/<configuration id>/timer
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.4.Add a new Timer in one Configuration #

To add a Timer to one of your Configuration you need to post it in the following way:

POST <server>:<port>/services/configuration/<configuration id>/timer

with the chosen Body in JSON format.

It is possible to add a Timer only if the Configuration where it lives has status "idle". To activate a new Timer on the Device remember to "commit" the Configuration where the Timer lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.5.Update a Timer #

To update a Timer to one of your Configuration you need to put it in the following way:

PUT <server>:<port>/services/timer/<timer id>

with the chosen Body in JSON format.

It is possible to update a Timer only if the Configuration where it lives has status "idle". To activate an updated Timer on the Device remember to "commit" the Configuration where the Timer lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.6.Delete a Timer #

To delete a Timer use the following command:

DELETE <server>:<port>/services/timer/<timer id>

It is possible to delete a Timer only if the Configuration where it lives has status "idle". To remove a deleted Timer on the Device remember to "commit" the Configuration where the Timer lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.7.Delete all the Timers of a Configuratio #

To delete all the Timers of a Configuration use the following command:

DELETE <server>:<port>/services/configuration/<configuration id>/timer

It is possible to delete Timers only if the Configuration where it lives has status "idle". To remove the deleted Timers on the Device remember to "commit" the Configuration where the Timer lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.8.Possible Errors #

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.Statemachine #

A Statemachine is a collections of states and transactions. Each state of a Statemachine has its own ID so that it can be referenced. The StateMachine can be triggered by Timer events, Statemachine events, incoming value reports or local value updated.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.1.Statemachine Structure #

This is an example of a Statemachine:

{
  ":type": "urn:seluxit:xml:bastard:statemachine-1.0",
  ":id": "6ac112b9-b853-4ae5-bfb6-0106700038e4",
  "current_state": "2",
  "state": {
    "@id": "1",
    "transaction": {
      "action_id": "3dbdf2af-e431-4d12-a48e-30b29ce1f3e7",
      "goto_state": "2"
    }
  }
}
  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:statemachine-1.0".
  • :id : ID of the current Statemachine.
  • current_state:
  • state:
    • @id: ID of the state
    • transaction:
      • action_id: Action ID that the state machine will execute when this transaction is executed
      • goto_state: State ID of the state machine will enter when this transaction is executed
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.2.Retrieve a Statemachine by ID #

To retrieve a Statemachine, you need to GET it in the following way:

GET <server>:<port>/services/statemachine/<statemachine id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.3.Retrieve a list of Statemachines from a Configuration #

To retrieve a list of Statemachines from a Configuration, use the following command:

GET <server>:<port>/services/configuration/<configuration id>/statemachine
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.4.Add a new Statemachine in one Configuration #

To add a Statemachine to one of your Configuration you need to post it in the following way:

POST <server>:<port>/services/configuration/<configuration id>/statemachine

with the chosen Body in JSON format.

It is possible to add a Statemachine only if the Configuration where it lives has status "idle". To activate a new Statemachine on the Device remember to "commit" the Configuration where the Statemachine lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.5.Update a Statemachine #

To update a Statemachine to one of your Configuration you need to put it in the following way:

PUT <server>:<port>/services/statemachine/<statemachine id>

with the chosen Body in JSON format.

It is possible to update a Statemachine only if the Configuration where it lives has status "idle". To activate an updated Statemachine on the Device remember to "commit" the Configuration where the Statemachine lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.6.Delete a Statemachine #

To delete a Statemachine use the following command:

DELETE <server>:<port>/services/statemachine/<statemachine id>

It is possible to delete a Statemachine only if the Configuration where it lives has status "idle". To remove a deleted Statemachine on the Device remember to "commit" the Configuration where the Statemachine lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.7.Delete all the Statemachines of a Configuration #

To delete all the Statemachines of a Configuration use the following command:

DELETE <server>:<port>/services/configuration/<configuration id>/statemachine

It is possible to delete Statemachines only if the Configuration where it lives has status "idle". To remove the deleted Statemachines on the Device remember to "commit" the Configuration where the Statemachine lives.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.8.Possible Errors #

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.ACL #

An ACL is…

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.1.ACL Structure #

This is an example of an ACL:

{
  ":type": "urn:seluxit:xml:bastard:acl-1.0",
  ":id": "41db8430-f7d6-11e5-bbbc-db43e5402d79",
  "owner": "d841c288-f801-11e5-830b-c3b1d7b0e410",
  "global": ["read": true, "write": false, "control": "true"]
  "user": [
    {
      "id": c4c23304-f802-11e5-9c77-4fdde030e910,
      "read": true
    },
    {
      "id": c4c23304-f802-11e5-9c77-4fdde030e910,
      "write": false
    }
  ]
}
  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:action-1.0"
  • :id : ID of the current ACL
  • owner: ID of the owner of the ACL
  • global: to assign global permissions on reading, writing and controlling with "read", "write" and "control" respectively
  • user: to assign personal permissions on reading, writing and controlling with "read", "write" and "control" respectively
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.2.Retrieve an ACL by Location ID #

To retrieve an ACL use the following GET command:

GET <server>:<port>/services/acl/<location id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.3.Retrieve a list of ACL #

To retrieve a list of ACL, use the following command:

GET <server>:<port>/services/location/

Note: ACLs and Locations have the same ID. If you try to retrieve directly a list of ACL with the command:

GET <server>:<port>/services/acl/

you will obtain the following error: ERROR 403 Can’t list ACL’s

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.4.Add a new ACL #

To add a new ACL create a new Location with the command:

POST <server>:<port>/services/location

and the chosen Body in JSON format for your new Location.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.5.Add a User to ACL - Update an ACL #

To add a User to ACL use the following PUT command:

PUT <server>:<port>/services/acl/<location id>

with the chosen Body in JSON format.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.6.Delete an ACL #

To delete an ACL, you need to DELETE it in the following way

DELETE <server>:<port>/services/acl/<location id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.7.Possible Errors #

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.Gateway #

An Gateway is…

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.1.Gateway Structure #

This is an example of a Gateway:

{
  ":type": "urn:seluxit:xml:bastard:gateway-1.0",
  ":id": "606f07a0-7739-455b-962b-7669d6a7f085",
  "version": "1.1.9",
  "time_zone": " default (CET, +0100)",
  "vpn_ip": "10.142.0.22",
  "local_ip": "10.10.1.178",
  "wifinetwork": [list wifinetworks]
  "timezone": [list timezones]
}

Other possible keys are: "collector_endpoint", "uptime", "load", "memory", "feed", "auto_update" (boolean), "password", "network_key" and "antenna".

  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:gateway-1.0"
  • :id : ID of the current Gateway
  • version: Version of the current Gateway
  • time_zone:
  • vpn_ip:
  • local_ip:
  • wifinetwork:
  • collector_endpoint:
  • uptime:
  • load:
  • memory:
  • feed:
  • auto_update:
  • password:
  • network_key:
  • antenna:
  • timezone:
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.2.Retrieve a Gateway #

To retrieve a Gateway, use the following command:

GET <server>:<port>/services/gateway/<gateway id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.3.Retrieve a list of Gateways from a Location #

To retrieve a list of Gateways from a Location, use the following command:

GET <server>:<port>/services/location/<location id>/network

Note: Networks and Gateways have the same ID.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.4.Add a new Gateway in one Location #

To add a new Gateway create a new Network with the command:

POST <server>:<port>/services/location/<location id>/network

and the chosen Body in JSON format for your new Network.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.5.Update a Gateway #

To update a Gateway use the following command:

POST <server>:<port>/services/gateway/<gateway id>

with the chosen Body in JSON format.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.6.Delete a Gateway #

To delete a Gateway use the following command:

DELETE <server>:<port>/services/network/<network id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.Wifinetwork #

An Wifinetwork is…

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.1.Wifinetwork Structure #

This is an example of Wifinetwork:

{
  ":type": "urn:seluxit:xml:bastard:wifinetwork-1.0",
  ":id": "b3a6c4e9-1345-4e00-91a0-1d41dc3dd671",
  "ssid": "MyWifiNetwork 4",
  "signal": "strong"
}

Another possible key is "encryption".

  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:wifinetwork-1.0".
  • :id : ID of the current Gateway.
  • ssid
  • signal
  • encryption
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.2.Retrieve a Wifinetwork #

To retrieve a Wifinetwork, use the following command:

GET <server>:<port>/services/wifinetwork/<wifinetwork id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.3.Retrieve a list of Wifinetworks #

To retrieve a list of Wifinetwork, use the following command:

GET <server>:<port>/services/gateway/<gateway id>/wifinetwork
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.4.Add a new Wifinetworks #

It is not possible to add a Wifinetworks. If you try you will obtain the following error: ERROR 501 No add method for backend

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.5.Update a Wifinetwork #

To updae of Wifinetwork, use the following command:

PUT <server>:<port>/services/gateway/<gateway id>/wifinetwork

with the chosen Body in JSON format.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.6.Delete one or more Wifinetworks #

It is not possible to delete a Wifinetworks. If you try you will obtain the following error: ERROR 501 No delete method for backend

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.Timezone #

An Timezone is…

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.1.Timezone Structure #

This is an example of Timezone:

{
  ":type": "urn:seluxit:xml:bastard:timezone-1.0",
  ":id": "589a172a-06d3-4720-90af-0a3c70fab904",
  "name": "Africa/Abidjan"
}
  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:wifinetwork-1.0".
  • :id : ID of the current Gateway.
  • name: indicate the timezone where the Gateway is situated
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.2.Retrieve a Timezone #

To retrieve a Timezone, use the following command:

GET <server>:<port>/services/timezone/<timezone id>
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.3.Retrieve a list of Timezone #

To retrieve a list of Timezone, use the following command:

GET <server>:<port>/services/gateway/<gateway id>/timezone
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.4.Add a new Timezone #

It is not possible to add a Timezone. If you try you will obtain the following error: ERROR 501 No add method for backend

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.5.Update a Timezone #

To update of Timezone, use the following command:

PUT <server>:<port>/services/gateway/<gateway id>/timezone

with the chosen Body in JSON format.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.6.Delete one or more Timezones #

It is not possible to delete a Timezone. If you try you will obtain the following error: ERROR 501 No delete method for backend

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.7.Possible Errors #

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.Session #

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.1.Session structure #

This is an example of a Session:

{
  ":type": "urn:seluxit:xml:bastard:session-1.0",
  ":id": "21330b79-d66a-40c6-888e-b466d2f4ac5a"
}
  • :type : the type of the object that we are looking, in this case it is "urn:seluxit:xml:bastard:session-1.0".
  • :id : ID of the current Session. This Session ID is what you need as X-Session in the header of the other methods.
Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.2.start a new session - login #

To start a new Session and receive your Session ID, you need to POST your username and password in the following way

POST <server>:<port>/services/session

with the following Body in JSON format:

{  
  ":type": "urn:seluxit:xml:bastard:session-1.0",  
  "username": <username>,  
  "password": <password>  
}

The API will return a JSON with the following data:

{  
  ":type": "urn:seluxit:xml:bastard:session-1.0",  
  ":id": <session id>,  
  "username": <username>,  
}

The obtain <session id> is a uuid that denote the Session ID that you need to use as X-Session header.

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.3.Get the data of a session #

To get the data of the session use the following command

GET <server>:<port>/services/session/<session id>

Yes No

2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.4.Delete a session #

To delete a session, you need to DELETE it in the following way

DELETE <server>:<port>/services/session/<session id>

Yes No

3.Errors #

The possible statuses that an user can receive are the following:
Code Response
200 OK
201 Created
202 Accepted
301 Moved Permanently
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable
408 Request Timeout
409 Conflict
415 Unsupported Media Type
500 Internal Server Error
501 Not implemented
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
Each error (i.e. 4xx and 5xx statuses) can happen in different situations. In this section we analyze them.
Yes No

3.1.Error 400 Gateway is already registered to you #

By trying to install a new Gateway by using the same ID of an already registered Gateway on you, you will obtain a similar JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Gateway is already registered to you"
}

Solution

The used Gateway is already registered on you thus you don’t need to add it again.

Yes No

3.2.ERROR 400 Unsupported type #

If you use a wrong :type, you will receive the following JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Unsupported type urn:seluxit:xml:bastard:<wrongtype>-1.0"
}

Solution

Remember to use the correct :type in relation of the object that you are trying to retrieve or modify.

Yes No

3.3.ERROR 400 Invalid Email #

If you use a username that it is not a valid email, you will receive the following JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Invalid Email"
}

Solution

Use a valid email like "user@domain.com".

Yes No

3.4.ERROR 400 Invalid JSON #

If you insert a wrong JSON, you will receive the following JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Invalid JSON"
}

Solution

Be careful with the creation of your JSON. The keys need to be between double quotes "". At the end of any line, but the last, you need to use a comma ",". Remember the semicolon ":" between keys and values.

Yes No

3.5.ERROR 400 Password is missing #

If you forget to insert a password on the login, you will receive the following JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message":  "Password is missing"
}

Solution

Insert a password when you are creating a new session.

Yes No

3.6.ERROR 400 Username is missing #

If you forget to insert a username at the login, you will receive the following JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message":  "Username is missing"
}

Solution

Insert a username when you are creating a new session.

Yes No

3.7.ERROR 400 JSON must include type #

When you use POST, PUT or PATCH, you need to insert the ":type" in the JSON of the Body. Although you will receive the following JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "JSON must include type"
}

Solution

Insert the ":type" of the object that you are updating.

Yes No

3.8.ERROR 400 Can't delete active configuration #

If you delete a Configuration with an "active" status, you will receive the following JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Can't delete active configuration"
}

Solution

Check if the status of the Configuration is "active" or not. If you want to delete the Configuration, update the Configuration status in "idle", "commit", "failed" or "started".

Yes No

3.9.ERROR 400 Configuration status can only be 'idle' when creating a new configuration #

If you update a new Configuration with an "idle" status, you will receive the following JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Configuration status can only be 'idle' when creating a new configuration"
}

Solution

If you are updating a Configuration, change the Configuration status in "commit".

Yes No

3.10.ERROR 400 Configuration status can only be 'commit' when changing the status #

If you add new Configuration with a "commit" status, you will receive a similar JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Configuration status can only be 'commit' when changing the status"
}

Solution

If you add a Configuration, change the Configuration status in "idle".

Yes No

3.11.ERROR 400 'wrong event' is not a valid service #

If the insert address has a wrong service, you will obtain the following JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "'\<wrong event\>' is not a valid service"
}

Solution

Correct your address with a correct object.

Yes No

3.12.ERROR 400 'wrong uuid' is not a valid UUID #

If the insert address has a wrong UUID, you will obtain the following JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "'<wrong uuid>' is not a valid UUID"
}

Solution

Correct your address with valid UUIDs.

Yes No

3.13.ERROR 401 Unauthorized #

By using a wrong username or password, you will obtain the following JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Unauthorized"
}

Solution

Check that your username and password are correct.

Yes No

3.14.ERROR 401 X-session is not valid #

By using a wrong X-Session, you will obtain the following JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "X-session is not valid"
}

Solution

Create a new session ID and remember to insert it in the X-Session of the header.

Yes No

3.15.ERROR 403 Gateway is already registered #

If you try to register on you a Gateway already registered on other people, you will obtain the following JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Gateway is already registered"
}

Solution

Before to register the Gateway on you, you should unregister the Gateway from the other people.

Yes No

3.16.ERROR 403 Can't list ACL's #

You cannot list ACL. If you try, you will obtain the following JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Can't list ACL's"
}
Yes No

3.17.ERROR 404 Gateway not found #

By trying to add a non existent gateway, you will obtain a similar JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Not Found"
}

Solution

You are probably trying to install a non-existent Gateway. Check that the ID of the Gateway is the correct one and try again.

Yes No

3.18.ERROR 404 Collection is empty #

By trying to access an empty collection of objects, you will obtain a similar JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Collection is empty"
}
Yes No

3.19.ERROR 404 Not Found #

By trying to use a method on a deleted or a non existent object, you will obtain a similar JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Not Found"
}

Solution

Check that the insert address uses the correct IDs.

It is possible that some deleted elements are still visible when you try to get a collection of objects. This happen since Couchbase needs some time to update its database. Try to handle this mistake until Couchbase database is updated.

Yes No

3.20.ERROR 405 is not allowed #

If you try to use a not allowed method (GET, POST, PATCH, COPY, OPTIONS, LINK, …), you will receive a similar JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "POST is not allowed"
}
Yes No

3.21.ERROR 405 Method Not Allowed #

If you try to use a not allowed method in the registration you will receive a similar JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Method Not Allowed"
}

Solution

Sometimes it is possible that you are try to use a method on the wrong address. Check if you are using the correct one.

For example POST http://localhost:9292/services/location is a valid command, but POST http://localhost:9292/services/location/7c69cf54-f71c-11e5-8ccb-abd3630da0ed is not allowed.

Yes No

3.22.ERROR 409 ID is already used #

If you try to add an object with an already used ID, you will receive a similar JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "ID 32e3dcf0-f71a-11e5-ac10-1fb6455aaa79 is already used"
}

Solution

Use a different ID in the ":id" in the Body of the object that you are creating.

Yes No

3.23.ERROR 409 IDs do not match #

If you PUT an updated object with an ID different from the one of the object that you are updating you will receive a similar JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "ID's do not match"
}

Solution

Either you avoid to specify the ":id" in the Body or it needs to be the same of the ID’s object that you are updating.

Yes No

3.24.ERROR 409 Username already registered #

You cannot register the same user twice. If you try the user will return the following JSON.

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Username already registered"
}

Solution

Use a different username.

Yes No

3.25.ERROR 500 Result contains unsuccessful operations #

If you try to do invalid operations you will obtain a similar JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Result contains unsuccessfull operations"
}
Yes No

3.26.ERROR 500 ID not found in store #

By using a non existent ID when adding a new device, you will obtain the following JSON: ~ { ":type": "urn:seluxit:xml:bastard:httpresponse-1.0", "message": "ID not found in store" } ~

Solution

Check that the device is correctly installed in the database.

Yes No

3.27.ERROR 501 Replacing a complete collection is not supported #

If you try to replace a collection with the method PUT, you will receive a similar JSON:

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "Replacing a complete collection is not supported"
}

Solution

Don’t use PUT when in the address you can get a collection of objects.

Yes No

3.28.ERROR 501 No add method for backend #

You cannot add this object.

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "No add method for backend"
}
Yes No

3.29.ERROR 501 No delete method for backend #

You cannot delete this object.

{
  ":type": "urn:seluxit:xml:bastard:httpresponse-1.0",
  "message": "No delete method for backend"
}
Yes No