List Webhooks
To list all webhooks with the bStamp API, utilize the getWebhook
method from the SDK.
Sample Code Snippet
Here is a JavaScript code snippet demonstrating the use of the getWebhook
method:
import { Bstamp, Network } from 'edeXa-sdk';
async function getWebhook() {
const bStamp = new Bstamp({
...settings,
authorization: `Bearer ${token}`,
});
const settings = {
network: Network.SANDBOX, // or Network.MAINNET for the mainnet network
};
const version = {
version: API_VERSION.VERSION_2
}
try {
const webhook = await bstamp.getWebhook(version);
// Handle success
} catch (error) {
// Handle error
}
}
Key Points to Note
- Asynchronous Function: The
getWebhook
function operates as an asynchronous (async
) function, leveragingawait
to hold execution until thebstamp.getWebhook
promise completes. - Token Replacement: Make sure to replace
token
used inAuthorization
with yourtoken
, which you will get in response of authentication method
Request Parameters
Parameter | Required | Type | Description |
---|---|---|---|
version | Yes | String | Use a specific available version of bStamp |
Response Format
Key | Type | Description |
---|---|---|
id | String | Unique identifier for the webhook. |
action | Array | Actions the webhook is configured to trigger. |
userId | String | Identifier of the user who created the webhook. |
redirectUrl | String | URL to which the webhook sends data. |
description | String | Brief description of the webhook. |
status | Number | Indicates the webhook's status. |
createdAt | String | Creation timestamp of the webhook. |
updatedAt | String | Timestamp of the last webhook update. |