Skip to content

Instantly share code, notes, and snippets.

@stepun
Last active November 21, 2018 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stepun/62770ed5af08d869ebb5a262055fba53 to your computer and use it in GitHub Desktop.
Save stepun/62770ed5af08d869ebb5a262055fba53 to your computer and use it in GitHub Desktop.

API по сотрудникам

List staff

Resource URL

https://storencash.com/api/v1_staff.json

Resource Information

  • Response formats JSON
  • Requires authentication? Yes

Parameters

Name Require Type Description
timestamp no int(11) default = 0. Получить данные с данной даты (Time Stamp формат - количество миллисекунд с 1 января 1970 года. Необходим для получения обновленных данных).
page no int(10) default = 0. Page.
count no int(10) default = 1000. Count models in page. Limit max 1000 models in one request!

Example Request

GET /api/v1_staff.json?page=0&count=2&timestamp=1474277290 HTTP/1.1
Host: storencash.com
token: 15da7169ee5272b97692ff680cab97f5
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded

Example Result

{
  "status": "success",
  "data": {
    "collection": [
      {
        "id": 1,
        "time": "13:38:57",
        "username": "Васильев Александр Сергеевич usernametest",
        "prim": "",
        "prof": "",
        "sroles_id": "1",
        "locale": "ru_RU",
        "status": "1",
        "personal_id": "123DV212",
        "login": "test1504@gmail.com",
        "date": "2016-09-20",
        "password": "$2y$14$zI4bpJiVuNfqboAMW9hmbuYMHwUyBjHktgn8uIedY1YOFGbT7q/9a",
        "timestamp": 1474360737,
        "access_list":[{
        "operations":[{
          "svop_name": "Приход",
          "svop_id": 1,
          "allow": true
        }],
        "storage_name": "Основной склад",
        "storage_id": 1,
        "allow": true
      }]
      }
    ],
    "total": 1,
    "count": 1
  }
}

GET staff by ID

Resource URL

https://storencash.com/api/v1_staff.json

Resource Information

  • Response formats JSON
  • Requires authentication? Yes

Parameters

Name Require Type Description
id yes int(10) identifier staff. Primary key.

Example Request

GET /api/v1_staff.json/1 HTTP/1.1
Host: storencash.com
token: e1ec049b388fbc7f2f9dca44dcbfde06
Cache-Control: no-cache

Example Result

{
  "status": "success",
  "data":{
    "model":{
      "id": 1,
      "time": "18:06:33",
      "nuser": "test00",
      "prim": "",
      "prof": "",
      "sroles_id": "1",
      "locale": "ru_RU",
      "status": "1",
      "personal_id": "123DV212",
      "login": "test00@gmail.com",
      "date": "2018-01-15",
      "password": "$2y$14$WI2CzQdbPqLWi6lv8HUTDOhd4Mf4ydy7aXjq9d8HTUijuFfclLuHq",
      "timestamp": 1516017993,
      "username": "test00",
      "access_list":[{
        "operations":[{
          "svop_name": "Приход",
          "svop_id": 1,
          "allow": true
        }],
        "storage_name": "Основной склад",
        "storage_id": 1,
        "allow": true
      }]
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment