zernio-sdk 0.0.787 → 0.0.789

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d30bccee7c44b7e2613311bb6f2a88f149ece5716e1023b9192803ec4abdcfe4
4
- data.tar.gz: 19c7c6f3c402fb0734182802b0d0cc3f377e3123ccce7fcfbb3679d79e5ea7f1
3
+ metadata.gz: 841e99f885f721b747bea2d24517463f58d1173beb236e52d2c88133d77ec1f2
4
+ data.tar.gz: 953271a1ad16fda5c3bba95182d77811dcf6a8e1699e8bcbb5a86872e740c13f
5
5
  SHA512:
6
- metadata.gz: fde8605af9ad08e7df543ddce999cd61fc97c2dbf46bbbd67ac1b27c3ebdb3f3afe9ea630c1c69d3d6379877d68b8cc4bde61fbc8993dfa921b4834db3393ccd
7
- data.tar.gz: e768cc84bd9ec8323ca0fa974c6b58fb441d8723ae2d17e2ec23b2508e249983dee0fa9243bae92cda0100b3b9f03c553edfb1678378c93125192fb0e6aa75a0
6
+ metadata.gz: 4610606198363daf61c61159e373fd198fc8a5fc57e1de283cd5a1cf0d4ec9d36d173acf27748d8489c998a1dd557be77967296aca64c7eac055684d303483ea
7
+ data.tar.gz: c2baa6fcdbc98b8eb86606a7aab73864ebb229b56bc9b2683ae953abde7cbd1c5c5867357e281d086a6269a3551533c623e7eeae446a590d3f2c367255e4e32e
data/README.md CHANGED
@@ -916,6 +916,7 @@ Class | Method | HTTP request | Description
916
916
  - [Zernio::CreateInboxConversation422Response](docs/CreateInboxConversation422Response.md)
917
917
  - [Zernio::CreateInboxConversation429Response](docs/CreateInboxConversation429Response.md)
918
918
  - [Zernio::CreateInboxConversationRequest](docs/CreateInboxConversationRequest.md)
919
+ - [Zernio::CreateInboxConversationRequestHeaderLocation](docs/CreateInboxConversationRequestHeaderLocation.md)
919
920
  - [Zernio::CreateInboxConversationRequestHeaderMedia](docs/CreateInboxConversationRequestHeaderMedia.md)
920
921
  - [Zernio::CreateInboxConversationRequestTemplateButtonParamsInner](docs/CreateInboxConversationRequestTemplateButtonParamsInner.md)
921
922
  - [Zernio::CreateInviteToken201Response](docs/CreateInviteToken201Response.md)
@@ -1934,6 +1935,8 @@ Class | Method | HTTP request | Description
1934
1935
  - [Zernio::SendInboxMessage200Response](docs/SendInboxMessage200Response.md)
1935
1936
  - [Zernio::SendInboxMessage200ResponseData](docs/SendInboxMessage200ResponseData.md)
1936
1937
  - [Zernio::SendInboxMessage200ResponseDataAttachmentsInner](docs/SendInboxMessage200ResponseDataAttachmentsInner.md)
1938
+ - [Zernio::SendInboxMessage200ResponseDataPartialFailure](docs/SendInboxMessage200ResponseDataPartialFailure.md)
1939
+ - [Zernio::SendInboxMessage200ResponseDataPartialFailurePlatformError](docs/SendInboxMessage200ResponseDataPartialFailurePlatformError.md)
1937
1940
  - [Zernio::SendInboxMessage400Response](docs/SendInboxMessage400Response.md)
1938
1941
  - [Zernio::SendInboxMessage400ResponsePlatformError](docs/SendInboxMessage400ResponsePlatformError.md)
1939
1942
  - [Zernio::SendInboxMessageRequest](docs/SendInboxMessageRequest.md)
@@ -16,6 +16,7 @@
16
16
  | **template_params** | **Array<String>** | WhatsApp only. Template variable values as one flat array, in the order the variables appear across the whole template: text-header variables first, then body variables, then one value per dynamic URL button (in button order). Works with positional placeholders ({{1}}, {{2}}, ...) and with named placeholders ({{name}}, {{company}} - how Meta Business Manager creates templates), where values fill the named slots in order of appearance. Example - a body with {{1}}, {{2}} plus a URL button https://example.com/{{1}} takes three values: [body1, body2, buttonSuffix]. Media headers (image, video, document) are filled automatically from the approved template and take no value here (use headerMedia to override the header asset per send). Buttons that are not dynamic-URL buttons (copy-code, flow) take no value here either; use templateButtonParams. | [optional] |
17
17
  | **template_button_params** | [**Array<CreateInboxConversationRequestTemplateButtonParamsInner>**](CreateInboxConversationRequestTemplateButtonParamsInner.md) | WhatsApp only. Values for template buttons that carry one at send time, each addressed by the button's position in the approved template. This is the only way to send a copy-code button's payload (a Pix payment code, a coupon) or a flow token, because templateParams is a flat array of text variables and covers dynamic URL buttons only. Supplying a button here overrides whatever templateParams would have derived for that same index, so the send never carries one button twice; repeating an index within this array is rejected with 400. Each index must name a button of the matching kind on the approved template, which is also checked before the send and returns 400 (INVALID_TEMPLATE_BUTTON_PARAM) rather than a Meta rejection. | [optional] |
18
18
  | **header_media** | [**CreateInboxConversationRequestHeaderMedia**](CreateInboxConversationRequestHeaderMedia.md) | | [optional] |
19
+ | **header_location** | [**CreateInboxConversationRequestHeaderLocation**](CreateInboxConversationRequestHeaderLocation.md) | | [optional] |
19
20
 
20
21
  ## Example
21
22
 
@@ -34,7 +35,8 @@ instance = Zernio::CreateInboxConversationRequest.new(
34
35
  template_language: null,
35
36
  template_params: null,
36
37
  template_button_params: null,
37
- header_media: null
38
+ header_media: null,
39
+ header_location: null
38
40
  )
39
41
  ```
40
42
 
@@ -0,0 +1,24 @@
1
+ # Zernio::CreateInboxConversationRequestHeaderLocation
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **latitude** | **Float** | Latitude in decimal degrees. | |
8
+ | **longitude** | **Float** | Longitude in decimal degrees. | |
9
+ | **name** | **String** | Location name shown to the recipient (e.g. a business name). | [optional] |
10
+ | **address** | **String** | Location address shown to the recipient. | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'zernio-sdk'
16
+
17
+ instance = Zernio::CreateInboxConversationRequestHeaderLocation.new(
18
+ latitude: null,
19
+ longitude: null,
20
+ name: null,
21
+ address: null
22
+ )
23
+ ```
24
+
data/docs/MessagesApi.md CHANGED
@@ -100,7 +100,7 @@ end
100
100
 
101
101
  Create conversation
102
102
 
103
- Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, WhatsApp, SMS, and Slack. Other platforms return PLATFORM_NOT_SUPPORTED. Slack: pass a workspace member id as participantId (list them with GET /v1/accounts/{accountId}/slack-members). Zernio opens the DM channel with that member and sends the message; the thread then behaves like any other Slack conversation in the inbox. The member must belong to the connected workspace. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. A button that carries its own value at send time (a copy-code button holding a Pix payment code or a coupon, a flow token) is sent with templateButtonParams, addressed by the button's index; templateParams covers text variables and dynamic URL buttons only. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: 'utility' together with message (and no templateName). See the category field below. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X's DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta's per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
103
+ Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, WhatsApp, SMS, and Slack. Other platforms return PLATFORM_NOT_SUPPORTED. Slack: pass a workspace member id as participantId (list them with GET /v1/accounts/{accountId}/slack-members). Zernio opens the DM channel with that member and sends the message; the thread then behaves like any other Slack conversation in the inbox. The member must belong to the connected workspace. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. A template whose approved header format is LOCATION has no header asset to reconstruct at all: Meta only accepts the location at send time, so pass headerLocation (latitude and longitude required) whenever such a template is sent; headerMedia and headerLocation cannot both be supplied. A button that carries its own value at send time (a copy-code button holding a Pix payment code or a coupon, a flow token) is sent with templateButtonParams, addressed by the button's index; templateParams covers text variables and dynamic URL buttons only. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: 'utility' together with message (and no templateName). See the category field below. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X's DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta's per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
104
104
 
