API Documentation

This is the api description for the course REST API Testing on URN.

API

Base URL: 'http://www.answerit.ru' 1. Resource: /api/testing/get Method: GET Response: 200 OK 2. Resource: /api/put Method: PUT Response: 200 OK 3. Resource: /api/order/<int:put_id> Method: PUT Response: 200 OK Order with id <put_id> was added to the system. Thank you! Base URL: 'http://www.answerit.ru' … 4. Resource: /api/prod_order/<int:prod_order_id> Method: PUT Allowed prod_order_id:[10000;20000] Responses: 200 OK application/json {"Success":"PO with id <int:prod_order_id> created."} Order out of allowed range: 412 Precondition Failed application/json {"Error":"This order value is not allowed"} 5. Resource: /api/multiply_two/ Method: GET Response: 200 OK This endpoint allows to multiply numbers. Use POST method to send two numbers factor_1 and factor_2 of type int or float. format request body as JSON. Response will include info about their product. Method: PUT Parameters: factor_1,factor_2 : float Responses: 200 OK application/json {"Success":"Product of %factor_1% and %factor_2% is %product%"} where %product% = %factor_1% * %factor_2% 412 Precondition Failed if factor_% is not integer or float application/json {"Error 412":"factor_% is not a number"} Method: POST Body: { "factor_1" : float, "factor_2" : float } Responses: 200 OK application/json {"Success":"Product of %factor_1% and %factor_2% is %product%"} where %product% = %factor_1% * %factor_2% …