Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する
API Reference

Networking & Services


This section details the GraphQL queries for retrieving information about your Blocklet Server's networking and service configurations. You can fetch data related to notifications, routing rules, domains, certificates, and webhooks. For operations that modify these configurations, see the Networking & Services Mutations documentation.

Notifications#

Queries for managing and retrieving notification data.

getNotifications#

Fetches a paginated list of notifications for a specific receiver or sender.

Parameters

Name

Type

Description

input

RequestGetNotificationsInput

An object containing query parameters.

input.receiver

string

The DID of the notification receiver.

input.sender

string

The DID of the notification sender.

input.read

boolean

Filter notifications by their read status.

input.paging

PagingInput

Pagination options for the result set.

input.teamDid

string

The DID of the team to filter notifications for.

input.severity

string[]

An array of severity levels to filter by (e.g., 'info', 'error').

input.componentDid

string[]

An array of component DIDs to filter by.

Returns

Returns a ResponseGetNotifications object containing the list of notifications, pagination details, and the count of unread notifications.

Example Usage

const notifications = await client.getNotifications({
input: {
receiver: 'z1...userDid',
read: false,
paging: { page: 1, pageSize: 10 },
},
});
console.log(notifications.list);

Example Response

{
"code": "ok",
"list": [
{
"id": "...",
"sender": "zNK...blockletDid",
"receiver": "z1...userDid",
"title": "New Update Available",
"description": "A new version of the blocklet is ready to be installed.",
"read": false,
"createdAt": 1678886400
}
],
"paging": {
"page": 1,
"pageSize": 10,
"total": 1
},
"unreadCount": 1
}

makeAllNotificationsAsRead#

Marks all notifications for a specific receiver as read.

Parameters

Name

Type

Description

input

RequestMakeAllNotificationsAsReadInput

An object containing the filter criteria.

input.receiver

string

The DID of the notification receiver.

input.teamDid

string

The DID of the team to filter notifications for.

Returns

Returns a ResponseMakeAllNotificationsAsRead object indicating the number of notifications affected.

Example Usage

const result = await client.makeAllNotificationsAsRead({
input: {
receiver: 'z1...userDid',
},
});
console.log(`Affected notifications: ${result.data.numAffected}`);

Example Response

{
"code": "ok",
"data": {
"numAffected": 5
}
}

getNotificationSendLog#

Retrieves a log of sent notifications, filterable by date range and other criteria.

Parameters

Name

Type

Description

input

RequestNotificationSendLogInput

An object containing query parameters.

input.teamDid

string

The DID of the team to retrieve logs for.

input.dateRange

string[]

A tuple specifying the start and end date for the logs.

input.paging

PagingInput

Pagination options for the result set.

Returns

Returns a ResponseNotificationSendLog object with a paginated list of notification logs.

Example Usage

const logs = await client.getNotificationSendLog({
input: {
teamDid: 'zNK...blockletDid',
paging: { page: 1, pageSize: 20 },
},
});
console.log(logs.list);

getReceivers#

Fetches a list of receivers for a specific notification.

Parameters

Name

Type

Description

input

RequestReceiversInput

An object containing query parameters.

input.notificationId

string

The ID of the notification.

input.teamDid

string

The DID of the team.

input.paging

PagingInput

Pagination options.

Returns

Returns a ResponseReceivers object with a paginated list of notification receivers.

getNotificationComponents#

Retrieves a list of component DIDs that have sent notifications.

Parameters

Name

Type

Description

input

RequestNotificationComponentsInput

An object containing query parameters.

input.teamDid

string

The DID of the team.

input.receiver

string

Optional. Filter by receiver DID.

Returns

Returns a ResponseNotificationComponents object containing an array of component DIDs.

resendNotification#

Triggers a resend of a previously sent notification.

Parameters

Name

Type

Description

input

RequestResendNotificationInput

An object containing the resend parameters.

input.notificationId

string

The ID of the notification to resend.

input.teamDid

string

The DID of the team.

input.receivers

string[]

Optional. A list of receiver DIDs to resend to.

input.resendFailedOnly

boolean

If true, only resend to receivers who previously failed to receive it.

Returns

Returns a ResponseResendNotification object confirming the resend request.


Routing#

Queries for retrieving routing configurations and snapshots.

getRoutingSites#

Fetches all configured routing sites. Can optionally retrieve sites from a specific snapshot.

Parameters

Name

Type

Description

input

RequestGetRoutingSitesInput

An object containing query parameters.

input.snapshotHash

string

Optional. The hash of a routing snapshot to retrieve sites from.

Returns

Returns a ResponseGetRoutingSites object containing an array of RoutingSite objects.