105
105
  ### Examples
106
106
 
@@ -7,6 +7,8 @@
7
7
  | **message_id** | **String** | Platform id of the sent message (not returned for Reddit). For WhatsApp this is the raw Meta wamid, the same id delivered as message.platformMessageId on webhooks and delivery-status updates, and the value to pass as replyTo to quote-reply. | [optional] |
8
8
  | **conversation_id** | **String** | Zernio conversation id, echoed so the thread can be read back or replied to. It equals the id the list-conversations endpoint returns for Telegram, WhatsApp, SMS and Slack; for Facebook, Instagram, Bluesky and Reddit that endpoint returns the platform thread id instead, so do not correlate the two by equality. For X (Twitter), when the request addressed the conversation by its Twitter dm_conversation_id, that platform id is echoed back instead. Omitted when the send succeeded but the conversation could not be resolved to a stored record. | [optional] |
9
9
  | **attachments** | [**Array<SendInboxMessage200ResponseDataAttachmentsInner>**](SendInboxMessage200ResponseDataAttachmentsInner.md) | Echo of the sent attachment with its resolved public URL, when one is available (Facebook, Instagram, Telegram, WhatsApp). | [optional] |
10
+ | **message_ids** | **Array<String>** | Facebook/Instagram only. Present when an attachment and text were both requested: Meta has no single body shape for both, so the send is two Meta messages under the hood. First element === messageId (the attachment); second is the follow-up text. | [optional] |
11
+ | **partial_failure** | [**SendInboxMessage200ResponseDataPartialFailure**](SendInboxMessage200ResponseDataPartialFailure.md) | | [optional] |
10
12
 
11
13
  ## Example
12
14
 
@@ -16,7 +18,9 @@ require 'zernio-sdk'
16
18
  instance = Zernio::SendInboxMessage200ResponseData.new(
17
19
  message_id: null,
18
20
  conversation_id: null,
19
- attachments: null
21
+ attachments: null,
22
+ message_ids: null,
23
+ partial_failure: null
20
24
  )
