Class: Sydecar::WebhookCalls
- Inherits:
-
Object
- Object
- Sydecar::WebhookCalls
- Defined in:
- lib/sydecar/webhook_calls.rb
Constant Summary collapse
- URL =
'/v1/configure/webhooks'
Class Method Summary collapse
-
.create(body:, idempotency_key:) ⇒ Hash
The method create a webhook callback URL } See on the api-docs.sydecar.io/api/#tag/Configuration/operation/createWebhook.
-
.find(id:) ⇒ Object
This method Fetch webhook information by id Fetch webhook information by id.
-
.find_all(query: {}) ⇒ Object
This method fetch all webhooks Retrieve all webhooks created to date (filtered).
-
.find_latest_events(id:, query: {}) ⇒ Object
This method Fetch latest webhook events Fetch the latest events for a webhook.
-
.resend_event(event_id:) ⇒ Hash
This method Resend webhook event Resend a webhook event which was previously published.
-
.update(id:, body:) ⇒ Hash
This method Update a webhook Update a webhook.
Class Method Details
.create(body:, idempotency_key:) ⇒ Hash
Set a webhook callback URL. You can provide any URL for Sydecar webhook callbacks to land. All webhook callbacks for the specified environment will be directed to the URL you provide. For maximum security, make sure to use https endpoints. In addition, webhook calls will be signed with a token.
The method create a webhook callback URL } See on the api-docs.sydecar.io/api/#tag/Configuration/operation/createWebhook
37 38 39 |
# File 'lib/sydecar/webhook_calls.rb', line 37 def create(body:, idempotency_key:) Connection.instance.post("#{URL}/create", body, { 'idempotency-key': idempotency_key }) end |
.find(id:) ⇒ Object
This method Fetch webhook information by id Fetch webhook information by id. This does not include the associate webhook events. Response samples
{
"id": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"url": "string",
"label": "string",
"token": "string",
"disabled": true
} return [Hash] Responses: > ‘200’
See on the api-docs.sydecar.io/api/#tag/Configuration/operation/getWebhook
96 97 98 |
# File 'lib/sydecar/webhook_calls.rb', line 96 def find(id:) Connection.instance.get("#{URL}/#{id}") end |
.find_all(query: {}) ⇒ Object
This method fetch all webhooks Retrieve all webhooks created to date (filtered). Pagination is available. RESPONSE DATA (Sample):
{
"data": [
{
"id": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"url": "string",
"label": "string",
"token": "string",
"disabled": true
}
],
"pagination": {
"limit": 0,
"offset": 0,
"total": 0
}
} See on the api-docs.sydecar.io/api/#tag/Configuration/operation/getAllWebhooks
73 74 75 76 |
# File 'lib/sydecar/webhook_calls.rb', line 73 def find_all(query: {}) query = "?#{URI.encode_www_form(query)}" Connection.instance.post("#{URL}#{query}") end |
.find_latest_events(id:, query: {}) ⇒ Object
This method Fetch latest webhook events Fetch the latest events for a webhook. RESPONSE DATA (Sample): {
"data": [
{
"id": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"type": "plaid.account.item.expiring",
"details": {
"property1": "string",
"property2": "string"
}
}
],
"pagination": {
"limit": 0,
"offset": 0,
"total": 0
}
} See on the api-docs.sydecar.io/api/#tag/Configuration/operation/getAllWebhookEvents
164 165 166 167 |
# File 'lib/sydecar/webhook_calls.rb', line 164 def find_latest_events(id:, query: {}) query = URI.encode_www_form(query) Connection.instance.post("#{URL}/#{id}/events?#{query}") end |
.resend_event(event_id:) ⇒ Hash
This method Resend webhook event Resend a webhook event which was previously published. } See on the api-docs.sydecar.io/api/#tag/Configuration/operation/replayWebhookEvent
189 190 191 |
# File 'lib/sydecar/webhook_calls.rb', line 189 def resend_event(event_id:) Connection.instance.post("#{URL}/event/#{event_id}") end |
.update(id:, body:) ⇒ Hash
This method Update a webhook Update a webhook. You can update the label, url and/or token. } See on the api-docs.sydecar.io/api/#tag/Configuration/operation/updateWebhook
125 126 127 |
# File 'lib/sydecar/webhook_calls.rb', line 125 def update(id:, body:) Connection.instance.patch("#{URL}/#{id}", body) end |