Skip to content

Instantly share code, notes, and snippets.

@stepun
Last active November 21, 2018 14:57
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/1bafa9dd3ab9f100e74d to your computer and use it in GitHub Desktop.
Save stepun/1bafa9dd3ab9f100e74d to your computer and use it in GitHub Desktop.
API Operations

API Operations

Operation by id

Resource URL

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

Resource Information

  • Response formats JSON
  • Requires authentication? Yes

Parameters

Name Require Type Description
id yes int(10) default = null. Identifier operation. Primary key.

Example Request

GET /api/v1_operation.json/101 HTTP/1.1
Host: storencash.com
token: 15da7169ee5272b97692ff680cab97f5
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded

Example Result

{
    "status": "success",
    "data": {
        "model": {
            "id": 13,
            "pu": 1,
            "name": "Автоприход",
            "kname": "Автоприход",
            "pname": "",
            "pvp": 0,
            "nsi": "",
            "ves": 0,
            "sgro_id": 2,
            "pus": 6,
            "date": null,
            "time": "",
            "cname": null,
            "docname": "",
            "bank": "",
            "colorname": ""
        }
    }
}

List operations

Resource URL

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

Resource Information

  • Response formats JSON
  • Requires authentication? Yes

Parameters

Name Require Type Description
timestamp no int(11) default = 0. Получить данные с данной даты (Time Stamp формат - количество миллисекунд с 1 января 1970 года. Необходим для получения обновленных данных).

Example Request

GET /api/v1_operation.json?timestamp=1474247810 HTTP/1.1
Host: storencash.com
token: e1ec049b388fbc7f2f9dca44dcbfde06
Cache-Control: no-cache

Example Result

{
  "status": "success",
  "data": {
    "collection": [
      {
        "colorname": "#727cb6",
        "bank": "Покупатель",
        "docname": "заказ",
        "date": "2016-09-21",
        "id": 3,
        "kname": "Продажа!",
        "pname": "Продать",
        "cname": "Покупателя",
        "name": "Продажа!",
        "nsi": "as_sabor",
        "pu": 2,
        "pvp": 1,
        "time": "10:07:14",
        "sgro_id": 1,
        "pus": 2,
        "ves": 1,
        "timestamp": 1474434434
      }
    ],
    "total": 1,
    "count": 1,
    "handbooks": {
      "sgro": [
        {
          "id": 1,
          "name": "Системные базовые неизменяемые операции"
        },
        {
          "id": 2,
          "name": "Прикладные изменяемые операции - для автоматического назначения"
        },
        {
          "id": 3,
          "name": "Прикладные изменяемые операции"
        }
      ]
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment