-
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
}Object Group
{
!"id": INT,
!"name": STRING,
!"photo_50": STRING URL,
!"photo_100": STRING URL,
!"photo_200": STRING URL,
!"market": Market
}Object Market
{
!"enabled": BOOLEAN,
"items_count": INT
}Request: GET /groups
Request params: count, offset, !access_token
Request headers: Accept=application/json
Response:
{
!"count": INT,
!"groups": Group[]
}Request: PUT /groups/:id where id is a POSITIVE INTEGER (group id)
Request headers:
Accept=application/json
Content-Type=application/json
Request params: !access_token
Request body:
{
!"market": INTEGER 1 or 0,
!"messages": INTEGER 1 or 0,
!"market_contact": INTEGER user_id or 0(community messages)
}Request body notes: Set messages = 1 with market_contact = user_id then make another request with market_contact = 0 if you want to set the group as a market contact.
Response status: 200 OK
Object Item
{
!"id": INT,
!"owner_id": NEGATIVE_INT,
!"title": STRING,
!"description": STRING,
!"price": {
!"amount": INT,
!"currency":{
!"id": INT,
!"name": STRING
},
!"text": STRING
},
!"category": {
!"id": INT,
!"name": STRING,
!"section": {
!"id": INT,
!"name": STRING
}
},
!"thumb_photo": STRING,
!"date": INT,
!"availability": INT
}Request: GET /items
Request params: !owner_id - negative integer(vk group id), count, offset, !access_token
Request headers: Accept=application/json
Response:
{
!"count": INT,
!"items": Item[]
}Request: GET /items/:id, where id is item id
Request params: !owner_id - negative integer(vk group id), !access_token
Request headers: Accept=application/json
Response:
{
!"item": Item
}Request: DELETE /items/:id, where id is item id
Request params: !owner_id - negative integer(vk group id), !access_token
Request headers: Accept=application/json
Response status: 204 NO CONTENT
NOTE! This is a multipart request. You must follow the appropriate standart
Request: POST /items
Request params: !access_token
Request headers: Accept=application/json, Content-Type=multipart/form-data
Request body: link
Request body notes:
item_info json part is required only. If has_photo_X param set to true in item_info json then photo_X_id or photo_X_raw should be presented. Also main_photo_id or main_photo_raw should be presented but only one of them. JPG, PNG and GIF pictures formats are supported. Min picture size is 400x400 px.
Response status: 201 CREATED
Response headers: Location: http://185.12.95.60:8081/ruber/items/128229
NOTE! This is a multipart request. You must follow the appropriate standart
Request: PUT /items/:id where id is item id
Request params: !access_token
Request headers: Accept=application/json, Content-Type=multipart/form-data
Request body: link
Request body notes:
item_info json part is required only. If has_photo_X param set to true in item_info json then photo_X_id or photo_X_raw should be presented. Also main_photo_id or main_photo_raw should be presented but only one of them. JPG, PNG and GIF pictures formats are supported. Min picture size is 400x400 px.
Response status: 200 OK
Request: POST /orders
Request params: !access_token
Request headers: Accept=application/json, Content-Type=application/json
Request body:
{
!"title": STRING,
!"customer_id": INT,
!"created_timestamp": LONG,
"deadline_timestamp": LONG,
!"shipment_cost": INT,
!"status": ENUM(WAITING, PAID, DONE, CANCELLED),
"order_positions":[
{
"vk_id" : INT,
"vk_owner_id": INT,
!"title": STRING,
!"description": STRING,
!"price": INT,
!"amount": INT,
!"thumb_photo": STRING_URL
},
...
]
}Response status: 201 CREATED
Response headers: Location: http://185.12.95.60:8081/ruber/orders/11
Request: GET /orders/:id, where id is order id