Content Watcher Service
API Reference
Path Table
Method | Path | Description |
---|---|---|
POST | /v1/scanner/reset | Reset blockchain scan to a specific block number or offset from the current position |
GET | /v1/scanner/options | Get the current watch options for the blockchain content event scanner |
POST | /v1/scanner/options | Set watch options to filter the blockchain content scanner by schemas or MSA Ids |
POST | /v1/scanner/pause | Pause the blockchain scanner |
POST | /v1/scanner/start | Resume the blockchain content event scanner |
POST | /v1/search | Search for DSNP content by id and filters, starting from upperBound block and going back for blockCount number of blocks |
POST | /v1/webhooks | Register a webhook to be called when new content is encountered on the chain |
DELETE | /v1/webhooks | Clear all previously registered webhooks |
GET | /v1/webhooks | Get the list of currently registered webhooks |
GET | /healthz | Check the health status of the service |
GET | /livez | Check the live status of the service |
GET | /readyz | Check the ready status of the service |
Reference Table
Name | Path | Description |
---|---|---|
ResetScannerDto | #/components/schemas/ResetScannerDto | |
ChainWatchOptionsDto | #/components/schemas/ChainWatchOptionsDto | |
ContentSearchRequestDto | #/components/schemas/ContentSearchRequestDto | |
HttpStatus | #/components/schemas/HttpStatus | Status of webhook registration response |
SearchResponseDto | #/components/schemas/SearchResponseDto | |
AnnouncementTypeName | #/components/schemas/AnnouncementTypeName | Announcement types to send to the webhook |
WebhookRegistrationDto | #/components/schemas/WebhookRegistrationDto | |
WebhookRegistrationResponseDto | #/components/schemas/WebhookRegistrationResponseDto |
Path Details
[POST]/v1/scanner/reset
- Summary
Reset blockchain scan to a specific block number or offset from the current position
RequestBody
- application/json
{
// The block number to reset the scanner to
blockNumber?: number
// Number of blocks to rewind the scanner to (from `blockNumber` if supplied; else from latest block)
rewindOffset?: number
// Whether to schedule the new scan immediately or wait for the next scheduled interval
immediate?: boolean
}
Responses
- 201
[GET]/v1/scanner/options
- Summary
Get the current watch options for the blockchain content event scanner
Responses
- 200
application/json
{
schemaIds?: number[]
dsnpIds?: string[]
}
[POST]/v1/scanner/options
- Summary
Set watch options to filter the blockchain content scanner by schemas or MSA Ids
RequestBody
- application/json
{
schemaIds?: number[]
dsnpIds?: string[]
}
Responses
- 201
[POST]/v1/scanner/pause
- Summary
Pause the blockchain scanner
Responses
- 201
[POST]/v1/scanner/start
- Summary
Resume the blockchain content event scanner
Parameters(Query)
immediate?: boolean
Responses
- 201
[POST]/v1/search
- Summary
Search for DSNP content by id and filters, starting fromupperBound
block and going back forblockCount
number of blocks
RequestBody
- application/json
{
// An optional client-supplied reference ID by which it can identify the result of this search
clientReferenceId?: string
// The highest block number to start the backward search from
upperBoundBlock?: number
// The number of blocks to scan (backwards)
blockCount: number
// The schemaIds/dsnpIds to filter by
filters?: #/components/schemas/ChainWatchOptionsDto
// A webhook URL to be notified of the results of this search
webhookUrl: string
}
Responses
- 200 Returns a jobId to be used to retrieve the results
application/json
{
// Status of webhook registration response
status: enum[100, 101, 102, 103, 200, 201, 202, 203, 204, 205, 206, 300, 301, 302, 303, 304, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 421, 422, 424, 428, 429, 500, 501, 502, 503, 504, 505]
// Job id of search job
jobId: string
}
[POST]/v1/webhooks
- Summary
Register a webhook to be called when new content is encountered on the chain
RequestBody
- application/json
{
// Announcement types to send to the webhook
announcementTypes?: enum[tombstone, broadcast, reply, reaction, profile, update][]
// Webhook URL
url: string
}
Responses
- 201
[DELETE]/v1/webhooks
- Summary
Clear all previously registered webhooks
Responses
- 200
[GET]/v1/webhooks
- Summary
Get the list of currently registered webhooks
Responses
- 200 Returns a list of registered webhooks
application/json
{
// Status of webhook registration response
status: enum[100, 101, 102, 103, 200, 201, 202, 203, 204, 205, 206, 300, 301, 302, 303, 304, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 421, 422, 424, 428, 429, 500, 501, 502, 503, 504, 505]
registeredWebhooks: {
// Announcement types to send to the webhook
announcementTypes?: enum[tombstone, broadcast, reply, reaction, profile, update][]
// Webhook URL
url: string
}[]
}
[GET]/healthz
- Summary
Check the health status of the service
Responses
- 200 Service is healthy
[GET]/livez
- Summary
Check the live status of the service
Responses
- 200 Service is live
[GET]/readyz
- Summary
Check the ready status of the service
Responses
- 200 Service is ready
References
#/components/schemas/ResetScannerDto
{
// The block number to reset the scanner to
blockNumber?: number
// Number of blocks to rewind the scanner to (from `blockNumber` if supplied; else from latest block)
rewindOffset?: number
// Whether to schedule the new scan immediately or wait for the next scheduled interval
immediate?: boolean
}
#/components/schemas/ChainWatchOptionsDto
{
schemaIds?: number[]
dsnpIds?: string[]
}
#/components/schemas/ContentSearchRequestDto
{
// An optional client-supplied reference ID by which it can identify the result of this search
clientReferenceId?: string
// The highest block number to start the backward search from
upperBoundBlock?: number
// The number of blocks to scan (backwards)
blockCount: number
// The schemaIds/dsnpIds to filter by
filters?: #/components/schemas/ChainWatchOptionsDto
// A webhook URL to be notified of the results of this search
webhookUrl: string
}
#/components/schemas/HttpStatus
{
"type": "number",
"description": "Status of webhook registration response",
"enum": [
100,
101,
102,
103,
200,
201,
202,
203,
204,
205,
206,
300,
301,
302,
303,
304,
307,
308,
400,
401,
402,
403,
404,
405,
406,
407,
408,
409,
410,
411,
412,
413,
414,
415,
416,
417,
418,
421,
422,
424,
428,
429,
500,
501,
502,
503,
504,
505
]
}
#/components/schemas/SearchResponseDto
{
// Status of webhook registration response
status: enum[100, 101, 102, 103, 200, 201, 202, 203, 204, 205, 206, 300, 301, 302, 303, 304, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 421, 422, 424, 428, 429, 500, 501, 502, 503, 504, 505]
// Job id of search job
jobId: string
}
#/components/schemas/AnnouncementTypeName
{
"type": "string",
"description": "Announcement types to send to the webhook",
"enum": [
"tombstone",
"broadcast",
"reply",
"reaction",
"profile",
"update"
]
}
#/components/schemas/WebhookRegistrationDto
{
// Announcement types to send to the webhook
announcementTypes?: enum[tombstone, broadcast, reply, reaction, profile, update][]
// Webhook URL
url: string
}
#/components/schemas/WebhookRegistrationResponseDto
{
// Status of webhook registration response
status: enum[100, 101, 102, 103, 200, 201, 202, 203, 204, 205, 206, 300, 301, 302, 303, 304, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 421, 422, 424, 428, 429, 500, 501, 502, 503, 504, 505]
registeredWebhooks: {
// Announcement types to send to the webhook
announcementTypes?: enum[tombstone, broadcast, reply, reaction, profile, update][]
// Webhook URL
url: string
}[]
}