Skip to content

apidoc_category

Arthur Chistyak edited this page Sep 11, 2016 · 2 revisions

Plan And Do API documentation

CATEGORIES

/categories

GET ?token=abc...123&device_id=456aaa

передаём также user_id

request

empty

CategoryController getMany()

Нам не нужен is_deleted

response

{
    "status": 200,
    "data": {
        {
            "id": "1",
            "user_id": 1,
            "category_name": "work",
            "is_deleted": 0,
            "category_sync_status": 14254564,
        },
        {
            "id": "2",
            "user_id": 1,
            "category_name": "home",
            "is_deleted": 0,
            "category_sync_status": 14254564,
        }        
    }
}

/category/{id}:

GET ?token=abc...123&device_id=456aaa
request

empty

CategoryController getOne($id)
response

{
    "status": 200,
    "data": {
        {
            "id": "1",
            "user_id": 1,
            "category_name": "work",
            "is_deleted": 0,
            "category_sync_status": 14254564,
        },
    }
}

/category/add

POST request

{
    "token": "abc...123", 
    "device_id": "456aaa",
    "user_id": 1,
    "category_name": "movies",
} 

CategoryController add()
response

{
    "status": 200,
    "data": {
             "id": 3
            }
} 

###/category/edit/{id}
GET ?token=abc...123&device_id=456aaa
request

empty

CategoryController getOne($id)
response

{
    "status": 200,
    "data": {
        {
            "id": "1",
            "user_id": 1,
            "category_name": "work",
            "is_deleted": 0,
            "category_sync_status": 14254564,
        },
    }
} 

###/category/update
POST request

{
    "token": "abc...123",
    "device_id": "456aaa",
    "user_id": 1,
    "id": 3,
    "category_name": "films",
} 

CategoryController update()
response

{
    "status": 200
} 

###/category/delete
POST request

{
    "token": "abc...123",
    "device_id": "456aaa",
    "user_id": 1,
    "id": 3, 
} 

CategoryController delete()
response

{
    "status": 200
} 
Clone this wiki locally