21
25
  ```
22
26
 
@@ -0,0 +1,22 @@
1
+ # Zernio::SendInboxMessage200ResponseDataPartialFailure
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **part** | **String** | | [optional] |
8
+ | **error** | **String** | | [optional] |
9
+ | **platform_error** | [**SendInboxMessage200ResponseDataPartialFailurePlatformError**](SendInboxMessage200ResponseDataPartialFailurePlatformError.md) | | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'zernio-sdk'
15
+
16
+ instance = Zernio::SendInboxMessage200ResponseDataPartialFailure.new(
17
+ part: null,
18
+ error: null,
19
+ platform_error: null
20
+ )
21
+ ```
22
+
@@ -0,0 +1,24 @@
1
+ # Zernio::SendInboxMessage200ResponseDataPartialFailurePlatformError
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **code** | **Integer** | Meta error code | [optional] |
8
+ | **subcode** | **Integer** | Meta error_subcode | [optional] |
9
+ | **fbtrace_id** | **String** | Meta fbtrace_id, quote this in a Meta bug report | [optional] |
10
+ | **type** | **String** | Meta error type (e.g. OAuthException) | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'zernio-sdk'
16
+
17
+ instance = Zernio::SendInboxMessage200ResponseDataPartialFailurePlatformError.new(
18
+ code: null,
19
+ subcode: null,
20
+ fbtrace_id: null,
21
+ type: null
22
+ )
23
+ ```
24
+
@@ -100,7 +100,7 @@ module Zernio
100
100
  end
101
101
 
102
102
  # Create conversation
103
- # Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, WhatsApp, SMS, and Slack. Other platforms return PLATFORM_NOT_SUPPORTED. Slack: pass a workspace member id as participantId (list them with GET /v1/accounts/{accountId}/slack-members). Zernio opens the DM channel with that member and sends the message; the thread then behaves like any other Slack conversation in the inbox. The member must belong to the connected workspace. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. A button that carries its own value at send time (a copy-code button holding a Pix payment code or a coupon, a flow token) is sent with templateButtonParams, addressed by the button's index; templateParams covers text variables and dynamic URL buttons only. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: 'utility' together with message (and no templateName). See the category field below. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X's DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta's per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
103
+ # Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, WhatsApp, SMS, and Slack. Other platforms return PLATFORM_NOT_SUPPORTED. Slack: pass a workspace member id as participantId (list them with GET /v1/accounts/{accountId}/slack-members). Zernio opens the DM channel with that member and sends the message; the thread then behaves like any other Slack conversation in the inbox. The member must belong to the connected workspace. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. A template whose approved header format is LOCATION has no header asset to reconstruct at all: Meta only accepts the location at send time, so pass headerLocation (latitude and longitude required) whenever such a template is sent; headerMedia and headerLocation cannot both be supplied. A button that carries its own value at send time (a copy-code button holding a Pix payment code or a coupon, a flow token) is sent with templateButtonParams, addressed by the button's index; templateParams covers text variables and dynamic URL buttons only. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: 'utility' together with message (and no templateName). See the category field below. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X's DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta's per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
104
104
  # @param create_inbox_conversation_request [CreateInboxConversationRequest]
105
105
  # @param [Hash] opts the optional parameters
106
106
  # @return [CreateInboxConversation201Response]
@@ -110,7 +110,7 @@ module Zernio
110
110
  end
111
111
 
112
112
  # Create conversation
113
- # Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, WhatsApp, SMS, and Slack. Other platforms return PLATFORM_NOT_SUPPORTED. Slack: pass a workspace member id as participantId (list them with GET /v1/accounts/{accountId}/slack-members). Zernio opens the DM channel with that member and sends the message; the thread then behaves like any other Slack conversation in the inbox. The member must belong to the connected workspace. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. A button that carries its own value at send time (a copy-code button holding a Pix payment code or a coupon, a flow token) is sent with templateButtonParams, addressed by the button's index; templateParams covers text variables and dynamic URL buttons only. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: 'utility' together with message (and no templateName). See the category field below. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X's DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta's per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
113
+ # Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. Supported platforms: X/Twitter, Bluesky, Reddit, WhatsApp, SMS, and Slack. Other platforms return PLATFORM_NOT_SUPPORTED. Slack: pass a workspace member id as participantId (list them with GET /v1/accounts/{accountId}/slack-members). Zernio opens the DM channel with that member and sends the message; the thread then behaves like any other Slack conversation in the inbox. The member must belong to the connected workspace. WhatsApp: this is the endpoint for sending an approved template message to a phone number. Provide templateName, templateLanguage, and templateParams (variable values for the text header, body and dynamic URL buttons, in that order), with the recipient phone in participantId. A template is required because WhatsApp does not permit freeform messages to open a conversation; a missing template returns TEMPLATE_REQUIRED. Templates with media headers (image, video, document) are handled automatically: Zernio reads the approved template definition and fills the header at send time with the template's approved sample asset. To send a DIFFERENT asset per message (e.g. a distinct invoice PDF for each recipient), pass the headerMedia field with a public link (or a Meta media id); it overrides the sample for that send. A template whose approved header format is LOCATION has no header asset to reconstruct at all: Meta only accepts the location at send time, so pass headerLocation (latitude and longitude required) whenever such a template is sent; headerMedia and headerLocation cannot both be supplied. A button that carries its own value at send time (a copy-code button holding a Pix payment code or a coupon, a flow token) is sent with templateButtonParams, addressed by the button's index; templateParams covers text variables and dynamic URL buttons only. Calling this for a number you already have a thread with simply sends the template into that thread, which also makes it the way to re-engage a contact after the 24-hour customer-service window has closed. Once the recipient replies (opening the 24h window), send freeform messages with the send-message endpoint (POST /v1/inbox/conversations/{conversationId}/messages). Template fields are accepted on the JSON body only, not on multipart requests. Alternatively, WhatsApp Business Accounts eligible for Meta Direct Send can open a conversation with a business-initiated utility text message and no template: pass category: 'utility' together with message (and no templateName). See the category field below. DM eligibility (X/Twitter): Before sending, the endpoint checks if the recipient accepts DMs from your account (via the receives_your_dm field). If not, a 422 error with code DM_NOT_ALLOWED is returned. You can skip this check with skipDmCheck: true if you have already verified eligibility. X API tier requirement: DM write endpoints require X API Pro tier ($5,000/month) or Enterprise access. This applies to BYOK (Bring Your Own Key) users who provide their own X API credentials. Rate limits (X/Twitter only): X's DM API enforces 200 requests per 15 minutes, 1,000 per 24 hours per connected X account, and 15,000 per 24 hours per X developer app (shared across all DM endpoints). These limits do NOT apply to other platforms. WhatsApp sends are governed by Meta's per-number messaging tiers (unique business-initiated conversations per 24 hours) and per-number throughput instead.
114
114
  # @param create_inbox_conversation_request [CreateInboxConversationRequest]
115
115
  # @param [Hash] opts the optional parameters
116
116
  # @return [Array<(CreateInboxConversation201Response, Integer, Hash)>] CreateInboxConversation201Response data, response status code and response headers
@@ -50,6 +50,8 @@ module Zernio
50
50
 
51
51
  attr_accessor :header_media
52
52
 
53
+ attr_accessor :header_location
54
+
53
55
  class EnumAttributeValidator
54
56
  attr_reader :datatype
55
57
  attr_reader :allowable_values
@@ -86,7 +88,8 @@ module Zernio
86
88
  :'template_language' => :'templateLanguage',
87
89
  :'template_params' => :'templateParams',
88
90
  :'template_button_params' => :'templateButtonParams',
89
- :'header_media' => :'headerMedia'
91
+ :'header_media' => :'headerMedia',
92
+ :'header_location' => :'headerLocation'
90
93
  }
91
94
  end
92
95
 
@@ -114,7 +117,8 @@ module Zernio
114
117
  :'template_language' => :'String',
115
118
  :'template_params' => :'Array<String>',
116
119
  :'template_button_params' => :'Array<CreateInboxConversationRequestTemplateButtonParamsInner>',
117
- :'header_media' => :'CreateInboxConversationRequestHeaderMedia'
120
+ :'header_media' => :'CreateInboxConversationRequestHeaderMedia',
121
+ :'header_location' => :'CreateInboxConversationRequestHeaderLocation'
118
122
  }
119
123
  end
120
124
 
@@ -197,6 +201,10 @@ module Zernio
197
201
  if attributes.key?(:'header_media')
198
202
  self.header_media = attributes[:'header_media']
199
203
  end
204
+
205
+ if attributes.key?(:'header_location')
206
+ self.header_location = attributes[:'header_location']
207
+ end
200
208
  end
201
209
 
202
210
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -276,7 +284,8 @@ module Zernio
276
284
  template_language == o.template_language &&
277
285
  template_params == o.template_params &&
278
286
  template_button_params == o.template_button_params &&
279
- header_media == o.header_media
287
+ header_media == o.header_media &&
288
+ header_location == o.header_location
280
289
  end
281
290
 
282
291
  # @see the `==` method
@@ -288,7 +297,7 @@ module Zernio
288
297
  # Calculates hash code according to all attributes.
289
298
  # @return [Integer] Hash code
290
299
  def hash
291
- [account_id, participant_id, participant_username, message, skip_dm_check, template_name, category, link_preview, template_language, template_params, template_button_params, header_media].hash
300
+ [account_id, participant_id, participant_username, message, skip_dm_check, template_name, category, link_preview, template_language, template_params, template_button_params, header_media, header_location].hash
292
301
  end
293
302
 
294
303
  # Builds the object from hash
@@ -0,0 +1,213 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ # WhatsApp only. Required to send a template whose approved header format is LOCATION: Meta only accepts the location's lat/long at send time, never at template creation, so there is nothing to fill in automatically. Cannot be combined with headerMedia (a template has exactly one header).
18
+ class CreateInboxConversationRequestHeaderLocation < ApiModelBase
19
+ # Latitude in decimal degrees.
20
+ attr_accessor :latitude
21
+
22
+ # Longitude in decimal degrees.
23
+ attr_accessor :longitude
24
+
25
+ # Location name shown to the recipient (e.g. a business name).
26
+ attr_accessor :name
27
+
28
+ # Location address shown to the recipient.
29
+ attr_accessor :address
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'latitude' => :'latitude',
35
+ :'longitude' => :'longitude',
36
+ :'name' => :'name',
37
+ :'address' => :'address'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'latitude' => :'Float',
55
+ :'longitude' => :'Float',
56
+ :'name' => :'String',
57
+ :'address' => :'String'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ ])
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateInboxConversationRequestHeaderLocation` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ acceptable_attribute_map = self.class.acceptable_attribute_map
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!acceptable_attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateInboxConversationRequestHeaderLocation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'latitude')
84
+ self.latitude = attributes[:'latitude']
85
+ else
86
+ self.latitude = nil
87
+ end
88
+
89
+ if attributes.key?(:'longitude')
90
+ self.longitude = attributes[:'longitude']
91
+ else
92
+ self.longitude = nil
93
+ end
94
+
95
+ if attributes.key?(:'name')
96
+ self.name = attributes[:'name']
97
+ end
98
+
99
+ if attributes.key?(:'address')
100
+ self.address = attributes[:'address']
101
+ end
102
+ end
103
+
104
+ # Show invalid properties with the reasons. Usually used together with valid?
105
+ # @return Array for valid properties with the reasons
106
+ def list_invalid_properties
107
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
108
+ invalid_properties = Array.new
109
+ if @latitude.nil?
110
+ invalid_properties.push('invalid value for "latitude", latitude cannot be nil.')
111
+ end
112
+
113
+ if @longitude.nil?
114
+ invalid_properties.push('invalid value for "longitude", longitude cannot be nil.')
115
+ end
116
+
117
+ invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+ warn '[DEPRECATED] the `valid?` method is obsolete'
124
+ return false if @latitude.nil?
125
+ return false if @longitude.nil?
126
+ true
127
+ end
128
+
129
+ # Custom attribute writer method with validation
130
+ # @param [Object] latitude Value to be assigned
131
+ def latitude=(latitude)
132
+ if latitude.nil?
133
+ fail ArgumentError, 'latitude cannot be nil'
134
+ end
135
+
136
+ @latitude = latitude
137
+ end
138
+
139
+ # Custom attribute writer method with validation
140
+ # @param [Object] longitude Value to be assigned
141
+ def longitude=(longitude)
142
+ if longitude.nil?
143
+ fail ArgumentError, 'longitude cannot be nil'
144
+ end
145
+
146
+ @longitude = longitude
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ latitude == o.latitude &&
155
+ longitude == o.longitude &&
156
+ name == o.name &&
157
+ address == o.address
158
+ end
159
+
160
+ # @see the `==` method
161
+ # @param [Object] Object to be compared
162
+ def eql?(o)
163
+ self == o
164
+ end
165
+
166
+ # Calculates hash code according to all attributes.
167
+ # @return [Integer] Hash code
168
+ def hash
169
+ [latitude, longitude, name, address].hash
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def self.build_from_hash(attributes)
176
+ return nil unless attributes.is_a?(Hash)
177
+ attributes = attributes.transform_keys(&:to_sym)
178
+ transformed_hash = {}
179
+ openapi_types.each_pair do |key, type|
180
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
181
+ transformed_hash["#{key}"] = nil
182
+ elsif type =~ /\AArray<(.*)>/i
183
+ # check to ensure the input is an array given that the attribute
184
+ # is documented as an array but the input is not
185
+ if attributes[attribute_map[key]].is_a?(Array)
186
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
187
+ end
188
+ elsif !attributes[attribute_map[key]].nil?
189
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
190
+ end
191
+ end
192
+ new(transformed_hash)
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ if value.nil?
202
+ is_nullable = self.class.openapi_nullable.include?(attr)
203
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
204
+ end
205
+
206
+ hash[param] = _to_hash(value)
207
+ end
208
+ hash
209
+ end
210
+
211
+ end
212
+
213
+ end
@@ -24,12 +24,19 @@ module Zernio
24
24
  # Echo of the sent attachment with its resolved public URL, when one is available (Facebook, Instagram, Telegram, WhatsApp).
