On the Root Resource, we can access the main service operations (CRUD), through the methods of the HTTP standard, as per table below:
CRUD | HTTP Methods |
---|---|
Create | POST |
Read | GET |
Update | PUT |
Delete | DELETE |
That is, in the /orders service of the example above, if we perform a GET operation, the response will be a list of orders, and if we perform a POST operation, a new order will be saved (available only in the Sandbox environment).
The table below shows all the operations we could perform on the /orders service:
Resource | GET | POST | PUT | DELETE |
---|---|---|---|---|
/orders | List of orders | Creates a new or multiple orders (when it allows batch) | * | * |
/orders/564 | Details of the order 564 *** | ** | Updates the order 564 | Deletes the order 564 |
/orders/564/orderItems | Items list of the order 564 | Creates a new item within the order 564 | * | * |
/orders/564/orderItems/1 | Details of item 1 of the order 564 | ** | Updates item 1 of the order 564 | Deletes item 1 of the order 564 |
* The method must not be implemented in collections, or the ERROR 405 - method not allowed is received
** The method must not be implemented in items, or the ERROR 405 - method not allowed is received. However, it is used in case of an asynchronous call.
*** As the order is an aggregating resource, it should return all the associated items, by default.
** The method must not be implemented in items, or the ERROR 405 - method not allowed is received. However, it is used in case of an asynchronous call.
*** As the order is an aggregating resource, it should return all the associated items, by default.
English