Class: ScreenshotFreeAPI::Resources::Integrations
- Inherits:
-
Object
- Object
- ScreenshotFreeAPI::Resources::Integrations
- Defined in:
- lib/screenshotfreeapi/resources/integrations.rb
Overview
Third-party integration endpoints.
Currently supports Zapier REST Hooks for no-code workflow automation. All methods use API key authentication (no JWT required).
Instance Method Summary collapse
-
#initialize(http) ⇒ Integrations
constructor
A new instance of Integrations.
-
#zapier_subscribe(target_url:, event:, **options) ⇒ Hash
Register a Zapier webhook subscription (REST Hook subscribe).
-
#zapier_triggers(event:) ⇒ Array<Hash>
Retrieve a sample payload for a Zapier trigger event.
-
#zapier_unsubscribe(subscription_id:) ⇒ Hash
Unregister a Zapier webhook subscription (REST Hook unsubscribe).
Constructor Details
#initialize(http) ⇒ Integrations
Returns a new instance of Integrations.
10 11 12 |
# File 'lib/screenshotfreeapi/resources/integrations.rb', line 10 def initialize(http) @http = http end |
Instance Method Details
#zapier_subscribe(target_url:, event:, **options) ⇒ Hash
Register a Zapier webhook subscription (REST Hook subscribe).
Zapier calls this endpoint when a Zap is turned on. You can also call it directly to register any webhook for screenshot-complete events.
24 25 26 27 |
# File 'lib/screenshotfreeapi/resources/integrations.rb', line 24 def zapier_subscribe(target_url:, event:, **) body = { targetUrl: target_url, event: event }.merge() @http.request(:post, "/integrations/zapier/subscribe", body: body) end |
#zapier_triggers(event:) ⇒ Array<Hash>
Retrieve a sample payload for a Zapier trigger event.
Zapier uses this to show users a preview of the data they can map in their Zap.
47 48 49 |
# File 'lib/screenshotfreeapi/resources/integrations.rb', line 47 def zapier_triggers(event:) @http.request(:get, "/integrations/zapier/triggers/#{event}") end |
#zapier_unsubscribe(subscription_id:) ⇒ Hash
Unregister a Zapier webhook subscription (REST Hook unsubscribe).
Zapier calls this when the Zap is turned off.
36 37 38 |
# File 'lib/screenshotfreeapi/resources/integrations.rb', line 36 def zapier_unsubscribe(subscription_id:) @http.request(:delete, "/integrations/zapier/unsubscribe/#{subscription_id}") end |