Nomad Hawk

This is the API descriptor for the Nomad Hawk API, responsible for tracking and analytics.

This is the documentation for version 1.1.0 of the API. Last update on Mar 20, 2020.

Base URL
https://nomad.samarkand-global.cn/hawk

Track

Track

Sends an event to hawk

Body
  • type string
  • category string
  • label string
  • message string
  • location_city string
  • location_country string
  • company string
  • value string
  • value_type string
  • source string
  • sales_channel string
  • user string
  • id string
  • items array[object]
    • item_name string
    • item_price number
    • item_quantity integer(int32)
    • item_category string
    • item_barcode string
    • item_currency string
    • item_brand string
Responses
  • 200 object

    Success

    • code integer(int32)
    • message string
    • type string
    • data object
      • foobar string
    • connectorResponses array[object]
      • input string

        The input of a NomadOperation, usually it's JSON format.

      • operation_name string

        The name of mapping class.

      • api array[string]
      • http_request_raw_data string

        Raw data of current HTTP request to the third party server, easy for debug.

      • code integer(int32)
      • response string
      • response_en string
      • platform string
      • request_count integer(int32)

        The number of requests against the third party in one Nomad request.

  • 400

    Invalid input

POST /track
$ curl \
 -X POST https://nomad.samarkand-global.cn/hawk/track \
 -H "Content-Type: application/json" \
 -d '{"type":"event","category":"order","label":"order_create_failed","message":"Couldnt create order","location_city":"London","location_country":"United Kingdom","company":"Apple, Inc","value":"https://some.url","value_type":"url","source":"odoo","sales_channel":"Onion (B2C)","user":"vessy","id":"ABC123","items":[{"item_name":"Can of beans","item_price":10.1,"item_quantity":1,"item_category":"Food","item_barcode":55001234567890,"item_currency":"EUR","item_brand":"Apple"}]}'
Request payload example
{
  "type": "event",
  "category": "order",
  "label": "order_create_failed",
  "message": "Couldnt create order",
  "location_city": "London",
  "location_country": "United Kingdom",
  "company": "Apple, Inc",
  "value": "https://some.url",
  "value_type": "url",
  "source": "odoo",
  "sales_channel": "Onion (B2C)",
  "user": "vessy",
  "id": "ABC123",
  "items": [
    {
      "item_name": "Can of beans",
      "item_price": 10.1,
      "item_quantity": 1,
      "item_category": "Food",
      "item_barcode": 55001234567890,
      "item_currency": "EUR",
      "item_brand": "Apple"
    }
  ]
}
Response example (200)
{
  "code": 42,
  "message": "string",
  "type": "string",
  "data": {
    "foobar": "string"
  },
  "connectorResponses": [
    {
      "input": "{\"product_id\": 12121}",
      "operation_name": "GetProductOp",
      "api": [
        "string"
      ],
      "http_request_raw_data": "-",
      "code": 42,
      "response": "string",
      "response_en": "string",
      "platform": "youzan",
      "request_count": 1
    }
  ]
}

TrackWithStore

Sends an event to hawk

Path parameters
  • store_id Required / string

    Store id of tracked event

Body
  • type string
  • category string
  • label string
  • message string
  • location_city string
  • location_country string
  • company string
  • value string
  • value_type string
  • source string
  • sales_channel string
  • user string
  • id string
  • items array[object]
    • item_name string
    • item_price number
    • item_quantity integer(int32)
    • item_category string
    • item_barcode string
    • item_currency string
    • item_brand string
Responses
  • 200 object

    Success

    • code integer(int32)
    • message string
    • type string
    • data object
      • foobar string
    • connectorResponses array[object]
      • input string

        The input of a NomadOperation, usually it's JSON format.

      • operation_name string

        The name of mapping class.

      • api array[string]
      • http_request_raw_data string

        Raw data of current HTTP request to the third party server, easy for debug.

      • code integer(int32)
      • response string
      • response_en string
      • platform string
      • request_count integer(int32)

        The number of requests against the third party in one Nomad request.

  • 400

    Invalid input

POST /track/{store_id}
$ curl \
 -X POST https://nomad.samarkand-global.cn/hawk/track/{store_id} \
 -H "Content-Type: application/json" \
 -d '{"type":"event","category":"order","label":"order_create_failed","message":"Couldnt create order","location_city":"London","location_country":"United Kingdom","company":"Apple, Inc","value":"https://some.url","value_type":"url","source":"odoo","sales_channel":"Onion (B2C)","user":"vessy","id":"ABC123","items":[{"item_name":"Can of beans","item_price":10.1,"item_quantity":1,"item_category":"Food","item_barcode":55001234567890,"item_currency":"EUR","item_brand":"Apple"}]}'
Request payload example
{
  "type": "event",
  "category": "order",
  "label": "order_create_failed",
  "message": "Couldnt create order",
  "location_city": "London",
  "location_country": "United Kingdom",
  "company": "Apple, Inc",
  "value": "https://some.url",
  "value_type": "url",
  "source": "odoo",
  "sales_channel": "Onion (B2C)",
  "user": "vessy",
  "id": "ABC123",
  "items": [
    {
      "item_name": "Can of beans",
      "item_price": 10.1,
      "item_quantity": 1,
      "item_category": "Food",
      "item_barcode": 55001234567890,
      "item_currency": "EUR",
      "item_brand": "Apple"
    }
  ]
}
Response example (200)
{
  "code": 42,
  "message": "string",
  "type": "string",
  "data": {
    "foobar": "string"
  },
  "connectorResponses": [
    {
      "input": "{\"product_id\": 12121}",
      "operation_name": "GetProductOp",
      "api": [
        "string"
      ],
      "http_request_raw_data": "-",
      "code": 42,
      "response": "string",
      "response_en": "string",
      "platform": "youzan",
      "request_count": 1
    }
  ]
}