25
25
  attr_accessor :attachments
26
26
 
27
+ # Facebook/Instagram only. Present when an attachment and text were both requested: Meta has no single body shape for both, so the send is two Meta messages under the hood. First element === messageId (the attachment); second is the follow-up text.
28
+ attr_accessor :message_ids
29
+
30
+ attr_accessor :partial_failure
31
+
27
32
  # Attribute mapping from ruby-style variable name to JSON key.
28
33
  def self.attribute_map
29
34
  {
30
35
  :'message_id' => :'messageId',
31
36
  :'conversation_id' => :'conversationId',
32
- :'attachments' => :'attachments'
37
+ :'attachments' => :'attachments',
38
+ :'message_ids' => :'messageIds',
39
+ :'partial_failure' => :'partialFailure'
33
40
  }
34
41
  end
35
42
 
@@ -48,7 +55,9 @@ module Zernio
48
55
  {
49
56
  :'message_id' => :'String',
50
57
  :'conversation_id' => :'String',
51
- :'attachments' => :'Array<SendInboxMessage200ResponseDataAttachmentsInner>'
58
+ :'attachments' => :'Array<SendInboxMessage200ResponseDataAttachmentsInner>',
59
+ :'message_ids' => :'Array<String>',
60
+ :'partial_failure' => :'SendInboxMessage200ResponseDataPartialFailure'
52
61
  }
