POST /notarize
Request notarization of given hash, return requestId of queued request. Tha hash must be a SHA256 type with 0x prefix.
Params
The body of the request must be a JSON object with the following fields:
Param | Type | Description | Required |
---|---|---|---|
hash | string | Hash of document to notarize | Yes |
webhookUrl | string | Hash of document to notarize | No |
metadata | object | Object with metadata fields | No |
verbose | bool | Verbose response on webhook | No |
Return
The POST request return an object containing the follow properties:
Param | Type | Description |
---|---|---|
requestId | string | Id of notarization requeste, usefull to request status |
status | string | Status of |
error | string | Object with metadata fields |
Usage
const axios = require('axios');
const endpoint = https://pablock-api-dev.bcode.cloud
const authToken = '<your-token>'
const optionals = {
webhookUrl: "https://example.com/webhook",
metadata: {},
verbose: true,
}
const hash = "0xb133a0c0e9bee3be20163d2ad31d6248db292aa6dcb1ee087a2aa50e0fc75ae2"
let { status, data } = await axios.post(
`${endpoint}/notarize/`,
{ hash, ...optionals },
{
headers: {
Authorization : `Bearer ${authToken}`
}
}
);
const requestId = data.requestId