Get all publishes

This endpoint return all published data.

URL :

/publish/list

/publish/list?from={from}&to={to}

/publish/list?customerId={customerId}

/publish/list?blockchain=BTC|ETH

Method : GET

X-HMAC required : YES

Request Query Parameters :

  • from-to optional

from 2024-02-28T10:00:00

to 2024-02-30T08:00:00

You have to write both of the params together, otherwise the query will not work
  • customerId optional

any

  • blockchain optional

BTC or ETH

Response

The response will be a JSON object containing all publishes.

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

interface Response {
  data: Publish[]
}

Status Codes

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

  • 200OK: The request was successful.
  • 400Bad Request: No data are published.
  • 500Internal Server Error: An error occurred on the server while processing the request.

Example Request

GET /publish/list HTTP/1.1
Content-Type: application/json
Host: localhost:3000
X-HMAC: 5d41402abc4b2a76b9719d911017c592

Example Response

{
    "data": [
        {
            "id": 1,
            "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": "0x547fd47ad0d72c3fd569d9a3d916dfcaf07c9b2cd7f8b2356a18c2b1e213c874",
            "publishedAt": "2024-01-30T10:24:55.674Z"
        },
        {
            "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"
        }
    ]
}