You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A single top level ‘/things’ resource should be used to create (POST), read and search (GET), update (PUT) and delete things (DELETE).
for consistency, the following URLs should be merged into one - /things
POST /thing -> POST /things
PUT /thing -> PUT /things
GET /thing/search -> GET /things
Events
A single top level ‘/events’ resource or a sub-resource of /things should be used to create, read, update and delete events
this could be:
/things/{thing-id}/events
If events are sub-resources of things
or
/events/{thing-id}
or
/events?{query-params}
/events/{event-id}
If they can be addressed independently of things
You should use HTTP methods as follows
GET - gets events for the thing
POST - adds a new event
PUT - updates an event by id
DELETE - deletes an event by id
Event Sub-Resources
Info
Info should not be in a sub-field -- can’t we just add top level fields to an event? Currently there is a POST to update an event, and a PUT to update the ‘info’ field of an event. Shouldn’t PUT to the event resource update the info fields? If info is an event sub-resources, these should be appended to the event resource e.g.
PUT /things/{thing-id}/events/{event-id}/info
or
PUT /events/{thing-id}/{event-id}/info
Content? or Data?
Related to above, /events/data, It looks like event ‘content’ is called ‘data’ in the representation. This is an event sub-resource, like info it looks like. A better URL would be:
/events/thing-id/event-id/data
or
/data
The text was updated successfully, but these errors were encountered:
Things
A single top level ‘/things’ resource should be used to create (POST), read and search (GET), update (PUT) and delete things (DELETE).
for consistency, the following URLs should be merged into one - /things
POST /thing -> POST /things
PUT /thing -> PUT /things
GET /thing/search -> GET /things
Events
A single top level ‘/events’ resource or a sub-resource of /things should be used to create, read, update and delete events
this could be:
/things/{thing-id}/events
If events are sub-resources of things
or
/events/{thing-id}
or
/events?{query-params}
/events/{event-id}
If they can be addressed independently of things
You should use HTTP methods as follows
GET - gets events for the thing
POST - adds a new event
PUT - updates an event by id
DELETE - deletes an event by id
Event Sub-Resources
Info
Info should not be in a sub-field -- can’t we just add top level fields to an event? Currently there is a POST to update an event, and a PUT to update the ‘info’ field of an event. Shouldn’t PUT to the event resource update the info fields? If info is an event sub-resources, these should be appended to the event resource e.g.
PUT /things/{thing-id}/events/{event-id}/info
or
PUT /events/{thing-id}/{event-id}/info
Content? or Data?
Related to above, /events/data, It looks like event ‘content’ is called ‘data’ in the representation. This is an event sub-resource, like info it looks like. A better URL would be:
/events/thing-id/event-id/data
or
/data
The text was updated successfully, but these errors were encountered: