Files
MuditaOS/doc/os_api/protocol_description/methods.md
Lukasz Mastalerz 6da8494988 [CP-1713] Publish OS API as MVP to our community
Publishing Protocol Description section to our community.
Publishing two endpoints: Device Info Endpoint and Contacts Endpoint.
2022-11-10 08:24:18 +01:00

1.8 KiB
Raw Permalink Blame History

Methods

Methods indicate the desired action to be performed for a given resource. See: Common parameters explanation

Get

  • Used to retrieve resources, and not to modify it in any way.
  • Do not change the state of a resource.

Response codes:

  • If a resource is found, the response code is 200.
  • If a resource is not found, the response code is 404.
  • If an internal server error occurred, the response code is 500.

Post

  • Used to create a new resource into the collection of resources.

Response codes:

  • If a resource has been created, and response contains body field, the response code is 200.
  • If a resource has been created, but response contains no body field, the response code is 204.
  • If a request is incorrect, the response code is 400
  • If an internal server error occurred, the response code is 500.

Put

  • Used to update an existing resource.
  • If the resource doesnt exist, the Put method doesnt create it.

Response codes:

  • If a resource has been modified, and response contains body field, the response code is 200.
  • If a resource has been modified, but response contains no body field, the response code is 204.
  • If a request is incorrect, the response code is 400.
  • If a resource doesnt exist, the response code is 404.
  • If an internal server error occurred, the response code is 500.

Del

  • Use to delete a resource.

Response codes:

  • If a resource has been deleted, and response contains body field, the response code is 200.
  • If a resource has been deleted, but response contains no body field, the response code is 204.
  • If a request is incorrect, the response code is 400.
  • If a resource doesnt exist, the response code is 404.
  • If an internal server error occurred, the response code is 500.