Publish Queue

This endpoint published all data from queue.

URL :

/queue/publish

/queue/publish?customerId={customerId}

/queue/publish?blockchain={blockchain}

/queue/publish?customerId={customerId}&blockchain={blockchain}

Method : GET

X-HMAC required : YES

Request Query Parameters :

  • customerId optional

any

  • blockchain optional

BTC or ETH

If the blockchain param is not provided, it is going to be published to both blockchains

Response

The response will be a JSON object containing all publish details.

interface Response {
  id: number
  data: BinMesurement[]
  bins: string[]
  rootHash: string
  blockchain: string
  txHash: string
  publishedAt: string
  explorerLink: string
}

Status Codes

The endpoint will return the following status codes based on the operation outcome:

  • 200OK: The request was successful.
  • 400Bad Request: The request was invalid. This usually occurs if the customers data are already published or missing customerID.
  • 500Internal Server Error: An error occurred on the server while processing the request.

Example Request

POST /queue/publish HTTP/1.1
Content-Type: application/json
X-HMAC: 5d41402abc4b2a76b9719d911017c592

Example Response

{
  "id": 11,
  "data": "[{\"alerts\":[{\"code\":\"SE001001\",\"ts\":\"2024-01-25T10:00:00Z\"}],\"bin\":\"521739b1-5f51-4245-b80b-e45465925347\",\"data\":{\"amp\":2,\"tmp\":3,\"ts\":\"2024-01-25T10:00:00Z\",\"vlt\":1}}]",
  "bins": [
    "521739b1-5f51-4245-b80b-e45465925347"
  ],
  "rootHash": "d7da2a6fdcbf73dbace7b5de468fb37669593ce435d89322af65a291ac2679c9",
  "blockchain": "ETH",
  "txHash": "0x2018a5c62e7862a3b45dcb920a8c48e7e1c6e4155fc8db25bb6c28f49212f08e",
  "publishedAt": "2024-02-13T11:02:21.458Z",
  "explorerLink": "https://sepolia.etherscan.io/tx/0x1c0e01ed8ff2f4d237c14da6b78708cfb4495cf9802aa77ae7c65f714858fd81"
}