late-sdk 0.0.700 → 0.0.702

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: eb848997fd20b7c6c8c0b434bbbca6c9d76f3c978f178ce1c05f42c75ec75260
4
- data.tar.gz: 1daf1b78ae8d29ce75780d20c5ed5cb7424a3fe000ed9debff7454d32861049f
3
+ metadata.gz: 880a6062d8925570e794bb86831ade06ec8cb72a8f22d861a753495277e1001a
4
+ data.tar.gz: 538c64c6e155289ae76ade8fdee8d65afe01301e98c1073c56566830dedc41c8
5
5
  SHA512:
6
- metadata.gz: 1d5c204fcfab4aac709dd636224fd82dce7a86de9b42e0f1b4696849d6d2c343d5f241e43be313b78219dd7fd31bfeeedb814d8614ccd61bc967d615513fbad4
7
- data.tar.gz: cd1aef01962db5814472d904fdebc71c0da59cd36ddb5f22ef1deef0e82e922eeb044f7a78839c36d13bfdf9e7b5a0f1a832258c354f1aeba439308df2ca03c7
6
+ metadata.gz: df9f1686b071fa3778fc2bbfa6fde1a6559c72584f20da7f41f6233acc85e07b140ff84c29561d151f695b105a60769c59034073f350d8ee29e868df9fc9544a
7
+ data.tar.gz: dda3264a3e9cea0a96585c35677877ffbdf8d5db009df15908a5b0a1966f6e356e38a74e66d891e8c65a779991690d35e51f06ba5ec8dcb361375204742110c4
data/README.md CHANGED
@@ -364,6 +364,7 @@ Class | Method | HTTP request | Description
364
364
  *Zernio::MessagesApi* | [**edit_inbox_message**](docs/MessagesApi.md#edit_inbox_message) | **PATCH** /v1/inbox/conversations/{conversationId}/messages/{messageId} | Edit message
365
365
  *Zernio::MessagesApi* | [**get_inbox_conversation**](docs/MessagesApi.md#get_inbox_conversation) | **GET** /v1/inbox/conversations/{conversationId} | Get conversation
366
366
  *Zernio::MessagesApi* | [**get_inbox_conversation_messages**](docs/MessagesApi.md#get_inbox_conversation_messages) | **GET** /v1/inbox/conversations/{conversationId}/messages | List messages
367
+ *Zernio::MessagesApi* | [**get_message_attachment**](docs/MessagesApi.md#get_message_attachment) | **GET** /v1/inbox/conversations/{conversationId}/messages/{messageId}/attachments/{index} | Resolve message attachment
367
368
  *Zernio::MessagesApi* | [**list_inbox_conversations**](docs/MessagesApi.md#list_inbox_conversations) | **GET** /v1/inbox/conversations | List conversations
368
369
  *Zernio::MessagesApi* | [**mark_conversation_read**](docs/MessagesApi.md#mark_conversation_read) | **POST** /v1/inbox/conversations/{conversationId}/read | Mark a conversation as read
369
370
  *Zernio::MessagesApi* | [**remove_message_reaction**](docs/MessagesApi.md#remove_message_reaction) | **DELETE** /v1/inbox/conversations/{conversationId}/messages/{messageId}/reactions | Remove reaction
@@ -1226,6 +1227,7 @@ Class | Method | HTTP request | Description
1226
1227
  - [Zernio::GetLinkedInSupplyForecastRequestCompetingBid](docs/GetLinkedInSupplyForecastRequestCompetingBid.md)
1227
1228
  - [Zernio::GetMediaPresignedUrl200Response](docs/GetMediaPresignedUrl200Response.md)
1228
1229
  - [Zernio::GetMediaPresignedUrlRequest](docs/GetMediaPresignedUrlRequest.md)
1230
+ - [Zernio::GetMessageAttachment200Response](docs/GetMessageAttachment200Response.md)
1229
1231
  - [Zernio::GetMessengerMenu200Response](docs/GetMessengerMenu200Response.md)
1230
1232
  - [Zernio::GetPendingOAuthData200Response](docs/GetPendingOAuthData200Response.md)
1231
1233
  - [Zernio::GetPendingOAuthData200ResponseOrganizationsInner](docs/GetPendingOAuthData200ResponseOrganizationsInner.md)
@@ -6,7 +6,8 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **id** | **String** | | [optional] |
8
8
  | **type** | **String** | | [optional] |
9
- | **url** | **String** | | [optional] |
9
+ | **url** | **String** | Direct media link. On Instagram and Facebook this is a signed Meta CDN url that EXPIRES: use it now, do not store it. Persist `refreshUrl` instead. | [optional] |
10
+ | **refresh_url** | **String** | Instagram and Facebook only. Endpoint that resolves this attachment to a working url every time, re-minting it from Meta when the stored one has expired. Safe to store and render indefinitely. | [optional] |
10
11
  | **filename** | **String** | | [optional] |
11
12
  | **preview_url** | **String** | | [optional] |
12
13
 
@@ -19,6 +20,7 @@ instance = Zernio::GetInboxConversationMessages200ResponseMessagesInnerAttachmen
19
20
  id: null,
20
21
  type: null,
21
22
  url: null,
23
+ refresh_url: null,
22
24
  filename: null,
23
25
  preview_url: null
24
26
  )
@@ -0,0 +1,22 @@
1
+ # Zernio::GetMessageAttachment200Response
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **status** | **String** | | [optional] |
8
+ | **url** | **String** | Live media url. Short-lived; re-request this endpoint rather than storing it. | [optional] |
9
+ | **refreshed** | **Boolean** | True when the stored url had expired and was re-minted from the platform. | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'zernio-sdk'
15
+
16
+ instance = Zernio::GetMessageAttachment200Response.new(
17
+ status: success,
18
+ url: null,
19
+ refreshed: null
20
+ )
21
+ ```
22
+
data/docs/MessagesApi.md CHANGED
@@ -10,6 +10,7 @@ All URIs are relative to *https://zernio.com/api*
10
10
  | [**edit_inbox_message**](MessagesApi.md#edit_inbox_message) | **PATCH** /v1/inbox/conversations/{conversationId}/messages/{messageId} | Edit message |
11
11
  | [**get_inbox_conversation**](MessagesApi.md#get_inbox_conversation) | **GET** /v1/inbox/conversations/{conversationId} | Get conversation |
12
12
  | [**get_inbox_conversation_messages**](MessagesApi.md#get_inbox_conversation_messages) | **GET** /v1/inbox/conversations/{conversationId}/messages | List messages |
13
+ | [**get_message_attachment**](MessagesApi.md#get_message_attachment) | **GET** /v1/inbox/conversations/{conversationId}/messages/{messageId}/attachments/{index} | Resolve message attachment |
13
14
  | [**list_inbox_conversations**](MessagesApi.md#list_inbox_conversations) | **GET** /v1/inbox/conversations | List conversations |
14
15
  | [**mark_conversation_read**](MessagesApi.md#mark_conversation_read) | **POST** /v1/inbox/conversations/{conversationId}/read | Mark a conversation as read |
15
16
  | [**remove_message_reaction**](MessagesApi.md#remove_message_reaction) | **DELETE** /v1/inbox/conversations/{conversationId}/messages/{messageId}/reactions | Remove reaction |
@@ -458,6 +459,85 @@ end
458
459
  - **Accept**: application/json
459
460
 
460
461
 
462
+ ## get_message_attachment
463
+
464
+ > <GetMessageAttachment200Response> get_message_attachment(conversation_id, message_id, index, account_id, opts)
465
+
466
+ Resolve message attachment
467
+
468
+ Resolve one attachment on a message to a media url that works right now. Instagram and Facebook sign DM media urls per request and expire them, so the `url` on a message is a snapshot: it works when you read the message and stops working later. This endpoint checks the stored url and, when it has gone stale, re-mints the message's media from Meta and persists it before answering. The message id never expires, so this URL is the one to store — it is returned on each attachment as `refreshUrl`. By default it responds `302` to the live media url, so it can be used directly as an `<img src>` on a browser session. API-key integrators should pass `?format=json` and read `url` off the body, since a browser cannot attach an Authorization header to an image request. Only Instagram and Facebook media can be re-minted. On other platforms the stored url is returned as-is when it still resolves, and `404` otherwise.
469
+
470
+ ### Examples
471
+
472
+ ```ruby
473
+ require 'time'
474
+ require 'zernio-sdk'
475
+ # setup authorization
476
+ Zernio.configure do |config|
477
+ # Configure Bearer authorization (JWT): bearerAuth
478
+ config.access_token = 'YOUR_BEARER_TOKEN'
479
+ end
480
+
481
+ api_instance = Zernio::MessagesApi.new
482
+ conversation_id = 'conversation_id_example' # String | The conversation ID (Zernio id or platform conversation id)
483
+ message_id = 'message_id_example' # String | The message id as returned by the list-messages endpoint (the platform message id)
484
+ index = 56 # Integer | Zero-based position of the attachment in the message's attachments array
485
+ account_id = 'account_id_example' # String | Social account ID
486
+ opts = {
487
+ format: 'redirect' # String | `redirect` (default) answers 302 to the media; `json` returns the url in the body
488
+ }
489
+
490
+ begin
491
+ # Resolve message attachment
492
+ result = api_instance.get_message_attachment(conversation_id, message_id, index, account_id, opts)
493
+ p result
494
+ rescue Zernio::ApiError => e
495
+ puts "Error when calling MessagesApi->get_message_attachment: #{e}"
496
+ end
497
+ ```
498
+
499
+ #### Using the get_message_attachment_with_http_info variant
500
+
501
+ This returns an Array which contains the response data, status code and headers.
502
+
503
+ > <Array(<GetMessageAttachment200Response>, Integer, Hash)> get_message_attachment_with_http_info(conversation_id, message_id, index, account_id, opts)
504
+
505
+ ```ruby
506
+ begin
507
+ # Resolve message attachment
508
+ data, status_code, headers = api_instance.get_message_attachment_with_http_info(conversation_id, message_id, index, account_id, opts)
509
+ p status_code # => 2xx
510
+ p headers # => { ... }
511
+ p data # => <GetMessageAttachment200Response>
512
+ rescue Zernio::ApiError => e
513
+ puts "Error when calling MessagesApi->get_message_attachment_with_http_info: #{e}"
514
+ end
515
+ ```
516
+
517
+ ### Parameters
518
+
519
+ | Name | Type | Description | Notes |
520
+ | ---- | ---- | ----------- | ----- |
521
+ | **conversation_id** | **String** | The conversation ID (Zernio id or platform conversation id) | |
522
+ | **message_id** | **String** | The message id as returned by the list-messages endpoint (the platform message id) | |
523
+ | **index** | **Integer** | Zero-based position of the attachment in the message&#39;s attachments array | |
524
+ | **account_id** | **String** | Social account ID | |
525
+ | **format** | **String** | &#x60;redirect&#x60; (default) answers 302 to the media; &#x60;json&#x60; returns the url in the body | [optional][default to &#39;redirect&#39;] |
526
+
527
+ ### Return type
528
+
529
+ [**GetMessageAttachment200Response**](GetMessageAttachment200Response.md)
530
+
531
+ ### Authorization
532
+
533
+ [bearerAuth](../README.md#bearerAuth)
534
+
535
+ ### HTTP request headers
536
+
537
+ - **Content-Type**: Not defined
538
+ - **Accept**: application/json
539
+
540
+
461
541
  ## list_inbox_conversations
462
542
 
463
543
  > <ListInboxConversations200Response> list_inbox_conversations(opts)
data/docs/WorkflowNode.md CHANGED
@@ -6,7 +6,7 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **id** | **String** | Stable node id referenced by edges | |
8
8
  | **type** | **String** | Node kind. The 16 supported types break into four groups: messaging (send_message), control flow (trigger, condition, delay, wait_for_reply, a_b_split, end), data ops (set_variable, set_field, add_tag, remove_tag, enroll_sequence), integrations (webhook, ai, handoff, start_call). | |
9
- | **config** | **Hash&lt;String, Object&gt;** | Type-specific settings. All string fields support &#x60;{{variable}}&#x60; interpolation against the run&#39;s variable bag (resolved at execution time). **trigger**: &#x60;{ triggerType: inbound_message|api_call|whatsapp_event, keywords:[string], matchType: any|contains|exact|regex, onlyFirstMessage:boolean, eventType: message_sent|message_delivered|message_read|message_failed|reaction }&#x60;. Default &#x60;triggerType&#x60; is &#x60;inbound_message&#x60; for legacy nodes. &#x60;eventType&#x60; is only honored when &#x60;triggerType&#x60; is &#x60;whatsapp_event&#x60; (WhatsApp-only). **send_message**: &#x60;{ messageType: text|template|media|interactive, text, template:{name,language,variableMapping}, media:{mediaType:image|video|audio|document, url,caption}, interactive }&#x60;. &#x60;template&#x60; and &#x60;interactive&#x60; are WhatsApp-only. &#x60;interactive.type&#x60; is inferred from the payload shape when omitted; payloads with neither &#x60;type&#x60; nor an inferable shape are rejected. **wait_for_reply**: &#x60;{ timeoutMinutes:int (max 43200), saveAs:string }&#x60;. Resume via the &#x60;&#39;reply&#39;&#x60; edge on inbound, or &#x60;&#39;timeout&#39;&#x60; edge after &#x60;timeoutMinutes&#x60; of silence. **condition**: &#x60;{ rules:[{ id, variable, operator: equals|not_equals|contains|not_contains|starts_with|ends_with|exists|not_exists|matches, value }] }&#x60;. First matching rule takes its &#x60;id&#x60; as the sourceHandle; otherwise &#x60;&#39;default&#39;&#x60;. **set_variable**: &#x60;{ assignments:[{ name, value }] }&#x60;. Run-scoped (lives only for this execution; use &#x60;set_field&#x60; for persistent values). **delay**: &#x60;{ delayMinutes:int (max 43200) }&#x60;. Suspends the run, resumes via timer. **webhook**: &#x60;{ url, method: GET|POST|PUT|PATCH|DELETE, headers, bodyTemplate, saveAs }&#x60;. SSRF-guarded (private/loopback/metadata IPs rejected). Response saved as &#x60;{ status, ok, body }&#x60; to &#x60;vars[saveAs]&#x60;. Edge: &#x60;&#39;success&#39;&#x60; on 2xx, &#x60;&#39;error&#39;&#x60; otherwise. **ai**: &#x60;{ provider: anthropic|openai|google|mistral|groq, model, preset: smart|tools|cheap, systemPrompt, userPromptTemplate, saveAs, temperature, maxTokens, outputType: text|json, tools:[{ name, description, parameters }] }&#x60;. Set &#x60;provider&#x60; + &#x60;model&#x60; for BYOK (uses your stored API key); omit &#x60;provider&#x60; for the legacy Telnyx path. Edges: &#x60;&#39;success&#39;&#x60;, &#x60;&#39;tool:&lt;name&gt;&#39;&#x60; (model picked a tool), &#x60;&#39;error&#39;&#x60;. **handoff**: &#x60;{ note, assignTo }&#x60;. Terminates the run as &#x60;exited&#x60;, flags the conversation for a human operator. **start_call**: &#x60;{ to, forwardTo, requirePermissionFirst, recordingEnabled, saveAs }&#x60;. WhatsApp-only. &#x60;forwardTo&#x60; can be &#x60;tel:+E164&#x60;, &#x60;sip:user@host&#x60;, or &#x60;wss://…&#x60; (AI voice agent). Edges: &#x60;&#39;success&#39;&#x60;, &#x60;&#39;permission_required&#39;&#x60;, &#x60;&#39;failed&#39;&#x60;. **a_b_split**: &#x60;{ percentage: number 0-100 (default 50) }&#x60;. Random branch picker. Edges: &#x60;&#39;a&#39;&#x60; (with probability &#x60;percentage/100&#x60;), &#x60;&#39;b&#39;&#x60;. **set_field**: &#x60;{ field, value }&#x60;. Persistent custom field on the Contact (vs &#x60;set_variable&#x60; which is run-scoped). Field name is sanitized to &#x60;[A-Za-z0-9_]&#x60;. No-op on &#x60;api_call&#x60; runs (no contact). **enroll_sequence**: &#x60;{ sequenceId, saveAs }&#x60;. Enrolls the run&#39;s contact into a Sequence. Edges: &#x60;&#39;success&#39;&#x60;, &#x60;&#39;error&#39;&#x60;. **add_tag** / **remove_tag**: &#x60;{ tag }&#x60;. Push or pull a tag on the Contact. No-op on &#x60;api_call&#x60; runs. **end**: no config. Terminates the run as &#x60;completed&#x60;. | [optional] |
9
+ | **config** | **Hash&lt;String, Object&gt;** | Type-specific settings. All string fields support &#x60;{{variable}}&#x60; interpolation against the run&#39;s variable bag (resolved at execution time). **trigger**: &#x60;{ triggerType: inbound_message|api_call|whatsapp_event, keywords:[string], matchType: any|contains|exact|regex, onlyFirstMessage:boolean, eventType: message_sent|message_delivered|message_read|message_failed|reaction }&#x60;. Default &#x60;triggerType&#x60; is &#x60;inbound_message&#x60; for legacy nodes. &#x60;eventType&#x60; is only honored when &#x60;triggerType&#x60; is &#x60;whatsapp_event&#x60; (WhatsApp-only). **send_message**: &#x60;{ messageType: text|template|media|interactive, text, template:{name,language,variableMapping}, media:{mediaType:image|video|audio|document, url,caption}, interactive }&#x60;. &#x60;template&#x60; and &#x60;interactive&#x60; are WhatsApp-only. &#x60;interactive.type&#x60; is inferred from the payload shape when omitted; payloads with neither &#x60;type&#x60; nor an inferable shape are rejected. **wait_for_reply**: &#x60;{ timeoutMinutes:int (max 43200), saveAs:string }&#x60;. Resume via the &#x60;&#39;reply&#39;&#x60; edge on inbound, or &#x60;&#39;timeout&#39;&#x60; edge after &#x60;timeoutMinutes&#x60; of silence. **condition**: &#x60;{ rules:[{ id, variable, operator: equals|not_equals|contains|not_contains|starts_with|ends_with|exists|not_exists|matches, value }] }&#x60;. First matching rule takes its &#x60;id&#x60; as the sourceHandle; otherwise &#x60;&#39;default&#39;&#x60;. **set_variable**: &#x60;{ assignments:[{ name, value }] }&#x60;. Run-scoped (lives only for this execution; use &#x60;set_field&#x60; for persistent values). **delay**: &#x60;{ delayMinutes:int (max 43200) }&#x60;. Suspends the run, resumes via timer. **webhook**: &#x60;{ url, method: GET|POST|PUT|PATCH|DELETE, headers, bodyTemplate, saveAs }&#x60;. SSRF-guarded (private/loopback/metadata IPs rejected). Response saved as &#x60;{ status, ok, body }&#x60; to &#x60;vars[saveAs]&#x60;. Edge: &#x60;&#39;success&#39;&#x60; on 2xx, &#x60;&#39;error&#39;&#x60; otherwise. **ai**: &#x60;{ provider: anthropic|openai|google|mistral|groq|openrouter, model, preset: smart|tools|cheap, systemPrompt, userPromptTemplate, saveAs, temperature, maxTokens, outputType: text|json, tools:[{ name, description, parameters }] }&#x60;. Set &#x60;provider&#x60; + &#x60;model&#x60; for BYOK (uses your stored API key); omit &#x60;provider&#x60; for the legacy Telnyx path. Edges: &#x60;&#39;success&#39;&#x60;, &#x60;&#39;tool:&lt;name&gt;&#39;&#x60; (model picked a tool), &#x60;&#39;error&#39;&#x60;. **handoff**: &#x60;{ note, assignTo }&#x60;. Terminates the run as &#x60;exited&#x60;, flags the conversation for a human operator. **start_call**: &#x60;{ to, forwardTo, requirePermissionFirst, recordingEnabled, saveAs }&#x60;. WhatsApp-only. &#x60;forwardTo&#x60; can be &#x60;tel:+E164&#x60;, &#x60;sip:user@host&#x60;, or &#x60;wss://…&#x60; (AI voice agent). Edges: &#x60;&#39;success&#39;&#x60;, &#x60;&#39;permission_required&#39;&#x60;, &#x60;&#39;failed&#39;&#x60;. **a_b_split**: &#x60;{ percentage: number 0-100 (default 50) }&#x60;. Random branch picker. Edges: &#x60;&#39;a&#39;&#x60; (with probability &#x60;percentage/100&#x60;), &#x60;&#39;b&#39;&#x60;. **set_field**: &#x60;{ field, value }&#x60;. Persistent custom field on the Contact (vs &#x60;set_variable&#x60; which is run-scoped). Field name is sanitized to &#x60;[A-Za-z0-9_]&#x60;. No-op on &#x60;api_call&#x60; runs (no contact). **enroll_sequence**: &#x60;{ sequenceId, saveAs }&#x60;. Enrolls the run&#39;s contact into a Sequence. Edges: &#x60;&#39;success&#39;&#x60;, &#x60;&#39;error&#39;&#x60;. **add_tag** / **remove_tag**: &#x60;{ tag }&#x60;. Push or pull a tag on the Contact. No-op on &#x60;api_call&#x60; runs. **end**: no config. Terminates the run as &#x60;completed&#x60;. | [optional] |
10
10
  | **position** | [**WorkflowNodePosition**](WorkflowNodePosition.md) | | [optional] |
11
11
 
12
12
  ## Example
@@ -484,6 +484,99 @@ module Zernio
484
484
  return data, status_code, headers
485
485
  end
486
486
 
487
+ # Resolve message attachment
488
+ # Resolve one attachment on a message to a media url that works right now. Instagram and Facebook sign DM media urls per request and expire them, so the `url` on a message is a snapshot: it works when you read the message and stops working later. This endpoint checks the stored url and, when it has gone stale, re-mints the message's media from Meta and persists it before answering. The message id never expires, so this URL is the one to store — it is returned on each attachment as `refreshUrl`. By default it responds `302` to the live media url, so it can be used directly as an `<img src>` on a browser session. API-key integrators should pass `?format=json` and read `url` off the body, since a browser cannot attach an Authorization header to an image request. Only Instagram and Facebook media can be re-minted. On other platforms the stored url is returned as-is when it still resolves, and `404` otherwise.
489
+ # @param conversation_id [String] The conversation ID (Zernio id or platform conversation id)
490
+ # @param message_id [String] The message id as returned by the list-messages endpoint (the platform message id)
491
+ # @param index [Integer] Zero-based position of the attachment in the message&#39;s attachments array
492
+ # @param account_id [String] Social account ID
493
+ # @param [Hash] opts the optional parameters
494
+ # @option opts [String] :format &#x60;redirect&#x60; (default) answers 302 to the media; &#x60;json&#x60; returns the url in the body (default to 'redirect')
495
+ # @return [GetMessageAttachment200Response]
496
+ def get_message_attachment(conversation_id, message_id, index, account_id, opts = {})
497
+ data, _status_code, _headers = get_message_attachment_with_http_info(conversation_id, message_id, index, account_id, opts)
498
+ data
499
+ end
500
+
501
+ # Resolve message attachment
502
+ # Resolve one attachment on a message to a media url that works right now. Instagram and Facebook sign DM media urls per request and expire them, so the &#x60;url&#x60; on a message is a snapshot: it works when you read the message and stops working later. This endpoint checks the stored url and, when it has gone stale, re-mints the message&#39;s media from Meta and persists it before answering. The message id never expires, so this URL is the one to store — it is returned on each attachment as &#x60;refreshUrl&#x60;. By default it responds &#x60;302&#x60; to the live media url, so it can be used directly as an &#x60;&lt;img src&gt;&#x60; on a browser session. API-key integrators should pass &#x60;?format&#x3D;json&#x60; and read &#x60;url&#x60; off the body, since a browser cannot attach an Authorization header to an image request. Only Instagram and Facebook media can be re-minted. On other platforms the stored url is returned as-is when it still resolves, and &#x60;404&#x60; otherwise.
503
+ # @param conversation_id [String] The conversation ID (Zernio id or platform conversation id)
504
+ # @param message_id [String] The message id as returned by the list-messages endpoint (the platform message id)
505
+ # @param index [Integer] Zero-based position of the attachment in the message&#39;s attachments array
506
+ # @param account_id [String] Social account ID
507
+ # @param [Hash] opts the optional parameters
508
+ # @option opts [String] :format &#x60;redirect&#x60; (default) answers 302 to the media; &#x60;json&#x60; returns the url in the body (default to 'redirect')
509
+ # @return [Array<(GetMessageAttachment200Response, Integer, Hash)>] GetMessageAttachment200Response data, response status code and response headers
510
+ def get_message_attachment_with_http_info(conversation_id, message_id, index, account_id, opts = {})
511
+ if @api_client.config.debugging
512
+ @api_client.config.logger.debug 'Calling API: MessagesApi.get_message_attachment ...'
513
+ end
514
+ # verify the required parameter 'conversation_id' is set
515
+ if @api_client.config.client_side_validation && conversation_id.nil?
516
+ fail ArgumentError, "Missing the required parameter 'conversation_id' when calling MessagesApi.get_message_attachment"
517
+ end
518
+ # verify the required parameter 'message_id' is set
519
+ if @api_client.config.client_side_validation && message_id.nil?
520
+ fail ArgumentError, "Missing the required parameter 'message_id' when calling MessagesApi.get_message_attachment"
521
+ end
522
+ # verify the required parameter 'index' is set
523
+ if @api_client.config.client_side_validation && index.nil?
524
+ fail ArgumentError, "Missing the required parameter 'index' when calling MessagesApi.get_message_attachment"
525
+ end
526
+ if @api_client.config.client_side_validation && index < 0
527
+ fail ArgumentError, 'invalid value for "index" when calling MessagesApi.get_message_attachment, must be greater than or equal to 0.'
528
+ end
529
+
530
+ # verify the required parameter 'account_id' is set
531
+ if @api_client.config.client_side_validation && account_id.nil?
532
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling MessagesApi.get_message_attachment"
533
+ end
534
+ allowable_values = ["redirect", "json"]
535
+ if @api_client.config.client_side_validation && opts[:'format'] && !allowable_values.include?(opts[:'format'])
536
+ fail ArgumentError, "invalid value for \"format\", must be one of #{allowable_values}"
537
+ end
538
+ # resource path
539
+ local_var_path = '/v1/inbox/conversations/{conversationId}/messages/{messageId}/attachments/{index}'.sub('{' + 'conversationId' + '}', CGI.escape(conversation_id.to_s)).sub('{' + 'messageId' + '}', CGI.escape(message_id.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s))
540
+
541
+ # query parameters
542
+ query_params = opts[:query_params] || {}
543
+ query_params[:'accountId'] = account_id
544
+ query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil?
545
+
546
+ # header parameters
547
+ header_params = opts[:header_params] || {}
548
+ # HTTP header 'Accept' (if needed)
549
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
550
+
551
+ # form parameters
552
+ form_params = opts[:form_params] || {}
553
+
554
+ # http body (model)
555
+ post_body = opts[:debug_body]
556
+
557
+ # return_type
558
+ return_type = opts[:debug_return_type] || 'GetMessageAttachment200Response'
559
+
560
+ # auth_names
561
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
562
+
563
+ new_options = opts.merge(
564
+ :operation => :"MessagesApi.get_message_attachment",
565
+ :header_params => header_params,
566
+ :query_params => query_params,
567
+ :form_params => form_params,
568
+ :body => post_body,
569
+ :auth_names => auth_names,
570
+ :return_type => return_type
571
+ )
572
+
573
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
574
+ if @api_client.config.debugging
575
+ @api_client.config.logger.debug "API called: MessagesApi#get_message_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
576
+ end
577
+ return data, status_code, headers
578
+ end
579
+
487
580
  # List conversations
488
581
  # Fetch conversations (DMs) from all connected messaging accounts in a single API call. Supports filtering by profile and platform. Results are aggregated and deduplicated. Supported platforms: Facebook, Instagram, Twitter/X, Bluesky, Reddit, Telegram. Twitter/X limitation: X has replaced traditional DMs with encrypted \"X Chat\" for many accounts. Messages sent or received through encrypted X Chat are not accessible via X's API (the /2/dm_events endpoint only returns legacy unencrypted DMs). This means some Twitter/X conversations may show only outgoing messages or appear empty. This is an X platform limitation that affects all third-party applications. See X's docs on encrypted messaging for more details. Instagram and Facebook pre-connect history: when one of these accounts is connected, Zernio replays the DM history the account already holds on Meta, so conversations that began before the account was connected appear here. Up to 500 conversations per account are replayed. The replay runs in the background and can finish after a listing you have already taken, and replayed conversations keep their original lastMessageAt, so they sort into date order rather than appearing at the top. If you mirror this endpoint into your own store, re-run the sweep rather than relying on a single pass at connect time. Replayed history emits no webhooks and is stored as already read, so it never affects unread counts. Threads that Meta refuses to serve are skipped, and an account whose Instagram \"connected tools\" message access is turned off is not replayed at all.
489
582
  # @param [Hash] opts the optional parameters
@@ -19,8 +19,12 @@ module Zernio
19
19
 
20
20
  attr_accessor :type
21
21
 
22
+ # Direct media link. On Instagram and Facebook this is a signed Meta CDN url that EXPIRES: use it now, do not store it. Persist `refreshUrl` instead.
22
23
  attr_accessor :url
23
24
 
25
+ # Instagram and Facebook only. Endpoint that resolves this attachment to a working url every time, re-minting it from Meta when the stored one has expired. Safe to store and render indefinitely.
26
+ attr_accessor :refresh_url
27
+
24
28
  attr_accessor :filename
25
29
 
26
30
  attr_accessor :preview_url
@@ -53,6 +57,7 @@ module Zernio
53
57
  :'id' => :'id',
54
58
  :'type' => :'type',
55
59
  :'url' => :'url',
60
+ :'refresh_url' => :'refreshUrl',
56
61
  :'filename' => :'filename',
57
62
  :'preview_url' => :'previewUrl'
58
63
  }
@@ -74,6 +79,7 @@ module Zernio
74
79
  :'id' => :'String',
75
80
  :'type' => :'String',
76
81
  :'url' => :'String',
82
+ :'refresh_url' => :'String',
77
83
  :'filename' => :'String',
78
84
  :'preview_url' => :'String'
79
85
  }
@@ -82,6 +88,7 @@ module Zernio
82
88
  # List of attributes with nullable: true
83
89
  def self.openapi_nullable
84
90
  Set.new([
91
+ :'refresh_url',
85
92
  :'filename',
86
93
  :'preview_url'
87
94
  ])
@@ -115,6 +122,10 @@ module Zernio
115
122
  self.url = attributes[:'url']
116
123
  end
117
124
 
125
+ if attributes.key?(:'refresh_url')
126
+ self.refresh_url = attributes[:'refresh_url']
127
+ end
128
+
118
129
  if attributes.key?(:'filename')
119
130
  self.filename = attributes[:'filename']
120
131
  end
@@ -159,6 +170,7 @@ module Zernio
159
170
  id == o.id &&
160
171
  type == o.type &&
161
172
  url == o.url &&
173
+ refresh_url == o.refresh_url &&
162
174
  filename == o.filename &&
163
175
  preview_url == o.preview_url
164
176
  end
@@ -172,7 +184,7 @@ module Zernio
172
184
  # Calculates hash code according to all attributes.
173
185
  # @return [Integer] Hash code
174
186
  def hash
175
- [id, type, url, filename, preview_url].hash
187
+ [id, type, url, refresh_url, filename, preview_url].hash
176
188
  end
177
189
 
178
190
  # Builds the object from hash
@@ -0,0 +1,167 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
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
+ class GetMessageAttachment200Response < ApiModelBase
18
+ attr_accessor :status
19
+
20
+ # Live media url. Short-lived; re-request this endpoint rather than storing it.
21
+ attr_accessor :url
22
+
23
+ # True when the stored url had expired and was re-minted from the platform.
24
+ attr_accessor :refreshed
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'status' => :'status',
30
+ :'url' => :'url',
31
+ :'refreshed' => :'refreshed'
32
+ }
33
+ end
34
+
35
+ # Returns attribute mapping this model knows about
36
+ def self.acceptable_attribute_map
37
+ attribute_map
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ acceptable_attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'status' => :'String',
49
+ :'url' => :'String',
50
+ :'refreshed' => :'Boolean'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetMessageAttachment200Response` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ acceptable_attribute_map = self.class.acceptable_attribute_map
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!acceptable_attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetMessageAttachment200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'status')
77
+ self.status = attributes[:'status']
78
+ end
79
+
80
+ if attributes.key?(:'url')
81
+ self.url = attributes[:'url']
82
+ end
83
+
84
+ if attributes.key?(:'refreshed')
85
+ self.refreshed = attributes[:'refreshed']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
93
+ invalid_properties = Array.new
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ warn '[DEPRECATED] the `valid?` method is obsolete'
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ status == o.status &&
110
+ url == o.url &&
111
+ refreshed == o.refreshed
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [status, url, refreshed].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ attributes = attributes.transform_keys(&:to_sym)
132
+ transformed_hash = {}
133
+ openapi_types.each_pair do |key, type|
134
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = nil
136
+ elsif type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[attribute_map[key]].is_a?(Array)
140
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
141
+ end
142
+ elsif !attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
144
+ end
145
+ end
146
+ new(transformed_hash)
147
+ end
148
+
149
+ # Returns the object in the form of hash
150
+ # @return [Hash] Returns the object in the form of hash
151
+ def to_hash
152
+ hash = {}
153
+ self.class.attribute_map.each_pair do |attr, param|
154
+ value = self.send(attr)
155
+ if value.nil?
156
+ is_nullable = self.class.openapi_nullable.include?(attr)
157
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
158
+ end
159
+
160
+ hash[param] = _to_hash(value)
161
+ end
162
+ hash
163
+ end
164
+
165
+ end
166
+
167
+ end
@@ -22,7 +22,7 @@ module Zernio
22
22
  # Node kind. The 16 supported types break into four groups: messaging (send_message), control flow (trigger, condition, delay, wait_for_reply, a_b_split, end), data ops (set_variable, set_field, add_tag, remove_tag, enroll_sequence), integrations (webhook, ai, handoff, start_call).
23
23
  attr_accessor :type
24
24
 
25
- # Type-specific settings. All string fields support `{{variable}}` interpolation against the run's variable bag (resolved at execution time). **trigger**: `{ triggerType: inbound_message|api_call|whatsapp_event, keywords:[string], matchType: any|contains|exact|regex, onlyFirstMessage:boolean, eventType: message_sent|message_delivered|message_read|message_failed|reaction }`. Default `triggerType` is `inbound_message` for legacy nodes. `eventType` is only honored when `triggerType` is `whatsapp_event` (WhatsApp-only). **send_message**: `{ messageType: text|template|media|interactive, text, template:{name,language,variableMapping}, media:{mediaType:image|video|audio|document, url,caption}, interactive }`. `template` and `interactive` are WhatsApp-only. `interactive.type` is inferred from the payload shape when omitted; payloads with neither `type` nor an inferable shape are rejected. **wait_for_reply**: `{ timeoutMinutes:int (max 43200), saveAs:string }`. Resume via the `'reply'` edge on inbound, or `'timeout'` edge after `timeoutMinutes` of silence. **condition**: `{ rules:[{ id, variable, operator: equals|not_equals|contains|not_contains|starts_with|ends_with|exists|not_exists|matches, value }] }`. First matching rule takes its `id` as the sourceHandle; otherwise `'default'`. **set_variable**: `{ assignments:[{ name, value }] }`. Run-scoped (lives only for this execution; use `set_field` for persistent values). **delay**: `{ delayMinutes:int (max 43200) }`. Suspends the run, resumes via timer. **webhook**: `{ url, method: GET|POST|PUT|PATCH|DELETE, headers, bodyTemplate, saveAs }`. SSRF-guarded (private/loopback/metadata IPs rejected). Response saved as `{ status, ok, body }` to `vars[saveAs]`. Edge: `'success'` on 2xx, `'error'` otherwise. **ai**: `{ provider: anthropic|openai|google|mistral|groq, model, preset: smart|tools|cheap, systemPrompt, userPromptTemplate, saveAs, temperature, maxTokens, outputType: text|json, tools:[{ name, description, parameters }] }`. Set `provider` + `model` for BYOK (uses your stored API key); omit `provider` for the legacy Telnyx path. Edges: `'success'`, `'tool:<name>'` (model picked a tool), `'error'`. **handoff**: `{ note, assignTo }`. Terminates the run as `exited`, flags the conversation for a human operator. **start_call**: `{ to, forwardTo, requirePermissionFirst, recordingEnabled, saveAs }`. WhatsApp-only. `forwardTo` can be `tel:+E164`, `sip:user@host`, or `wss://…` (AI voice agent). Edges: `'success'`, `'permission_required'`, `'failed'`. **a_b_split**: `{ percentage: number 0-100 (default 50) }`. Random branch picker. Edges: `'a'` (with probability `percentage/100`), `'b'`. **set_field**: `{ field, value }`. Persistent custom field on the Contact (vs `set_variable` which is run-scoped). Field name is sanitized to `[A-Za-z0-9_]`. No-op on `api_call` runs (no contact). **enroll_sequence**: `{ sequenceId, saveAs }`. Enrolls the run's contact into a Sequence. Edges: `'success'`, `'error'`. **add_tag** / **remove_tag**: `{ tag }`. Push or pull a tag on the Contact. No-op on `api_call` runs. **end**: no config. Terminates the run as `completed`.
25
+ # Type-specific settings. All string fields support `{{variable}}` interpolation against the run's variable bag (resolved at execution time). **trigger**: `{ triggerType: inbound_message|api_call|whatsapp_event, keywords:[string], matchType: any|contains|exact|regex, onlyFirstMessage:boolean, eventType: message_sent|message_delivered|message_read|message_failed|reaction }`. Default `triggerType` is `inbound_message` for legacy nodes. `eventType` is only honored when `triggerType` is `whatsapp_event` (WhatsApp-only). **send_message**: `{ messageType: text|template|media|interactive, text, template:{name,language,variableMapping}, media:{mediaType:image|video|audio|document, url,caption}, interactive }`. `template` and `interactive` are WhatsApp-only. `interactive.type` is inferred from the payload shape when omitted; payloads with neither `type` nor an inferable shape are rejected. **wait_for_reply**: `{ timeoutMinutes:int (max 43200), saveAs:string }`. Resume via the `'reply'` edge on inbound, or `'timeout'` edge after `timeoutMinutes` of silence. **condition**: `{ rules:[{ id, variable, operator: equals|not_equals|contains|not_contains|starts_with|ends_with|exists|not_exists|matches, value }] }`. First matching rule takes its `id` as the sourceHandle; otherwise `'default'`. **set_variable**: `{ assignments:[{ name, value }] }`. Run-scoped (lives only for this execution; use `set_field` for persistent values). **delay**: `{ delayMinutes:int (max 43200) }`. Suspends the run, resumes via timer. **webhook**: `{ url, method: GET|POST|PUT|PATCH|DELETE, headers, bodyTemplate, saveAs }`. SSRF-guarded (private/loopback/metadata IPs rejected). Response saved as `{ status, ok, body }` to `vars[saveAs]`. Edge: `'success'` on 2xx, `'error'` otherwise. **ai**: `{ provider: anthropic|openai|google|mistral|groq|openrouter, model, preset: smart|tools|cheap, systemPrompt, userPromptTemplate, saveAs, temperature, maxTokens, outputType: text|json, tools:[{ name, description, parameters }] }`. Set `provider` + `model` for BYOK (uses your stored API key); omit `provider` for the legacy Telnyx path. Edges: `'success'`, `'tool:<name>'` (model picked a tool), `'error'`. **handoff**: `{ note, assignTo }`. Terminates the run as `exited`, flags the conversation for a human operator. **start_call**: `{ to, forwardTo, requirePermissionFirst, recordingEnabled, saveAs }`. WhatsApp-only. `forwardTo` can be `tel:+E164`, `sip:user@host`, or `wss://…` (AI voice agent). Edges: `'success'`, `'permission_required'`, `'failed'`. **a_b_split**: `{ percentage: number 0-100 (default 50) }`. Random branch picker. Edges: `'a'` (with probability `percentage/100`), `'b'`. **set_field**: `{ field, value }`. Persistent custom field on the Contact (vs `set_variable` which is run-scoped). Field name is sanitized to `[A-Za-z0-9_]`. No-op on `api_call` runs (no contact). **enroll_sequence**: `{ sequenceId, saveAs }`. Enrolls the run's contact into a Sequence. Edges: `'success'`, `'error'`. **add_tag** / **remove_tag**: `{ tag }`. Push or pull a tag on the Contact. No-op on `api_call` runs. **end**: no config. Terminates the run as `completed`.
26
26
  attr_accessor :config
27
27
 
28
28
  attr_accessor :position
@@ -11,5 +11,5 @@ Generator version: 7.19.0
11
11
  =end
12
12
 
13
13
  module Zernio
14
- VERSION = '0.0.700'
14
+ VERSION = '0.0.702'
15
15
  end
data/lib/zernio-sdk.rb CHANGED
@@ -629,6 +629,7 @@ require 'zernio-sdk/models/get_linked_in_supply_forecast_request'
629
629
  require 'zernio-sdk/models/get_linked_in_supply_forecast_request_competing_bid'
630
630
  require 'zernio-sdk/models/get_media_presigned_url200_response'
631
631
  require 'zernio-sdk/models/get_media_presigned_url_request'
632
+ require 'zernio-sdk/models/get_message_attachment200_response'
632
633
  require 'zernio-sdk/models/get_messenger_menu200_response'
633
634
  require 'zernio-sdk/models/get_pending_o_auth_data200_response'
634
635
  require 'zernio-sdk/models/get_pending_o_auth_data200_response_organizations_inner'
data/openapi.yaml CHANGED
@@ -1153,7 +1153,7 @@ components:
1153
1153
  `{ status, ok, body }` to `vars[saveAs]`. Edge: `'success'` on 2xx, `'error'` otherwise.
1154
1154
 
1155
1155
 
1156
- **ai**: `{ provider: anthropic|openai|google|mistral|groq, model, preset:
1156
+ **ai**: `{ provider: anthropic|openai|google|mistral|groq|openrouter, model, preset:
1157
1157
  smart|tools|cheap, systemPrompt, userPromptTemplate, saveAs, temperature, maxTokens,
1158
1158
  outputType: text|json, tools:[{ name, description, parameters }] }`. Set `provider` +
1159
1159
  `model` for BYOK (uses your stored API key); omit `provider` for the legacy Telnyx
@@ -24390,7 +24390,12 @@ paths:
24390
24390
  properties:
24391
24391
  id: { type: string }
24392
24392
  type: { type: string, enum: [image, video, audio, file, sticker, share] }
24393
- url: { type: string }
24393
+ url:
24394
+ type: string
24395
+ description: 'Direct media link. On Instagram and Facebook this is a signed Meta CDN url that EXPIRES: use it now, do not store it. Persist `refreshUrl` instead.'
24396
+ refreshUrl:
24397
+ type: [string, "null"]
24398
+ description: 'Instagram and Facebook only. Endpoint that resolves this attachment to a working url every time, re-minting it from Meta when the stored one has expired. Safe to store and render indefinitely.'
24394
24399
  filename: { type: [string, "null"] }
24395
24400
  previewUrl: { type: [string, "null"] }
24396
24401
  subject: { type: [string, "null"], description: Reddit message subject }
@@ -25660,6 +25665,77 @@ paths:
25660
25665
  '400': { $ref: '#/components/responses/BadRequest' }
25661
25666
  '401': { $ref: '#/components/responses/Unauthorized' }
25662
25667
 
25668
+ /v1/inbox/conversations/{conversationId}/messages/{messageId}/attachments/{index}:
25669
+ get:
25670
+ x-resource-group: "messages"
25671
+ operationId: getMessageAttachment
25672
+ summary: Resolve message attachment
25673
+ description: |
25674
+ Resolve one attachment on a message to a media url that works right now.
25675
+
25676
+ Instagram and Facebook sign DM media urls per request and expire them, so
25677
+ the `url` on a message is a snapshot: it works when you read the message
25678
+ and stops working later. This endpoint checks the stored url and, when it
25679
+ has gone stale, re-mints the message's media from Meta and persists it
25680
+ before answering. The message id never expires, so this URL is the one to
25681
+ store — it is returned on each attachment as `refreshUrl`.
25682
+
25683
+ By default it responds `302` to the live media url, so it can be used
25684
+ directly as an `<img src>` on a browser session. API-key integrators
25685
+ should pass `?format=json` and read `url` off the body, since a browser
25686
+ cannot attach an Authorization header to an image request.
25687
+
25688
+ Only Instagram and Facebook media can be re-minted. On other platforms
25689
+ the stored url is returned as-is when it still resolves, and `404`
25690
+ otherwise.
25691
+ tags: [Messages]
25692
+ security: [{ bearerAuth: [] }]
25693
+ parameters:
25694
+ - name: conversationId
25695
+ in: path
25696
+ required: true
25697
+ schema: { type: string }
25698
+ description: 'The conversation ID (Zernio id or platform conversation id)'
25699
+ - name: messageId
25700
+ in: path
25701
+ required: true
25702
+ schema: { type: string }
25703
+ description: 'The message id as returned by the list-messages endpoint (the platform message id)'
25704
+ - name: index
25705
+ in: path
25706
+ required: true
25707
+ schema: { type: integer, minimum: 0 }
25708
+ description: 'Zero-based position of the attachment in the message''s attachments array'
25709
+ - name: accountId
25710
+ in: query
25711
+ required: true
25712
+ schema: { type: string }
25713
+ description: Social account ID
25714
+ - name: format
25715
+ in: query
25716
+ required: false
25717
+ schema: { type: string, enum: [redirect, json], default: redirect }
25718
+ description: '`redirect` (default) answers 302 to the media; `json` returns the url in the body'
25719
+ responses:
25720
+ '200':
25721
+ description: 'Resolved url (only when format=json)'
25722
+ content:
25723
+ application/json:
25724
+ schema:
25725
+ type: object
25726
+ properties:
25727
+ status: { type: string, example: success }
25728
+ url: { type: string, description: 'Live media url. Short-lived; re-request this endpoint rather than storing it.' }
25729
+ refreshed: { type: boolean, description: True when the stored url had expired and was re-minted from the platform. }
25730
+ '302':
25731
+ description: Redirect to the live media url
25732
+ '400': { $ref: '#/components/responses/BadRequest' }
25733
+ '401': { $ref: '#/components/responses/Unauthorized' }
25734
+ '403':
25735
+ description: Inbox addon required
25736
+ '404':
25737
+ description: 'Account, conversation, message or attachment not found, or the platform no longer serves the media'
25738
+
25663
25739
  /v1/inbox/comments:
25664
25740
  get:
25665
25741
  x-resource-group: "engagement"
@@ -115,6 +115,22 @@ describe 'MessagesApi' do
115
115
  end
116
116
  end
117
117
 
118
+ # unit tests for get_message_attachment
119
+ # Resolve message attachment
120
+ # Resolve one attachment on a message to a media url that works right now. Instagram and Facebook sign DM media urls per request and expire them, so the &#x60;url&#x60; on a message is a snapshot: it works when you read the message and stops working later. This endpoint checks the stored url and, when it has gone stale, re-mints the message&#39;s media from Meta and persists it before answering. The message id never expires, so this URL is the one to store — it is returned on each attachment as &#x60;refreshUrl&#x60;. By default it responds &#x60;302&#x60; to the live media url, so it can be used directly as an &#x60;&lt;img src&gt;&#x60; on a browser session. API-key integrators should pass &#x60;?format&#x3D;json&#x60; and read &#x60;url&#x60; off the body, since a browser cannot attach an Authorization header to an image request. Only Instagram and Facebook media can be re-minted. On other platforms the stored url is returned as-is when it still resolves, and &#x60;404&#x60; otherwise.
121
+ # @param conversation_id The conversation ID (Zernio id or platform conversation id)
122
+ # @param message_id The message id as returned by the list-messages endpoint (the platform message id)
123
+ # @param index Zero-based position of the attachment in the message&#39;s attachments array
124
+ # @param account_id Social account ID
125
+ # @param [Hash] opts the optional parameters
126
+ # @option opts [String] :format &#x60;redirect&#x60; (default) answers 302 to the media; &#x60;json&#x60; returns the url in the body
127
+ # @return [GetMessageAttachment200Response]
128
+ describe 'get_message_attachment test' do
129
+ it 'should work' do
130
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
131
+ end
132
+ end
133
+
118
134
  # unit tests for list_inbox_conversations
119
135
  # List conversations
120
136
  # Fetch conversations (DMs) from all connected messaging accounts in a single API call. Supports filtering by profile and platform. Results are aggregated and deduplicated. Supported platforms: Facebook, Instagram, Twitter/X, Bluesky, Reddit, Telegram. Twitter/X limitation: X has replaced traditional DMs with encrypted \&quot;X Chat\&quot; for many accounts. Messages sent or received through encrypted X Chat are not accessible via X&#39;s API (the /2/dm_events endpoint only returns legacy unencrypted DMs). This means some Twitter/X conversations may show only outgoing messages or appear empty. This is an X platform limitation that affects all third-party applications. See X&#39;s docs on encrypted messaging for more details. Instagram and Facebook pre-connect history: when one of these accounts is connected, Zernio replays the DM history the account already holds on Meta, so conversations that began before the account was connected appear here. Up to 500 conversations per account are replayed. The replay runs in the background and can finish after a listing you have already taken, and replayed conversations keep their original lastMessageAt, so they sort into date order rather than appearing at the top. If you mirror this endpoint into your own store, re-run the sweep rather than relying on a single pass at connect time. Replayed history emits no webhooks and is stored as already read, so it never affects unread counts. Threads that Meta refuses to serve are skipped, and an account whose Instagram \&quot;connected tools\&quot; message access is turned off is not replayed at all.
@@ -49,6 +49,12 @@ describe Zernio::GetInboxConversationMessages200ResponseMessagesInnerAttachments
49
49
  end
50
50
  end
51
51
 
52
+ describe 'test attribute "refresh_url"' do
53
+ it 'should work' do
54
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
55
+ end
56
+ end
57
+
52
58
  describe 'test attribute "filename"' do
53
59
  it 'should work' do
54
60
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -0,0 +1,48 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Zernio::GetMessageAttachment200Response
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe Zernio::GetMessageAttachment200Response do
21
+ #let(:instance) { Zernio::GetMessageAttachment200Response.new }
22
+
23
+ describe 'test an instance of GetMessageAttachment200Response' do
24
+ it 'should create an instance of GetMessageAttachment200Response' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(Zernio::GetMessageAttachment200Response)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "status"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ describe 'test attribute "url"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ end
40
+ end
41
+
42
+ describe 'test attribute "refreshed"' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ end
46
+ end
47
+
48
+ end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: late-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.700
4
+ version: 0.0.702
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator
@@ -703,6 +703,7 @@ files:
703
703
  - docs/GetLinkedInSupplyForecastRequestCompetingBid.md
704
704
  - docs/GetMediaPresignedUrl200Response.md
705
705
  - docs/GetMediaPresignedUrlRequest.md
706
+ - docs/GetMessageAttachment200Response.md
706
707
  - docs/GetMessengerMenu200Response.md
707
708
  - docs/GetPendingOAuthData200Response.md
708
709
  - docs/GetPendingOAuthData200ResponseOrganizationsInner.md
@@ -2403,6 +2404,7 @@ files:
2403
2404
  - lib/zernio-sdk/models/get_linked_in_supply_forecast_request_competing_bid.rb
2404
2405
  - lib/zernio-sdk/models/get_media_presigned_url200_response.rb
2405
2406
  - lib/zernio-sdk/models/get_media_presigned_url_request.rb
2407
+ - lib/zernio-sdk/models/get_message_attachment200_response.rb
2406
2408
  - lib/zernio-sdk/models/get_messenger_menu200_response.rb
2407
2409
  - lib/zernio-sdk/models/get_pending_o_auth_data200_response.rb
2408
2410
  - lib/zernio-sdk/models/get_pending_o_auth_data200_response_organizations_inner.rb
@@ -4061,6 +4063,7 @@ files:
4061
4063
  - spec/models/get_linked_in_supply_forecast_request_spec.rb
4062
4064
  - spec/models/get_media_presigned_url200_response_spec.rb
4063
4065
  - spec/models/get_media_presigned_url_request_spec.rb
4066
+ - spec/models/get_message_attachment200_response_spec.rb
4064
4067
  - spec/models/get_messenger_menu200_response_spec.rb
4065
4068
  - spec/models/get_pending_o_auth_data200_response_organizations_inner_spec.rb
4066
4069
  - spec/models/get_pending_o_auth_data200_response_spec.rb
@@ -5042,7 +5045,7 @@ files:
5042
5045
  - spec/models/you_tube_video_retention_response_retention_curve_inner_spec.rb
5043
5046
  - spec/models/you_tube_video_retention_response_spec.rb
5044
5047
  - spec/spec_helper.rb
5045
- - zernio-sdk-0.0.700.gem
5048
+ - zernio-sdk-0.0.702.gem
5046
5049
  - zernio-sdk.gemspec
5047
5050
  homepage: https://openapi-generator.tech
5048
5051
  licenses:
@@ -6109,6 +6112,7 @@ test_files:
6109
6112
  - spec/models/webhook_payload_message_spec.rb
6110
6113
  - spec/models/get_inbox_conversation200_response_spec.rb
6111
6114
  - spec/models/start_sms_registration200_response_spec.rb
6115
+ - spec/models/get_message_attachment200_response_spec.rb
6112
6116
  - spec/models/update_queue_slot_request_spec.rb
6113
6117
  - spec/models/respond_to_sms_registration_review200_response_spec.rb
6114
6118
  - spec/models/analytics_list_response_posts_inner_spec.rb
Binary file