Example Usage

const sites = await client.getRoutingSites({});
console.log(sites.sites);

Example Response

{
"code": "ok",
"sites": [
{
"id": "...",
"domain": "example.arcblock.io",
"rules": [
{
"id": "...",
"from": { "pathPrefix": "/" },
"to": { "did": "zNK...blockletDid", "type": "blocklet" }
}
]
}
]
}

getRoutingSnapshots#

Retrieves a list of historical routing configuration snapshots.

Parameters

Name

Type

Description

input

RequestGetRoutingSnapshotsInput

An object containing query parameters.

input.limit

number

The maximum number of snapshots to return.

Returns

Returns a ResponseGetRoutingSnapshots object containing an array of RoutingSnapshot objects.

getSnapshotSites#

Alias for getRoutingSites with a snapshotHash parameter, specifically for fetching sites from a snapshot.

getRoutingProviders#

Fetches a list of available routing providers and their status.

Returns

Returns a ResponseGetRoutingProviders object containing an array of RoutingProvider objects.


Domains & Certificates#

Queries for managing domains and SSL certificates.

isDidDomain#

Checks if a given domain is a DID domain.

Parameters

Name

Type

Description

input

RequestIsDidDomainInput

An object containing the domain to check.

input.domain

string

The domain name.

Returns

Returns a ResponseIsDidDomain object with a boolean value indicating the result.

getCertificates#

Retrieves all SSL certificates installed on the node.

Returns

Returns a ResponseGetCertificates object containing an array of Certificate objects.

checkDomains#

Verifies the DNS settings for a list of domains.

Parameters

Name

Type

Description

input

RequestCheckDomainsInput

An object containing the domains to check.

input.domains

string[]

An array of domain names to verify.

input.did

string

The DID of the blocklet associated with the domains.

Returns

Returns a ResponseCheckDomains object indicating the success of the check.

findCertificateByDomain#

Finds a specific SSL certificate by its associated domain name.

Parameters

Name

Type

Description

input

RequestFindCertificateByDomainInput

An object containing the search criteria.

input.domain

string

The domain name to search for.

input.did

string

The DID of the blocklet associated with the certificate.

Returns

Returns a ResponseFindCertificateByDomain object containing the Certificate if found.

getDomainDNS#

Retrieves the DNS resolution status for a given domain.

Parameters

Name

Type

Description

input

RequestDomainDNSInput

An object containing the domain and team DID.

input.teamDid

string

The DID of the team/blocklet.

input.domain

string

The domain to check.

Returns

Returns a ResponseDomainDNS object detailing the DNS status, including CNAME match and resolution status.


Webhooks#

Queries for managing webhooks and their endpoints.

getWebHooks#

Retrieves a list of all configured webhooks.

Returns

Returns a ResponseWebHooks object containing an array of WebHook objects.

getWebhookSenders#

Fetches a list of available webhook sender types (e.g., Slack, API).

Returns

Returns a ResponseSenderList object with an array of WebHookSender objects.

sendTestMessage#

Sends a test message to a specified webhook to verify its configuration.

Parameters

Name

Type

Description

input

RequestSendMsgInput

An object containing the webhook ID and message.

input.webhookId

string

The ID of the webhook to test.

input.message

string

The test message content.

Returns

Returns a ResponseSendMsg object confirming the message was sent.

getWebhookEndpoints#

Retrieves a paginated list of configured webhook endpoints for a team.

Parameters

Name

Type

Description

input

RequestGetWebhookEndpointsInput

An object containing query parameters.

input.teamDid

string

The DID of the team.

input.paging

PagingInput

Pagination options.

Returns

Returns a ResponseGetWebhookEndpoints object with a list of endpoints and pagination details.

getWebhookEndpoint#

Fetches a single webhook endpoint by its ID.

Parameters

Name

Type

Description

input

RequestGetWebhookEndpointInput

An object containing query parameters.

input.teamDid

string

The DID of the team.

input.id

string

The ID of the webhook endpoint.

Returns

Returns a ResponseGetWebhookEndpoint object with the details of the specified endpoint.

getWebhookAttempts#

Retrieves a log of delivery attempts for a specific webhook event.

Parameters

Name

Type

Description

input

RequestGetWebhookAttemptsInput

An object containing query parameters.

input.teamDid

string

The DID of the team.

input.input.eventId

string

The ID of the event.

input.input.webhookId

string

The ID of the webhook.

input.paging

PagingInput

Pagination options.

Returns

Returns a ResponseGetWebhookAttempts object with a paginated list of delivery attempts.


Next, explore queries for managing Data & Operations, such as backups and logs.