-
Notifications
You must be signed in to change notification settings - Fork 0
API
Request: POST /auth
Request body:
{
!"vk_access_token": STRING,
!"vk_user_id": INTEGER,
!"ruber_app_id": INT,
!"ruber_app_secret": STRING
}Request headers:
Accept=application/json
Content-Type=application/json
Response:
{
!"ruber_access_token": STRING,
!"id": INT
}Exceptions: INVALID_EXTERNAL_APP_CREDENTIALS
Request: POST /orders
Request params: !access_token
Request headers: Content-Type=application/json
Request body:
{
!"title": STRING,
"description": STRING,
!"status": ENUM("WAITING", "PAID", "DONE", "CANCELLED"),
"deadline_timestamp": LONG or NULL,
!"customer": {
!"name": STRING,
!"phone": STRING,
"vk_id": INTEGER or NULL
},
"shipment": {
!"address": STRING,
!"cost": POSITIVE BIGDECIMAL(scale = 2) e.g. "14.99"
},
"discount": {
!"title": STRING,
!"description": STRING,
!"thumb_photo": URL e.g. "http://google.com/pic1",
!"cost": POSITIVE BIGDECIMAL(scale = 2) e.g. "14.99"
},
!"item_replicas": [
{
!"title": STRING,
!"description": STRING,
!"thumb_photo": URL e.g. "http://google.com/pic1",
!"price": POSITIVE BIGDECIMAL(scale = 2) e.g. "14.99",
!"amount": INTEGER
},
...
],
!"vk_item_replicas": [
{
!"title": STRING,
!"description": STRING,
!"thumb_photo": URL e.g. "http://google.com/pic1",
!"price": POSITIVE BIGDECIMAL(scale = 2) e.g. "14.99",
!"amount": INTEGER,
!"vk_id": INTEGER,
!"vk_owner_id": INTEGER
},
...
]
}Response status: 201 CREATED
Response headers: Location: http://185.12.95.60:8081/ruber/orders/11
Exceptions: INVALID_ACCESS_TOKEN
Request: GET /orders/{id}
Request params: !access_token
Request headers: Accept=application/json
Response:
{
!"id": INTEGER,
!"title": STRING,
"description": STRING,
!"status": ENUM("WAITING", "PAID", "DONE", "CANCELLED"),
!"created_timestamp": LONG,
!"deadline_timestamp": LONG or NULL,
!"customer": {
!"name": STRING,
!"phone": STRING,
!"vk_id": INTEGER or NULL
},
!"shipment": NULL or {
!"address": STRING,
!"cost": POSITIVE BIGDECIMAL(scale = 2) e.g. "14.99"
},
!"discount": NULL or {
!"title": STRING,
!"description": STRING,
!"thumb_photo": URL e.g. "http://google.com/pic1",
!"cost": POSITIVE BIGDECIMAL(scale = 2) e.g. "14.99"
},
!"item_replicas": [
{
!"id": INTEGER,
!"title": STRING,
!"description": STRING,
!"thumb_photo": URL e.g. "http://google.com/pic1",
!"price": POSITIVE BIGDECIMAL(scale = 2) e.g. "14.99",
!"amount": INTEGER
},
...
],
!"vk_item_replicas": [
{
!"id": INTEGER,
!"title": STRING,
!"description": STRING,
!"thumb_photo": URL e.g. "http://google.com/pic1",
!"price": POSITIVE BIGDECIMAL(scale = 2) e.g. "14.99",
!"amount": INTEGER,
!"vk_id": INTEGER,
!"vk_owner_id": INTEGER
},
...
]
}Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER
Request: GET /orders
Request params: !access_token
Request headers: Accept=application/json
Response:
[
{
!"id": INTEGER,
!"title": STRING,
!"description": STRING,
!"status": ENUM("WAITING", "PAID", "DONE", "CANCELLED"),
!"order_positions": INTEGER,
!"pinned_items": INTEGER
},
...
]Exceptions: INVALID_ACCESS_TOKEN
Request: PUT /orders/{id}
Request params: !access_token
Request headers: Content-Type=application/json
Request body:
{
"title": STRING,
"description": STRING,
"status": ENUM("WAITING", "PAID", "DONE", "CANCELLED"),
"deadline_timestamp": LONG or NULL,
"discount": NULL or {
"title": STRING,
"description": STRING,
"thumb_photo": URL e.g. "http://google.com/pic1",
"cost": POSITIVE BIGDECIMAL(scale = 2) e.g. "14.99"
},
"shipment": NULL or {
"address": STRING,
"cost": POSITIVE BIGDECIMAL(scale = 2) e.g. "14.99"
},
"customer": {
"name": STRING,
"phone": STRING,
"vk_id": INTEGER or NULL
}
}Response status: 200 OK
Exceptions: INVALID_ACCESS_TOKEN, INVALID_REQUEST_JSON, NO_SUCH_ORDER, NOT_ENOUGH_ARGUMENTS if you try to create(not update) discount or shipment or deadline_timestamp but not specified some fields.
Request: GET /orders/{order_id}/item_replicas/{replica_id}
Request params: !access_token
Request headers: Accept=application/json
Response body:
{
!"id": INTEGER,
!"title": STRING,
!"description": STRING,
!"thumb_photo": URL e.g. "http://google.com/pic1",
!"price": POSITIVE BIGDECIMAL(scale = 2) e.g. "14.99",
!"amount": INTEGER
}Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER, NO_SUCH_ORDER_POSITION
Request: GET /orders/{order_id}/item_replicas
Request params: !access_token
Request headers: Accept=application/json
Response body:
[
{
!"id": INTEGER,
!"title": STRING,
!"description": STRING,
!"thumb_photo": URL e.g. "http://google.com/pic1",
!"price": POSITIVE BIGDECIMAL(scale = 2) e.g. "14.99",
!"amount": INTEGER
},
...
]Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER
Request: DELETE /orders/{order_id}/item_replicas/{replica_id}
Request params: !access_token
Request headers: -
Response status: 204 NO CONTENT
Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER, NO_SUCH_ORDER_POSITION
Request: POST /orders/{order_id}/item_replicas
Request params: !access_token
Request headers: Content-Type=application/json
Request body:
{
!"title": STRING,
!"description": STRING,
!"thumb_photo": URL e.g. "http://google.com/pic1",
!"price": POSITIVE BIGDECIMAL(scale = 2) e.g. "14.99",
!"amount": INTEGER
}Response status: 201 CREATED
Response headers: Location: http://185.12.95.60:8081/ruber/orders/11/item_replicas/14
Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER
Request: GET /orders/{order_id}/vk_item_replicas/{replica_id}
Request params: !access_token
Request headers: Accept=application/json
Response body:
{
!"id": INTEGER,
!"title": STRING,
!"description": STRING,
!"thumb_photo": URL e.g. "http://google.com/pic1",
!"price": POSITIVE BIGDECIMAL(scale = 2) e.g. "14.99",
!"amount": INTEGER,
!"vk_id": INTEGER,
!"vk_owner_id": INTEGER
}Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER, NO_SUCH_ORDER_POSITION
Request: GET /orders/{order_id}/vk_item_replicas
Request params: !access_token
Request headers: Accept=application/json
Response body:
[
{
!"id": INTEGER,
!"title": STRING,
!"description": STRING,
!"thumb_photo": URL e.g. "http://google.com/pic1",
!"price": POSITIVE BIGDECIMAL(scale = 2) e.g. "14.99",
!"amount": INTEGER,
!"vk_id": INTEGER,
!"vk_owner_id": INTEGER
},
...
]Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER
Request: DELETE /orders/{order_id}/vk_item_replicas/{replica_id}
Request params: !access_token
Request headers: -
Response status: 204 NO CONTENT
Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER, NO_SUCH_ORDER_POSITION
Request: POST /orders/{order_id}/vk_item_replicas
Request params: !access_token
Request headers: Content-Type=application/json
Request body:
{
!"title": STRING,
!"description": STRING,
!"thumb_photo": URL e.g. "http://google.com/pic1",
!"price": POSITIVE BIGDECIMAL(scale = 2) e.g. "14.99",
!"amount": INTEGER,
!"vk_id": INTEGER,
!"vk_owner_id": INTEGER
}Response status: 201 CREATED
Response headers: Location: http://185.12.95.60:8081/ruber/orders/11/vk_item_replicas/14
Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER
Request: GET /orders/{order_id}/pinned_messages/{message_id}
Request params: !access_token
Request headers: Accept=application/json
Response body:
{
!"id": INTEGER,
!"position": INTEGER,
!"vk_message_id": LONG,
!"created_timestamp": LONG
}Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER, NO_SUCH_PINNED_ITEM
Request: GET /orders/{order_id}/pinned_messages
Request params: !access_token
Request headers: Accept=application/json
Response body:
[
{
!"id": INTEGER,
!"position": INTEGER,
!"vk_message_id": LONG,
!"created_timestamp": LONG
},
...
]Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER
Request: DELETE /orders/{order_id}/pinned_messages/{message_id}
Request params: !access_token
Request headers: -
Response status: 204 NO CONTENT
Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER, NO_SUCH_PINNED_ITEM
Request: POST /orders/{order_id}/pinned_messages
Request params: !access_token
Request headers: Content-Type=application/json
Request body:
{
!"position": INTEGER,
!"vk_message_id": LONG
}Response status: 201 CREATED
Response headers: Location: http://185.12.95.60:8081/ruber/orders/11/pinned_messages/14
Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER
Request: GET /orders/{order_id}/pinned_texts/{text_id}
Request params: !access_token
Request headers: Accept=application/json
Response body:
{
!"id": INTEGER,
!"position": INTEGER,
!"text": STRING,
!"created_timestamp": LONG
}Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER, NO_SUCH_PINNED_ITEM
Request: GET /orders/{order_id}/pinned_texts
Request params: !access_token
Request headers: Accept=application/json
Response body:
[
{
!"id": INTEGER,
!"position": INTEGER,
!"text": STRING,
!"created_timestamp": LONG
},
...
]Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER
Request: DELETE /orders/{order_id}/pinned_texts/{text_id}
Request params: !access_token
Request headers: -
Response status: 204 NO CONTENT
Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER, NO_SUCH_PINNED_ITEM
Request: POST /orders/{order_id}/pinned_texts
Request params: !access_token
Request headers: Content-Type=application/json
Request body:
{
!"position": INTEGER,
!"text": STRING
}Response status: 201 CREATED
Response headers: Location: http://185.12.95.60:8081/ruber/orders/11/pinned_texts/14
Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER
Request: GET /orders/{order_id}/pinned_files/{file_id}
Request params: !access_token
Request headers: Accept=application/json
Response body:
{
!"id": INTEGER,
!"position": INTEGER,
!"file_name": STRING,
!"created_timestamp": LONG
}Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER, NO_SUCH_PINNED_ITEM
Request: GET /orders/{order_id}/pinned_files
Request params: !access_token
Request headers: Accept=application/json
Response body:
[
{
!"id": INTEGER,
!"position": INTEGER,
!"file_name": STRING,
!"created_timestamp": LONG
},
...
]Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER
Request: GET /orders/{order_id}/pinned_files/{file_id}/content
Request params: !access_token
Request headers: Accept=application/octet-stream
Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER, NO_SUCH_PINNED_ITEM
Request: DELETE /orders/{order_id}/pinned_files/{file_id}
Request params: !access_token
Request headers: -
Response status: 204 NO CONTENT
Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER, NO_SUCH_PINNED_ITEM
NOTE! This is a multipart request. You must follow the appropriate standart
Request: POST /orders/{order_id}/pinned_files/{file_id}
Request params: !access_token
Request headers: Accept=application/json, Content-Type=multipart/form-data; boundary={boundary}
Request body: link
Request notes: do not forget about the boundary in Content-Type=multipart/form-data header. You must set the position parameter for this pinned file in requeset body. See the request body link.
Response status: 201 CREATED
Response headers: Location: http://185.12.95.60:8081/ruber/orders/12/pinned_files/43
Exceptions: INVALID_ACCESS_TOKEN, NO_SUCH_ORDER, MULTIPART_IO_EXCEPTION
Request: GET /connected_groups
Request params: !access_token
Request headers: Accept=application/json
Response body:
[
INTEGER,
INTEGER,
INTEGER,
...
]Exceptions: INVALID_ACCESS_TOKEN
Request: POST /connected_groups
Request params: !access_token
Request headers: Content-Type=application/json
Request body:
{
!"vk_group_id": INTEGER
}Response status: 201 CREATED
Exceptions: INVALID_ACCESS_TOKEN, INVALID_REQUEST_JSON if vk_group_id is missed or null
Request: DELETE /connected_groups/{vk_group_id}
Request params: !access_token
Request headers: -
Response status: 204 NO CONTENT
Exceptions: INVALID_ACCESS_TOKEN