Big Postman task
API requirements
The intergalactic courier must be able to:
-
Request a list of orders available for delivery.
Only orders with status
CREATED. Orders in other statuses must not be returned.Method Endpoint Description GET /deliveriesGet information about all deliveries with status CREATED. -
Request detailed order information by order ID.
The response must contain the order description, sender and recipient name and address; additional fields are optional.
Method Endpoint Description GET /deliveries/{id}Get delivery information by order ID. The ID is passed as a path variable. -
Create a new order.
For each new order, the server must generate a unique ID and set the status
CREATED.Method Endpoint Description POST /deliveriesCreate a new order. Order data must be passed in the request body as JSON with the following fields:
Field Type Required Constraints description string + 1 to 50 characters from.name string + 1 to 30 characters from.address string + 1 to 50 characters to.name string + 1 to 30 characters to.address string + 1 to 50 characters client_comment string - up to 50 characters courier_comment string - up to 50 characters -
Update the order status by order ID.
Method Endpoint Description PATCH /deliveries/{id}Update the order status by order ID passed as a path variable. The new status is set in the request body as JSON with the following fields:
Field Type Required Constraints status string + CREATED, IN_PROGRESS, DELIVERED, CANCELLED courier_comment string - up to 50 characters
JWT authorization
All requests to the server API must be sent with a JWT token.
- Token lifetime: 30 minutes.
- The request to obtain a token is sent from the task UI.
- The token must be passed in the Authorization header with type Bearer Token.
Уровень повышен!