All URIs are relative to https://zernio.com/api
| Method | HTTP request | Description |
|---|---|---|
| create_comment_automation | POST /v1/comment-automations | Create comment-to-DM automation |
| delete_comment_automation | DELETE /v1/comment-automations/{automationId} | Delete automation |
| get_comment_automation | GET /v1/comment-automations/{automationId} | Get automation details |
| list_comment_automation_logs | GET /v1/comment-automations/{automationId}/logs | List automation logs |
| list_comment_automations | GET /v1/comment-automations | List comment-to-DM automations |
| update_comment_automation | PATCH /v1/comment-automations/{automationId} | Update automation settings |
create_comment_automation(create_comment_automation_request)
Create comment-to-DM automation
Create a keyword-triggered DM automation on an Instagram or Facebook account. When someone comments a matching keyword (or, with trigger: story_reply, replies to your Instagram story with one), they automatically receive a DM. Triggers (trigger): * comment (default): fires on keyword comments on a post or reel. * story_reply: fires when someone replies to your Instagram story with a keyword, and answers them with a DM. Set platformPostId to a story media id to scope to one story, or omit it to match replies to any story. Targeting (comment trigger): * Per-post: set platformPostId to scope to one specific post (only one active per-post automation is allowed per post). * Account-wide ("any post"): omit platformPostId (and postId). The automation evaluates every comment on every post on the account. You can stack unlimited account-wide automations, each with its own keyword set, and they all run independently. Per-post automations take priority on their post. Audience (audience, Instagram only): restrict the automation to followers or non-followers, and/or to accounts above a follower count. Instagram only reveals the follow relationship for people who have messaged the account, so audience.whenUnknown decides what happens for everyone else - including verify, which sends a one-tap confirmation DM (followGate) and then delivers the real DM automatically. People we already know follow you skip the tap entirely. Set alsoMatchInDms: true on a comment automation to also answer people who send a keyword as a direct message instead of commenting it. One automation then covers both doors, and each door is deduplicated separately (someone who already got the DM from their comment still gets it if they later DM the keyword). Requires at least one keyword. Links in the DM's buttons can be click-tracked (linkTracking, on by default) and clickers optionally tagged (clickTag) for segmentation. Stats returned include delivered, read, and link clicks.
require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
# Configure Bearer authorization (JWT): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Zernio::CommentAutomationsApi.new
create_comment_automation_request = Zernio::CreateCommentAutomationRequest.new({profile_id: 'profile_id_example', account_id: 'account_id_example', name: 'name_example', dm_message: 'dm_message_example'}) # CreateCommentAutomationRequest |
begin
# Create comment-to-DM automation
result = api_instance.create_comment_automation(create_comment_automation_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling CommentAutomationsApi->create_comment_automation: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> create_comment_automation_with_http_info(create_comment_automation_request)
begin
# Create comment-to-DM automation
data, status_code, headers = api_instance.create_comment_automation_with_http_info(create_comment_automation_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <CreateCommentAutomation200Response>
rescue Zernio::ApiError => e
puts "Error when calling CommentAutomationsApi->create_comment_automation_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| create_comment_automation_request | CreateCommentAutomationRequest |
CreateCommentAutomation200Response
- Content-Type: application/json
- Accept: application/json
delete_comment_automation(automation_id)
Delete automation
Permanently delete an automation and all its trigger logs.
require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
# Configure Bearer authorization (JWT): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Zernio::CommentAutomationsApi.new
automation_id = 'automation_id_example' # String |
begin
# Delete automation
api_instance.delete_comment_automation(automation_id)
rescue Zernio::ApiError => e
puts "Error when calling CommentAutomationsApi->delete_comment_automation: #{e}"
endThis returns an Array which contains the response data (nil in this case), status code and headers.
<Array(nil, Integer, Hash)> delete_comment_automation_with_http_info(automation_id)
begin
# Delete automation
data, status_code, headers = api_instance.delete_comment_automation_with_http_info(automation_id)
p status_code # => 2xx
p headers # => { ... }
p data # => nil
rescue Zernio::ApiError => e
puts "Error when calling CommentAutomationsApi->delete_comment_automation_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| automation_id | String |
nil (empty response body)
- Content-Type: Not defined
- Accept: application/json
get_comment_automation(automation_id)
Get automation details
Returns an automation with its configuration, stats, and recent trigger logs.
require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
# Configure Bearer authorization (JWT): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Zernio::CommentAutomationsApi.new
automation_id = 'automation_id_example' # String |
begin
# Get automation details
result = api_instance.get_comment_automation(automation_id)
p result
rescue Zernio::ApiError => e
puts "Error when calling CommentAutomationsApi->get_comment_automation: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_comment_automation_with_http_info(automation_id)
begin
# Get automation details
data, status_code, headers = api_instance.get_comment_automation_with_http_info(automation_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetCommentAutomation200Response>
rescue Zernio::ApiError => e
puts "Error when calling CommentAutomationsApi->get_comment_automation_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| automation_id | String |
GetCommentAutomation200Response
- Content-Type: Not defined
- Accept: application/json
list_comment_automation_logs(automation_id, opts)
List automation logs
Paginated list of every comment that triggered this automation, with send status and commenter info.
require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
# Configure Bearer authorization (JWT): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Zernio::CommentAutomationsApi.new
automation_id = 'automation_id_example' # String |
opts = {
status: 'pending', # String | Filter by result status
limit: 56, # Integer |
skip: 56 # Integer |
}
begin
# List automation logs
result = api_instance.list_comment_automation_logs(automation_id, opts)
p result
rescue Zernio::ApiError => e
puts "Error when calling CommentAutomationsApi->list_comment_automation_logs: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> list_comment_automation_logs_with_http_info(automation_id, opts)
begin
# List automation logs
data, status_code, headers = api_instance.list_comment_automation_logs_with_http_info(automation_id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <ListCommentAutomationLogs200Response>
rescue Zernio::ApiError => e
puts "Error when calling CommentAutomationsApi->list_comment_automation_logs_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| automation_id | String | ||
| status | String | Filter by result status | [optional] |
| limit | Integer | [optional][default to 50] | |
| skip | Integer | [optional][default to 0] |
ListCommentAutomationLogs200Response
- Content-Type: Not defined
- Accept: application/json
list_comment_automations(opts)
List comment-to-DM automations
List all comment-to-DM automations for a profile. Returns automations with their stats.
require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
# Configure Bearer authorization (JWT): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Zernio::CommentAutomationsApi.new
opts = {
profile_id: 'profile_id_example' # String | Filter by profile. Omit to list across all profiles
}
begin
# List comment-to-DM automations
result = api_instance.list_comment_automations(opts)
p result
rescue Zernio::ApiError => e
puts "Error when calling CommentAutomationsApi->list_comment_automations: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> list_comment_automations_with_http_info(opts)
begin
# List comment-to-DM automations
data, status_code, headers = api_instance.list_comment_automations_with_http_info(opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <ListCommentAutomations200Response>
rescue Zernio::ApiError => e
puts "Error when calling CommentAutomationsApi->list_comment_automations_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| profile_id | String | Filter by profile. Omit to list across all profiles | [optional] |
ListCommentAutomations200Response
- Content-Type: Not defined
- Accept: application/json
update_comment_automation(automation_id, opts)
Update automation settings
Update an automation's keywords, DM message, inline buttons, comment reply, or active status. Pass buttons: [] to clear all buttons. When buttons is non-empty, dmMessage (the new one if you're changing it, otherwise the stored one) must be 640 characters or less.
require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
# Configure Bearer authorization (JWT): bearerAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = Zernio::CommentAutomationsApi.new
automation_id = 'automation_id_example' # String |
opts = {
update_comment_automation_request: Zernio::UpdateCommentAutomationRequest.new # UpdateCommentAutomationRequest |
}
begin
# Update automation settings
result = api_instance.update_comment_automation(automation_id, opts)
p result
rescue Zernio::ApiError => e
puts "Error when calling CommentAutomationsApi->update_comment_automation: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> update_comment_automation_with_http_info(automation_id, opts)
begin
# Update automation settings
data, status_code, headers = api_instance.update_comment_automation_with_http_info(automation_id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <UpdateCommentAutomation200Response>
rescue Zernio::ApiError => e
puts "Error when calling CommentAutomationsApi->update_comment_automation_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| automation_id | String | ||
| update_comment_automation_request | UpdateCommentAutomationRequest | [optional] |
UpdateCommentAutomation200Response
- Content-Type: application/json
- Accept: application/json