53
62
  end
54
63
 
@@ -87,6 +96,16 @@ module Zernio
87
96
  self.attachments = value
88
97
  end
89
98
  end
99
+
100
+ if attributes.key?(:'message_ids')
101
+ if (value = attributes[:'message_ids']).is_a?(Array)
102
+ self.message_ids = value
103
+ end
104
+ end
105
+
106
+ if attributes.key?(:'partial_failure')
107
+ self.partial_failure = attributes[:'partial_failure']
108
+ end
90
109
  end
91
110
 
92
111
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -111,7 +130,9 @@ module Zernio
111
130
  self.class == o.class &&
112
131
  message_id == o.message_id &&
113
132
  conversation_id == o.conversation_id &&
114
- attachments == o.attachments
133
+ attachments == o.attachments &&
134
+ message_ids == o.message_ids &&
135
+ partial_failure == o.partial_failure
115
136
  end
116
137
 
117
138
  # @see the `==` method
@@ -123,7 +144,7 @@ module Zernio
123
144
  # Calculates hash code according to all attributes.
124
145
  # @return [Integer] Hash code
125
146
  def hash
126
- [message_id, conversation_id, attachments].hash
147
+ [message_id, conversation_id, attachments, message_ids, partial_failure].hash
127
148
  end
128
149
 
129
150
  # Builds the object from hash