Skip to main content

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, leveraging await to hold execution until the bstamp.getWebhook promise completes.
  • Token Replacement: Make sure to replace token used in Authorization with your token, which you will get in response of authentication method

Request Parameters

ParameterRequiredTypeDescription
versionYesStringUse a specific available version of bStamp

Response Format

KeyTypeDescription
idStringUnique identifier for the webhook.
actionArrayActions the webhook is configured to trigger.
userIdStringIdentifier of the user who created the webhook.
redirectUrlStringURL to which the webhook sends data.
descriptionStringBrief description of the webhook.
statusNumberIndicates the webhook's status.
createdAtStringCreation timestamp of the webhook.
updatedAtStringTimestamp of the last webhook update.