new Webhook(self)
A new webhook api object.
Parameters:
| Name | Type | Description |
|---|---|---|
self |
object | is `this` from index.js |
- Source:
Methods
activate(id, callback)
activates a webhook endpoint
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | the webhook id to look up |
callback |
requestCallback | a function to call when we're done getting data |
- Source:
createRelay(id, payload, callback)
create a new webhook relay key
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | webhook relay id |
payload |
Object | optional payload to send, json with id and metadata |
callback |
requestCallback | a function to call when we're done getting data |
- Source:
getRelayKey(webhookRelayID, webhookRelayKeyID)
return webhook relay key by id
Parameters:
| Name | Type | Description |
|---|---|---|
webhookRelayID |
string | webhook relay id |
webhookRelayKeyID |
string | webhook relay key id |
- Source:
listRelays(id, callback)
list relay keys by webhook id
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | the webhook id to look up |
callback |
requestCallback | a function to call when we're done getting data |
- Source:
subscribe(webhookID, eventID, payload, callback)
creates or updates a webhook subscription
Parameters:
| Name | Type | Description |
|---|---|---|
webhookID |
string | id of the webhook |
eventID |
string | id of the event (campaign, team campaign, fundraising event) to track |
payload |
Object | JSON array {event_types: [ |
callback |
requestCallback | a function to call when we're done getting data |
- Source: