All URIs are relative to https://zernio.com/api
| Method | HTTP request | Description |
|---|---|---|
| add_whats_app_group_participants | POST /v1/whatsapp/wa-groups/{groupId}/participants | Add participants |
| approve_whats_app_group_join_requests | POST /v1/whatsapp/wa-groups/{groupId}/join-requests | Approve join requests |
| block_whats_app_users | POST /v1/whatsapp/block-users | Block users |
| create_whats_app_dataset | POST /v1/whatsapp/dataset | Provision CTWA dataset |
| create_whats_app_group_chat | POST /v1/whatsapp/wa-groups | Create group |
| create_whats_app_group_invite_link | POST /v1/whatsapp/wa-groups/{groupId}/invite-link | Create invite link |
| create_whats_app_template | POST /v1/whatsapp/templates | Create template |
| delete_whats_app_group_chat | DELETE /v1/whatsapp/wa-groups/{groupId} | Delete group |
| delete_whats_app_template | DELETE /v1/whatsapp/templates/{templateName} | Delete template |
| delete_whatsapp_business_username | DELETE /v1/whatsapp/business-profile/username | Delete business username |
| get_whats_app_block_status | GET /v1/whatsapp/block-users/status | Check if a user is blocked |
| get_whats_app_blocked_users | GET /v1/whatsapp/block-users | List blocked users |
| get_whats_app_business_profile | GET /v1/whatsapp/business-profile | Get business profile |
| get_whats_app_dataset | GET /v1/whatsapp/dataset | Get CTWA conversions dataset |
| get_whats_app_display_name | GET /v1/whatsapp/business-profile/display-name | Get display name status |
| get_whats_app_group_chat | GET /v1/whatsapp/wa-groups/{groupId} | Get group info |
| get_whats_app_media | GET /v1/whatsapp/media/{mediaId} | Download WhatsApp media |
| get_whats_app_template | GET /v1/whatsapp/templates/{templateName} | Get template |
| get_whats_app_templates | GET /v1/whatsapp/templates | List templates |
| get_whatsapp_business_username | GET /v1/whatsapp/business-profile/username | Get business username |
| get_whatsapp_business_username_suggestions | GET /v1/whatsapp/business-profile/username/suggestions | Get username suggestions |
| list_whats_app_account_events | GET /v1/whatsapp/account-events | List account notifications |
| list_whats_app_conversions | GET /v1/whatsapp/conversions | List conversion events |
| list_whats_app_group_chats | GET /v1/whatsapp/wa-groups | List active groups |
| list_whats_app_group_join_requests | GET /v1/whatsapp/wa-groups/{groupId}/join-requests | List join requests |
| register_whats_app_number | POST /v1/accounts/{accountId}/whatsapp/register | Register a connected WhatsApp number on the Cloud API |
| reject_whats_app_group_join_requests | DELETE /v1/whatsapp/wa-groups/{groupId}/join-requests | Reject join requests |
| remove_whats_app_group_participants | DELETE /v1/whatsapp/wa-groups/{groupId}/participants | Remove participants |
| send_whats_app_conversion | POST /v1/whatsapp/conversions | Send WhatsApp conversion event |
| set_whatsapp_business_username | POST /v1/whatsapp/business-profile/username | Set business username |
| unblock_whats_app_users | DELETE /v1/whatsapp/block-users | Unblock users |
| update_whats_app_business_profile | POST /v1/whatsapp/business-profile | Update business profile |
| update_whats_app_display_name | POST /v1/whatsapp/business-profile/display-name | Request display name change |
| update_whats_app_group_chat | POST /v1/whatsapp/wa-groups/{groupId} | Update group settings |
| update_whats_app_template | PATCH /v1/whatsapp/templates/{templateName} | Update template |
| upload_whats_app_profile_photo | POST /v1/whatsapp/business-profile/photo | Upload profile picture |
add_whats_app_group_participants(group_id, account_id, add_whats_app_group_participants_request)
Add participants
Add participants to a WhatsApp group. Maximum 8 participants per request. Not available on Coexistence numbers. Requires a Cloud API-only number.
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::WhatsAppApi.new
group_id = 'group_id_example' # String | Group ID
account_id = 'account_id_example' # String | WhatsApp social account ID
add_whats_app_group_participants_request = Zernio::AddWhatsAppGroupParticipantsRequest.new({phone_numbers: ['phone_numbers_example']}) # AddWhatsAppGroupParticipantsRequest |
begin
# Add participants
result = api_instance.add_whats_app_group_participants(group_id, account_id, add_whats_app_group_participants_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->add_whats_app_group_participants: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> add_whats_app_group_participants_with_http_info(group_id, account_id, add_whats_app_group_participants_request)
begin
# Add participants
data, status_code, headers = api_instance.add_whats_app_group_participants_with_http_info(group_id, account_id, add_whats_app_group_participants_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <UnpublishPost200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->add_whats_app_group_participants_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| group_id | String | Group ID | |
| account_id | String | WhatsApp social account ID | |
| add_whats_app_group_participants_request | AddWhatsAppGroupParticipantsRequest |
- Content-Type: application/json
- Accept: application/json
approve_whats_app_group_join_requests(group_id, account_id, approve_whats_app_group_join_requests_request)
Approve join requests
Approve pending join requests for a WhatsApp group. Not available on Coexistence numbers. Requires a Cloud API-only number.
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::WhatsAppApi.new
group_id = 'group_id_example' # String | Group ID
account_id = 'account_id_example' # String | WhatsApp social account ID
approve_whats_app_group_join_requests_request = Zernio::ApproveWhatsAppGroupJoinRequestsRequest.new({phone_numbers: ['phone_numbers_example']}) # ApproveWhatsAppGroupJoinRequestsRequest |
begin
# Approve join requests
result = api_instance.approve_whats_app_group_join_requests(group_id, account_id, approve_whats_app_group_join_requests_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->approve_whats_app_group_join_requests: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> approve_whats_app_group_join_requests_with_http_info(group_id, account_id, approve_whats_app_group_join_requests_request)
begin
# Approve join requests
data, status_code, headers = api_instance.approve_whats_app_group_join_requests_with_http_info(group_id, account_id, approve_whats_app_group_join_requests_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <UnpublishPost200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->approve_whats_app_group_join_requests_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| group_id | String | Group ID | |
| account_id | String | WhatsApp social account ID | |
| approve_whats_app_group_join_requests_request | ApproveWhatsAppGroupJoinRequestsRequest |
- Content-Type: application/json
- Accept: application/json
block_whats_app_users(block_whats_app_users_request)
Block users
Block one or more WhatsApp users on this number. Blocked users cannot message your number or see that you are online, and your sends to them return an error. Meta constraints, surfaced per-user in failed (the request itself still succeeds for the rest of the batch): - Only users who messaged your business within the last 24 hours can be blocked (failures outside the window report "Re-engagement required"). - Up to 1,000 users per request; the blocklist caps at 64,000. - Other WhatsApp Business accounts cannot be blocked.
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::WhatsAppApi.new
block_whats_app_users_request = Zernio::BlockWhatsAppUsersRequest.new({account_id: 'account_id_example', users: ['users_example']}) # BlockWhatsAppUsersRequest |
begin
# Block users
result = api_instance.block_whats_app_users(block_whats_app_users_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->block_whats_app_users: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> block_whats_app_users_with_http_info(block_whats_app_users_request)
begin
# Block users
data, status_code, headers = api_instance.block_whats_app_users_with_http_info(block_whats_app_users_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <BlockWhatsAppUsers200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->block_whats_app_users_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| block_whats_app_users_request | BlockWhatsAppUsersRequest |
- Content-Type: application/json
- Accept: application/json
create_whats_app_dataset(delete_whatsapp_business_username_request)
Provision CTWA dataset
Creates (or fetches, if one already exists) the Meta dataset that Click-to-WhatsApp ad events are reported against via the Conversions API, and persists its ID on the account as metadata.metaCapiDatasetId. The call is GET-first idempotent — a WABA can only own one CTWA dataset, so a second call after a successful provision is a safe no-op that returns the same ID with created: false. Requires the connected WhatsApp account's token to carry the whatsapp_business_manage_events permission. If the permission is missing the endpoint returns 422 with a message asking the user to reconnect the account.
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::WhatsAppApi.new
delete_whatsapp_business_username_request = Zernio::DeleteWhatsappBusinessUsernameRequest.new({account_id: 'account_id_example'}) # DeleteWhatsappBusinessUsernameRequest |
begin
# Provision CTWA dataset
result = api_instance.create_whats_app_dataset(delete_whatsapp_business_username_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->create_whats_app_dataset: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> create_whats_app_dataset_with_http_info(delete_whatsapp_business_username_request)
begin
# Provision CTWA dataset
data, status_code, headers = api_instance.create_whats_app_dataset_with_http_info(delete_whatsapp_business_username_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <CreateWhatsAppDataset200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->create_whats_app_dataset_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| delete_whatsapp_business_username_request | DeleteWhatsappBusinessUsernameRequest |
CreateWhatsAppDataset200Response
- Content-Type: application/json
- Accept: application/json
create_whats_app_group_chat(create_whats_app_group_chat_request)
Create group
Create a new WhatsApp group chat. Returns the group ID and optionally an invite link. Not available on Coexistence numbers. Requires a Cloud API-only number.
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::WhatsAppApi.new
create_whats_app_group_chat_request = Zernio::CreateWhatsAppGroupChatRequest.new({account_id: 'account_id_example', subject: 'subject_example'}) # CreateWhatsAppGroupChatRequest |
begin
# Create group
result = api_instance.create_whats_app_group_chat(create_whats_app_group_chat_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->create_whats_app_group_chat: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> create_whats_app_group_chat_with_http_info(create_whats_app_group_chat_request)
begin
# Create group
data, status_code, headers = api_instance.create_whats_app_group_chat_with_http_info(create_whats_app_group_chat_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <CreateWhatsAppGroupChat201Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->create_whats_app_group_chat_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| create_whats_app_group_chat_request | CreateWhatsAppGroupChatRequest |
CreateWhatsAppGroupChat201Response
- Content-Type: application/json
- Accept: application/json
create_whats_app_group_invite_link(group_id, account_id)
Create invite link
Create a new invite link for a WhatsApp group. The previous link is revoked. Not available on Coexistence numbers. Requires a Cloud API-only number.
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::WhatsAppApi.new
group_id = 'group_id_example' # String | Group ID
account_id = 'account_id_example' # String | WhatsApp social account ID
begin
# Create invite link
result = api_instance.create_whats_app_group_invite_link(group_id, account_id)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->create_whats_app_group_invite_link: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> create_whats_app_group_invite_link_with_http_info(group_id, account_id)
begin
# Create invite link
data, status_code, headers = api_instance.create_whats_app_group_invite_link_with_http_info(group_id, account_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <CreateWhatsAppGroupInviteLink200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->create_whats_app_group_invite_link_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| group_id | String | Group ID | |
| account_id | String | WhatsApp social account ID |
CreateWhatsAppGroupInviteLink200Response
- Content-Type: Not defined
- Accept: application/json
create_whats_app_template(create_whats_app_template_request)
Create template
Create a new message template. Supports two modes: Custom template: Provide components with your own content. Submitted to Meta for review (can take up to 24h). Library template: Provide library_template_name instead of components to use a pre-built template from Meta's template library. Library templates are pre-approved (no review wait). You can optionally customize parameters and buttons via library_template_body_inputs and library_template_button_inputs. Browse available library templates at: https://business.facebook.com/wa/manage/message-templates/
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::WhatsAppApi.new
create_whats_app_template_request = Zernio::CreateWhatsAppTemplateRequest.new({account_id: 'account_id_example', name: 'name_example', category: 'AUTHENTICATION', language: 'language_example'}) # CreateWhatsAppTemplateRequest |
begin
# Create template
result = api_instance.create_whats_app_template(create_whats_app_template_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->create_whats_app_template: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> create_whats_app_template_with_http_info(create_whats_app_template_request)
begin
# Create template
data, status_code, headers = api_instance.create_whats_app_template_with_http_info(create_whats_app_template_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <CreateWhatsAppTemplate200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->create_whats_app_template_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| create_whats_app_template_request | CreateWhatsAppTemplateRequest |
CreateWhatsAppTemplate200Response
- Content-Type: application/json
- Accept: application/json
delete_whats_app_group_chat(group_id, account_id)
Delete group
Delete a WhatsApp group and remove all participants. Not available on Coexistence numbers. Requires a Cloud API-only number.
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::WhatsAppApi.new
group_id = 'group_id_example' # String | Group ID
account_id = 'account_id_example' # String | WhatsApp social account ID
begin
# Delete group
result = api_instance.delete_whats_app_group_chat(group_id, account_id)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->delete_whats_app_group_chat: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> delete_whats_app_group_chat_with_http_info(group_id, account_id)
begin
# Delete group
data, status_code, headers = api_instance.delete_whats_app_group_chat_with_http_info(group_id, account_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <UnpublishPost200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->delete_whats_app_group_chat_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| group_id | String | Group ID | |
| account_id | String | WhatsApp social account ID |
- Content-Type: Not defined
- Accept: application/json
delete_whats_app_template(template_name, account_id)
Delete template
Permanently delete a message template by name.
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::WhatsAppApi.new
template_name = 'template_name_example' # String | Template name
account_id = 'account_id_example' # String | WhatsApp social account ID
begin
# Delete template
result = api_instance.delete_whats_app_template(template_name, account_id)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->delete_whats_app_template: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> delete_whats_app_template_with_http_info(template_name, account_id)
begin
# Delete template
data, status_code, headers = api_instance.delete_whats_app_template_with_http_info(template_name, account_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <UnpublishPost200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->delete_whats_app_template_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| template_name | String | Template name | |
| account_id | String | WhatsApp social account ID |
- Content-Type: Not defined
- Accept: application/json
delete_whatsapp_business_username(delete_whatsapp_business_username_request)
Delete business username
Release the currently claimed WhatsApp Business username from the account. After deletion the username becomes available for other accounts to claim.
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::WhatsAppApi.new
delete_whatsapp_business_username_request = Zernio::DeleteWhatsappBusinessUsernameRequest.new({account_id: 'account_id_example'}) # DeleteWhatsappBusinessUsernameRequest |
begin
# Delete business username
result = api_instance.delete_whatsapp_business_username(delete_whatsapp_business_username_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->delete_whatsapp_business_username: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> delete_whatsapp_business_username_with_http_info(delete_whatsapp_business_username_request)
begin
# Delete business username
data, status_code, headers = api_instance.delete_whatsapp_business_username_with_http_info(delete_whatsapp_business_username_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <UpdateYoutubeDefaultPlaylist200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->delete_whatsapp_business_username_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| delete_whatsapp_business_username_request | DeleteWhatsappBusinessUsernameRequest |
UpdateYoutubeDefaultPlaylist200Response
- Content-Type: application/json
- Accept: application/json
get_whats_app_block_status(account_id, user)
Check if a user is blocked
Definitive blocked-state lookup for a single contact. Meta exposes no membership endpoint, so this reads Zernio's blocklist mirror (kept in sync by the block/unblock endpoints; the first call per account backfills the mirror from Meta's full list). Constant-time regardless of blocklist size.
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::WhatsAppApi.new
account_id = 'account_id_example' # String |
user = 'user_example' # String | Consumer wa_id or E.164 phone (leading + optional)
begin
# Check if a user is blocked
result = api_instance.get_whats_app_block_status(account_id, user)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whats_app_block_status: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_whats_app_block_status_with_http_info(account_id, user)
begin
# Check if a user is blocked
data, status_code, headers = api_instance.get_whats_app_block_status_with_http_info(account_id, user)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetWhatsAppBlockStatus200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whats_app_block_status_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | ||
| user | String | Consumer wa_id or E.164 phone (leading + optional) |
GetWhatsAppBlockStatus200Response
- Content-Type: Not defined
- Accept: application/json
get_whats_app_blocked_users(account_id, opts)
List blocked users
List the WhatsApp users blocked on this number. Cursor-paginated; pass nextCursor back as after to fetch the next page. The blocklist holds up to 64,000 users.
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::WhatsAppApi.new
account_id = 'account_id_example' # String | WhatsApp social account ID
opts = {
limit: 56, # Integer | Page size.
after: 'after_example' # String | Cursor from a previous response's `nextCursor`.
}
begin
# List blocked users
result = api_instance.get_whats_app_blocked_users(account_id, opts)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whats_app_blocked_users: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_whats_app_blocked_users_with_http_info(account_id, opts)
begin
# List blocked users
data, status_code, headers = api_instance.get_whats_app_blocked_users_with_http_info(account_id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetWhatsAppBlockedUsers200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whats_app_blocked_users_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | WhatsApp social account ID | |
| limit | Integer | Page size. | [optional] |
| after | String | Cursor from a previous response's `nextCursor`. | [optional] |
GetWhatsAppBlockedUsers200Response
- Content-Type: Not defined
- Accept: application/json
get_whats_app_business_profile(account_id)
Get business profile
Retrieve the WhatsApp Business profile for the account (about, address, description, email, websites, etc.).
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::WhatsAppApi.new
account_id = 'account_id_example' # String | WhatsApp social account ID
begin
# Get business profile
result = api_instance.get_whats_app_business_profile(account_id)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whats_app_business_profile: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_whats_app_business_profile_with_http_info(account_id)
begin
# Get business profile
data, status_code, headers = api_instance.get_whats_app_business_profile_with_http_info(account_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetWhatsAppBusinessProfile200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whats_app_business_profile_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | WhatsApp social account ID |
GetWhatsAppBusinessProfile200Response
- Content-Type: Not defined
- Accept: application/json
get_whats_app_dataset(account_id)
Get CTWA conversions dataset
Returns the Meta Click-to-WhatsApp conversions dataset currently linked to the WhatsApp account, if one has been provisioned. Reads only from the stored metadata.metaCapiDatasetId — never hits Meta, never creates a dataset. Use this to detect whether POST /v1/whatsapp/conversions is configured for an account.
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::WhatsAppApi.new
account_id = 'account_id_example' # String | WhatsApp social account ID
begin
# Get CTWA conversions dataset
result = api_instance.get_whats_app_dataset(account_id)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whats_app_dataset: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_whats_app_dataset_with_http_info(account_id)
begin
# Get CTWA conversions dataset
data, status_code, headers = api_instance.get_whats_app_dataset_with_http_info(account_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetWhatsAppDataset200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whats_app_dataset_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | WhatsApp social account ID |
- Content-Type: Not defined
- Accept: application/json
get_whats_app_display_name(account_id)
Get display name status
Fetch the current display name and its Meta review status for a WhatsApp Business account. Display name changes require Meta approval and can take 1-3 business days.
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::WhatsAppApi.new
account_id = 'account_id_example' # String | WhatsApp social account ID
begin
# Get display name status
result = api_instance.get_whats_app_display_name(account_id)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whats_app_display_name: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_whats_app_display_name_with_http_info(account_id)
begin
# Get display name status
data, status_code, headers = api_instance.get_whats_app_display_name_with_http_info(account_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetWhatsAppDisplayName200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whats_app_display_name_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | WhatsApp social account ID |
GetWhatsAppDisplayName200Response
- Content-Type: Not defined
- Accept: application/json
get_whats_app_group_chat(group_id, account_id)
Get group info
Retrieve metadata about a WhatsApp group including subject, description, participants, and settings. Not available on Coexistence numbers. Requires a Cloud API-only number.
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::WhatsAppApi.new
group_id = 'group_id_example' # String | Group ID
account_id = 'account_id_example' # String | WhatsApp social account ID
begin
# Get group info
result = api_instance.get_whats_app_group_chat(group_id, account_id)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whats_app_group_chat: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_whats_app_group_chat_with_http_info(group_id, account_id)
begin
# Get group info
data, status_code, headers = api_instance.get_whats_app_group_chat_with_http_info(group_id, account_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetWhatsAppGroupChat200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whats_app_group_chat_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| group_id | String | Group ID | |
| account_id | String | WhatsApp social account ID |
GetWhatsAppGroupChat200Response
- Content-Type: Not defined
- Accept: application/json
File get_whats_app_media(media_id, account_id)
Download WhatsApp media
Streams the binary for a WhatsApp attachment. This is the endpoint the url on a WhatsApp attachments[] entry points at, in both the message.received webhook and the List messages response. This is an authenticated endpoint, not a public link. Send Authorization: Bearer <your API key> exactly as you would for any other call. Passing the URL straight to a browser, an LLM vision API, or a no-code "download file" step without the header returns 401. This is the most common integration mistake on this endpoint, and it differs from Instagram, Facebook and Telegram, whose attachments[].url is a direct CDN link that needs no header. Fetch on receipt, not lazily. WhatsApp media lives in Meta's media store, not ours, and it is removed after a limited retention window (currently 7 days, and Meta has been dropping some inbound media sooner). Once Meta drops it the media is unrecoverable and this endpoint answers 400 permanently, so retrying will never succeed. Download and store the bytes when the webhook arrives.
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::WhatsAppApi.new
media_id = 'media_id_example' # String | The media id from `attachments[].payload.id`.
account_id = 'account_id_example' # String | The WhatsApp account that received the media.
begin
# Download WhatsApp media
result = api_instance.get_whats_app_media(media_id, account_id)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whats_app_media: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(File, Integer, Hash)> get_whats_app_media_with_http_info(media_id, account_id)
begin
# Download WhatsApp media
data, status_code, headers = api_instance.get_whats_app_media_with_http_info(media_id, account_id)
p status_code # => 2xx
p headers # => { ... }
p data # => File
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whats_app_media_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| media_id | String | The media id from `attachments[].payload.id`. | |
| account_id | String | The WhatsApp account that received the media. |
File
- Content-Type: Not defined
- Accept: application/octet-stream, application/json
get_whats_app_template(template_name, account_id)
Get template
Retrieve a single message template by name.
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::WhatsAppApi.new
template_name = 'template_name_example' # String | Template name
account_id = 'account_id_example' # String | WhatsApp social account ID
begin
# Get template
result = api_instance.get_whats_app_template(template_name, account_id)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whats_app_template: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_whats_app_template_with_http_info(template_name, account_id)
begin
# Get template
data, status_code, headers = api_instance.get_whats_app_template_with_http_info(template_name, account_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetWhatsAppTemplate200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whats_app_template_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| template_name | String | Template name | |
| account_id | String | WhatsApp social account ID |
GetWhatsAppTemplate200Response
- Content-Type: Not defined
- Accept: application/json
get_whats_app_templates(account_id)
List templates
List all message templates for the WhatsApp Business Account (WABA) associated with the given account. Templates are fetched directly from the WhatsApp Cloud API.
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::WhatsAppApi.new
account_id = 'account_id_example' # String | WhatsApp social account ID
begin
# List templates
result = api_instance.get_whats_app_templates(account_id)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whats_app_templates: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_whats_app_templates_with_http_info(account_id)
begin
# List templates
data, status_code, headers = api_instance.get_whats_app_templates_with_http_info(account_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetWhatsAppTemplates200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whats_app_templates_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | WhatsApp social account ID |
GetWhatsAppTemplates200Response
- Content-Type: Not defined
- Accept: application/json
get_whatsapp_business_username(account_id)
Get business username
Fetch the current WhatsApp Business username and its approval status. Username status can be approved (active), reserved (pending activation), or none (no username set).
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::WhatsAppApi.new
account_id = 'account_id_example' # String | WhatsApp social account ID
begin
# Get business username
result = api_instance.get_whatsapp_business_username(account_id)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whatsapp_business_username: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_whatsapp_business_username_with_http_info(account_id)
begin
# Get business username
data, status_code, headers = api_instance.get_whatsapp_business_username_with_http_info(account_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetWhatsappBusinessUsername200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whatsapp_business_username_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | WhatsApp social account ID |
GetWhatsappBusinessUsername200Response
- Content-Type: Not defined
- Accept: application/json
get_whatsapp_business_username_suggestions(account_id)
Get username suggestions
Retrieve a list of available WhatsApp Business username suggestions based on the account's business profile name. Use these to help users discover valid, unclaimed usernames.
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::WhatsAppApi.new
account_id = 'account_id_example' # String | WhatsApp social account ID
begin
# Get username suggestions
result = api_instance.get_whatsapp_business_username_suggestions(account_id)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whatsapp_business_username_suggestions: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_whatsapp_business_username_suggestions_with_http_info(account_id)
begin
# Get username suggestions
data, status_code, headers = api_instance.get_whatsapp_business_username_suggestions_with_http_info(account_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <GetWhatsappBusinessUsernameSuggestions200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->get_whatsapp_business_username_suggestions_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | WhatsApp social account ID |
GetWhatsappBusinessUsernameSuggestions200Response
- Content-Type: Not defined
- Accept: application/json
list_whats_app_account_events(account_id, opts)
List account notifications
Returns Meta-originated events recorded for a WhatsApp account, newest first: template review outcomes (approved, rejected, paused, category changes) and WABA status changes (restricted, disabled, reinstated, disconnected). Events are captured from Meta webhooks as they happen; the feed starts at the account's first recorded event and is not backfilled. Complements the push events whatsapp.template.status_updated and account.disconnected with a pollable history.
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::WhatsAppApi.new
account_id = 'account_id_example' # String | WhatsApp social account ID
opts = {
limit: 56 # Integer | Maximum events to return
}
begin
# List account notifications
result = api_instance.list_whats_app_account_events(account_id, opts)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->list_whats_app_account_events: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> list_whats_app_account_events_with_http_info(account_id, opts)
begin
# List account notifications
data, status_code, headers = api_instance.list_whats_app_account_events_with_http_info(account_id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <ListWhatsAppAccountEvents200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->list_whats_app_account_events_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | WhatsApp social account ID | |
| limit | Integer | Maximum events to return | [optional][default to 50] |
ListWhatsAppAccountEvents200Response
- Content-Type: Not defined
- Accept: application/json
list_whats_app_conversions(account_id, opts)
List conversion events
Returns the most recent conversion events sent through POST /v1/whatsapp/conversions for the given WhatsApp account. Sourced from delivery logs (Axiom late dataset), so the visible window is bounded by log retention (about 30 days). Useful for rendering a "recent activity" panel on the conversions setup tab without standing up a parallel persistence layer. Per-event payload mirrors the structured log we write on every successful send: eventName, conversationId, eventsReceived, eventsFailed, traceId, durationMs, and the wall-clock timestamp.
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::WhatsAppApi.new
account_id = 'account_id_example' # String | WhatsApp social account ID
opts = {
limit: 56 # Integer | Max events to return (1-200, default 50).
}
begin
# List conversion events
result = api_instance.list_whats_app_conversions(account_id, opts)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->list_whats_app_conversions: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> list_whats_app_conversions_with_http_info(account_id, opts)
begin
# List conversion events
data, status_code, headers = api_instance.list_whats_app_conversions_with_http_info(account_id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <ListWhatsAppConversions200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->list_whats_app_conversions_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | WhatsApp social account ID | |
| limit | Integer | Max events to return (1-200, default 50). | [optional][default to 50] |
ListWhatsAppConversions200Response
- Content-Type: Not defined
- Accept: application/json
list_whats_app_group_chats(account_id, opts)
List active groups
List active WhatsApp group chats for a business phone number. These are actual WhatsApp group conversations on the platform. Not available on Coexistence numbers. Requires a Cloud API-only number.
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::WhatsAppApi.new
account_id = 'account_id_example' # String | WhatsApp social account ID
opts = {
limit: 56, # Integer | Max groups to return
after: 'after_example' # String | Pagination cursor
}
begin
# List active groups
result = api_instance.list_whats_app_group_chats(account_id, opts)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->list_whats_app_group_chats: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> list_whats_app_group_chats_with_http_info(account_id, opts)
begin
# List active groups
data, status_code, headers = api_instance.list_whats_app_group_chats_with_http_info(account_id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <ListWhatsAppGroupChats200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->list_whats_app_group_chats_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | WhatsApp social account ID | |
| limit | Integer | Max groups to return | [optional][default to 25] |
| after | String | Pagination cursor | [optional] |
ListWhatsAppGroupChats200Response
- Content-Type: Not defined
- Accept: application/json
list_whats_app_group_join_requests(group_id, account_id)
List join requests
List pending join requests for a WhatsApp group (only for groups with approval_required mode). Not available on Coexistence numbers. Requires a Cloud API-only number.
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::WhatsAppApi.new
group_id = 'group_id_example' # String | Group ID
account_id = 'account_id_example' # String | WhatsApp social account ID
begin
# List join requests
result = api_instance.list_whats_app_group_join_requests(group_id, account_id)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->list_whats_app_group_join_requests: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> list_whats_app_group_join_requests_with_http_info(group_id, account_id)
begin
# List join requests
data, status_code, headers = api_instance.list_whats_app_group_join_requests_with_http_info(group_id, account_id)
p status_code # => 2xx
p headers # => { ... }
p data # => <ListWhatsAppGroupJoinRequests200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->list_whats_app_group_join_requests_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| group_id | String | Group ID | |
| account_id | String | WhatsApp social account ID |
ListWhatsAppGroupJoinRequests200Response
- Content-Type: Not defined
- Accept: application/json
register_whats_app_number(account_id, opts)
Register a connected WhatsApp number on the Cloud API
Re-runs Meta's Cloud API registration for a WhatsApp account that is already connected. Use it when the number has its own two-step verification PIN: the connect flows register with a default PIN, Meta rejects that with error 133005, and the number then fails every send with the misleading '(#200) You do not have the necessary permission to send messages' while the account still shows as connected. The PIN is used for this call only and is not stored.
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::WhatsAppApi.new
account_id = 'account_id_example' # String | The WhatsApp account ID
opts = {
register_whats_app_number_request: Zernio::RegisterWhatsAppNumberRequest.new # RegisterWhatsAppNumberRequest |
}
begin
# Register a connected WhatsApp number on the Cloud API
result = api_instance.register_whats_app_number(account_id, opts)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->register_whats_app_number: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> register_whats_app_number_with_http_info(account_id, opts)
begin
# Register a connected WhatsApp number on the Cloud API
data, status_code, headers = api_instance.register_whats_app_number_with_http_info(account_id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <RegisterWhatsAppNumber200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->register_whats_app_number_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | The WhatsApp account ID | |
| register_whats_app_number_request | RegisterWhatsAppNumberRequest | [optional] |
RegisterWhatsAppNumber200Response
- Content-Type: application/json
- Accept: application/json
reject_whats_app_group_join_requests(group_id, account_id, reject_whats_app_group_join_requests_request)
Reject join requests
Reject pending join requests for a WhatsApp group. Not available on Coexistence numbers. Requires a Cloud API-only number.
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::WhatsAppApi.new
group_id = 'group_id_example' # String | Group ID
account_id = 'account_id_example' # String | WhatsApp social account ID
reject_whats_app_group_join_requests_request = Zernio::RejectWhatsAppGroupJoinRequestsRequest.new({phone_numbers: ['phone_numbers_example']}) # RejectWhatsAppGroupJoinRequestsRequest |
begin
# Reject join requests
result = api_instance.reject_whats_app_group_join_requests(group_id, account_id, reject_whats_app_group_join_requests_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->reject_whats_app_group_join_requests: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> reject_whats_app_group_join_requests_with_http_info(group_id, account_id, reject_whats_app_group_join_requests_request)
begin
# Reject join requests
data, status_code, headers = api_instance.reject_whats_app_group_join_requests_with_http_info(group_id, account_id, reject_whats_app_group_join_requests_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <UnpublishPost200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->reject_whats_app_group_join_requests_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| group_id | String | Group ID | |
| account_id | String | WhatsApp social account ID | |
| reject_whats_app_group_join_requests_request | RejectWhatsAppGroupJoinRequestsRequest |
- Content-Type: application/json
- Accept: application/json
remove_whats_app_group_participants(group_id, account_id, remove_whats_app_group_participants_request)
Remove participants
Remove participants from a WhatsApp group. Not available on Coexistence numbers. Requires a Cloud API-only number.
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::WhatsAppApi.new
group_id = 'group_id_example' # String | Group ID
account_id = 'account_id_example' # String | WhatsApp social account ID
remove_whats_app_group_participants_request = Zernio::RemoveWhatsAppGroupParticipantsRequest.new({phone_numbers: ['phone_numbers_example']}) # RemoveWhatsAppGroupParticipantsRequest |
begin
# Remove participants
result = api_instance.remove_whats_app_group_participants(group_id, account_id, remove_whats_app_group_participants_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->remove_whats_app_group_participants: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> remove_whats_app_group_participants_with_http_info(group_id, account_id, remove_whats_app_group_participants_request)
begin
# Remove participants
data, status_code, headers = api_instance.remove_whats_app_group_participants_with_http_info(group_id, account_id, remove_whats_app_group_participants_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <UnpublishPost200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->remove_whats_app_group_participants_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| group_id | String | Group ID | |
| account_id | String | WhatsApp social account ID | |
| remove_whats_app_group_participants_request | RemoveWhatsAppGroupParticipantsRequest |
- Content-Type: application/json
- Accept: application/json
send_whats_app_conversion(send_whats_app_conversion_request)
Send WhatsApp conversion event
Forward a WhatsApp Business Messaging conversion event (LeadSubmitted, Purchase, AddToCart, InitiateCheckout, ViewContent) to Meta's Conversions API with action_source = business_messaging and messaging_channel = whatsapp. The endpoint looks up the originating CTWA click ID (ctwa_clid) captured on the first inbound message of the conversation and replays it on every event so Meta can attribute the conversion back to the Click-to-WhatsApp ad that drove the chat. Configuration prerequisite on the WhatsApp account metadata: - metaCapiDatasetId: the Meta dataset ID linked to the WABA. Provision one with POST /v1/whatsapp/dataset. The WABA ID (already set automatically at connect time) is forwarded as user_data.whatsapp_business_account_id, which is the per-channel attribution identifier Meta requires for WhatsApp events. No Facebook Page ID is needed (that field is the Messenger-branch identifier). Identify the conversation by either conversationId (preferred) or phoneE164 (digits only, no +). At least one is required. If the conversation has no captured ctwa_clid, the request returns 422 because there is nothing to attribute. Token and dataset coupling: the WhatsApp account's accessToken must have access to the configured metaCapiDatasetId. By default a WABA's system-user token is scoped to the WABA's own Business Manager and cannot post to a pixel owned by a different Business; Meta returns code 100 in that case. Either share the dataset with the WhatsApp app's Business in BM, or use a dataset already in the same Business as the WABA.
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::WhatsAppApi.new
send_whats_app_conversion_request = Zernio::SendWhatsAppConversionRequest.new({account_id: 'account_id_example', event_name: 'LeadSubmitted', event_id: 'event_id_example'}) # SendWhatsAppConversionRequest |
begin
# Send WhatsApp conversion event
result = api_instance.send_whats_app_conversion(send_whats_app_conversion_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->send_whats_app_conversion: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> send_whats_app_conversion_with_http_info(send_whats_app_conversion_request)
begin
# Send WhatsApp conversion event
data, status_code, headers = api_instance.send_whats_app_conversion_with_http_info(send_whats_app_conversion_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <SendWhatsAppConversion200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->send_whats_app_conversion_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| send_whats_app_conversion_request | SendWhatsAppConversionRequest |
SendWhatsAppConversion200Response
- Content-Type: application/json
- Accept: application/json
set_whatsapp_business_username(set_whatsapp_business_username_request)
Set business username
Claim or transfer a WhatsApp Business username for the account. Username rules: 3-35 characters, letters/digits/period/underscore only, must contain at least one letter, no leading or trailing periods, no consecutive periods, no www prefix, no domain TLD suffix (e.g. .com). If the desired username is currently held by another account, pass transferAction: \"force_transfer\" to request a transfer. On failure the API returns a standard error envelope with one of these codes: whatsapp_username_unavailable (already taken and transfer not requested), whatsapp_username_ineligible (account not eligible to claim a username), or whatsapp_username_transfer_required (username is held elsewhere; retry with force_transfer).
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::WhatsAppApi.new
set_whatsapp_business_username_request = Zernio::SetWhatsappBusinessUsernameRequest.new({account_id: 'account_id_example', username: 'username_example'}) # SetWhatsappBusinessUsernameRequest |
begin
# Set business username
result = api_instance.set_whatsapp_business_username(set_whatsapp_business_username_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->set_whatsapp_business_username: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> set_whatsapp_business_username_with_http_info(set_whatsapp_business_username_request)
begin
# Set business username
data, status_code, headers = api_instance.set_whatsapp_business_username_with_http_info(set_whatsapp_business_username_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <SetWhatsappBusinessUsername200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->set_whatsapp_business_username_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| set_whatsapp_business_username_request | SetWhatsappBusinessUsernameRequest |
SetWhatsappBusinessUsername200Response
- Content-Type: application/json
- Accept: application/json
unblock_whats_app_users(unblock_whats_app_users_request)
Unblock users
Unblock one or more previously blocked WhatsApp users on this number. Up to 1,000 users per request; per-user failures are reported in failed without failing the rest of the batch.
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::WhatsAppApi.new
unblock_whats_app_users_request = Zernio::UnblockWhatsAppUsersRequest.new({account_id: 'account_id_example', users: ['users_example']}) # UnblockWhatsAppUsersRequest |
begin
# Unblock users
result = api_instance.unblock_whats_app_users(unblock_whats_app_users_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->unblock_whats_app_users: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> unblock_whats_app_users_with_http_info(unblock_whats_app_users_request)
begin
# Unblock users
data, status_code, headers = api_instance.unblock_whats_app_users_with_http_info(unblock_whats_app_users_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <UnblockWhatsAppUsers200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->unblock_whats_app_users_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| unblock_whats_app_users_request | UnblockWhatsAppUsersRequest |
UnblockWhatsAppUsers200Response
- Content-Type: application/json
- Accept: application/json
update_whats_app_business_profile(update_whats_app_business_profile_request)
Update business profile
Update the WhatsApp Business profile. All fields are optional; only provided fields will be updated. Constraints: about max 139 chars, description max 512 chars, max 2 websites.
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::WhatsAppApi.new
update_whats_app_business_profile_request = Zernio::UpdateWhatsAppBusinessProfileRequest.new({account_id: 'account_id_example'}) # UpdateWhatsAppBusinessProfileRequest |
begin
# Update business profile
result = api_instance.update_whats_app_business_profile(update_whats_app_business_profile_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->update_whats_app_business_profile: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> update_whats_app_business_profile_with_http_info(update_whats_app_business_profile_request)
begin
# Update business profile
data, status_code, headers = api_instance.update_whats_app_business_profile_with_http_info(update_whats_app_business_profile_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <UnpublishPost200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->update_whats_app_business_profile_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| update_whats_app_business_profile_request | UpdateWhatsAppBusinessProfileRequest |
- Content-Type: application/json
- Accept: application/json
update_whats_app_display_name(update_whats_app_display_name_request)
Request display name change
Submit a display name change request for the WhatsApp Business account. The new name must follow WhatsApp naming guidelines (3-512 characters, must represent your business). Changes require Meta review and approval, which typically takes 1-3 business days.
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::WhatsAppApi.new
update_whats_app_display_name_request = Zernio::UpdateWhatsAppDisplayNameRequest.new({account_id: 'account_id_example', display_name: 'display_name_example'}) # UpdateWhatsAppDisplayNameRequest |
begin
# Request display name change
result = api_instance.update_whats_app_display_name(update_whats_app_display_name_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->update_whats_app_display_name: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> update_whats_app_display_name_with_http_info(update_whats_app_display_name_request)
begin
# Request display name change
data, status_code, headers = api_instance.update_whats_app_display_name_with_http_info(update_whats_app_display_name_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <UpdateWhatsAppDisplayName200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->update_whats_app_display_name_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| update_whats_app_display_name_request | UpdateWhatsAppDisplayNameRequest |
UpdateWhatsAppDisplayName200Response
- Content-Type: application/json
- Accept: application/json
update_whats_app_group_chat(group_id, account_id, update_whats_app_group_chat_request)
Update group settings
Update the subject, description, or join approval mode of a WhatsApp group. Not available on Coexistence numbers. Requires a Cloud API-only number.
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::WhatsAppApi.new
group_id = 'group_id_example' # String | Group ID
account_id = 'account_id_example' # String | WhatsApp social account ID
update_whats_app_group_chat_request = Zernio::UpdateWhatsAppGroupChatRequest.new # UpdateWhatsAppGroupChatRequest |
begin
# Update group settings
result = api_instance.update_whats_app_group_chat(group_id, account_id, update_whats_app_group_chat_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->update_whats_app_group_chat: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> update_whats_app_group_chat_with_http_info(group_id, account_id, update_whats_app_group_chat_request)
begin
# Update group settings
data, status_code, headers = api_instance.update_whats_app_group_chat_with_http_info(group_id, account_id, update_whats_app_group_chat_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <UnpublishPost200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->update_whats_app_group_chat_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| group_id | String | Group ID | |
| account_id | String | WhatsApp social account ID | |
| update_whats_app_group_chat_request | UpdateWhatsAppGroupChatRequest |
- Content-Type: application/json
- Accept: application/json
update_whats_app_template(template_name, update_whats_app_template_request)
Update template
Update a message template's components. Only certain fields can be updated depending on the template's current approval state. Approved templates can only have components updated.
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::WhatsAppApi.new
template_name = 'template_name_example' # String | Template name
update_whats_app_template_request = Zernio::UpdateWhatsAppTemplateRequest.new({account_id: 'account_id_example', components: [Zernio::WhatsAppBodyComponent.new({type: 'body', text: 'text_example'})]}) # UpdateWhatsAppTemplateRequest |
begin
# Update template
result = api_instance.update_whats_app_template(template_name, update_whats_app_template_request)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->update_whats_app_template: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> update_whats_app_template_with_http_info(template_name, update_whats_app_template_request)
begin
# Update template
data, status_code, headers = api_instance.update_whats_app_template_with_http_info(template_name, update_whats_app_template_request)
p status_code # => 2xx
p headers # => { ... }
p data # => <UpdateWhatsAppTemplate200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->update_whats_app_template_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| template_name | String | Template name | |
| update_whats_app_template_request | UpdateWhatsAppTemplateRequest |
UpdateWhatsAppTemplate200Response
- Content-Type: application/json
- Accept: application/json
upload_whats_app_profile_photo(account_id, file)
Upload profile picture
Upload a new profile picture for the WhatsApp Business Profile. Uses Meta's resumable upload API under the hood: creates an upload session, uploads the image bytes, then updates the business profile with the resulting handle. Provide the image either as a binary upload (multipart/form-data with file) or as a download URL (application/json with url) — with a URL we fetch the image server-side and upload the bytes for you. Meta's profile-photo API is bytes-only, so there is no direct URL passthrough. JPEG/PNG, max 5MB either way.
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::WhatsAppApi.new
account_id = 'account_id_example' # String | WhatsApp social account ID
file = File.new('/path/to/some/file') # File | Image file (JPEG or PNG, max 5MB, recommended 640x640)
begin
# Upload profile picture
result = api_instance.upload_whats_app_profile_photo(account_id, file)
p result
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->upload_whats_app_profile_photo: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> upload_whats_app_profile_photo_with_http_info(account_id, file)
begin
# Upload profile picture
data, status_code, headers = api_instance.upload_whats_app_profile_photo_with_http_info(account_id, file)
p status_code # => 2xx
p headers # => { ... }
p data # => <UnpublishPost200Response>
rescue Zernio::ApiError => e
puts "Error when calling WhatsAppApi->upload_whats_app_profile_photo_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| account_id | String | WhatsApp social account ID | |
| file | File | Image file (JPEG or PNG, max 5MB, recommended 640x640) |
- Content-Type: multipart/form-data, application/json
- Accept: application/json