ENG  РУС
>

API

Protocol description

General format of URL process: https://www.corezoid.com/api/1/json/{API_LOGIN}/{GMT_UNIXTIME}/{SIGNATURE}

where identifiers in curly brackets define the following parameters:

  • {API_LOGIN} - login for API authorization, received from the service, obligatory parameter.
  • {GMT_UNIXTIME} - request time, in unix time format, in seconds (epoch time), according to Greenwich (GMT+0), integer number, obligatory parameter.
  • {SIGNATURE} - request signature, obligatory parameter, capitalization is not important, counted according to the formula: hex( sha1({GMT_UNIXTIME} + {API_SECRET} + {CONTENT} + {API_SECRET}) ), where
    • hex() - function bringing binary data into hexadecimal format
    • sha1() - standard hash function SHA-1, returns bynary data
    • + - concatenation of text line
    • {API_SECRET} - private key sent with login {API_LOGIN}
    • {CONTENT} - request body

Whole request is in http body, it was described before in the signature forluma as {CONTENT}.

utf-8 text coding. It fully conforms to the standard and is sent with the following http header:

  • For "json" protocol format: Content-type: application/json; charset=utf8

Request/response format

Request is sent in the form of list of operations :

{
  "ops": [
    {
      "type": "create",
      "obj": "conv"/*…*/
    },
    {
      "type": "modify",
      "obj": "node",
      "obj_id": "n1234"/*…*/
    }
  ]
}
  • type - operation type.
  • obj - type of object on which operation is performed.
  • obj_id - identifier of object on which operation is performed.

Response is sent in the form of list of operations corresponding to operations of request:

{
  "request_proc": "ok",
  "ops": [
    {
      "obj": "conv",
      "obj_id": "1234",
      "proc": "ok"
    },
    {
      "obj": "node",
      "obj_id": "n1234",
      "proc": "obj_id_not_found"
    }/*…*/
  ]
}
  • request_proc - global status of whole package processing, if status is "ok" - the package is mainly normal, otherwise - error.
  • proc - operations processing status, if status is "ok" - operation is successful, otherwise -error (there are special status of pending operations).

Response when an error occurs on the entire package:

{
  "request_proc": "format_error",
  "ops": [

  ]
}

In this case, the list of operations in response is empty because none of the query operations have been performed

comments powered by HyperComments