late-sdk 0.0.110 → 0.0.112

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.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +20 -0
  3. data/docs/AnalyticsApi.md +154 -0
  4. data/docs/CreateInboxConversation201Response.md +20 -0
  5. data/docs/CreateInboxConversation201ResponseData.md +26 -0
  6. data/docs/CreateInboxConversation400Response.md +20 -0
  7. data/docs/CreateInboxConversation422Response.md +20 -0
  8. data/docs/CreateInboxConversationRequest.md +26 -0
  9. data/docs/CreatePostRequest.md +2 -0
  10. data/docs/EditPost200Response.md +24 -0
  11. data/docs/EditPostRequest.md +20 -0
  12. data/docs/FacebookPlatformData.md +3 -1
  13. data/docs/GetGoogleBusinessPerformance200Response.md +28 -0
  14. data/docs/GetGoogleBusinessPerformance200ResponseDateRange.md +20 -0
  15. data/docs/GetGoogleBusinessPerformance200ResponseMetricsValue.md +20 -0
  16. data/docs/GetGoogleBusinessPerformance200ResponseMetricsValueValuesInner.md +20 -0
  17. data/docs/GetGoogleBusinessPerformance400Response.md +20 -0
  18. data/docs/GetGoogleBusinessSearchKeywords200Response.md +28 -0
  19. data/docs/GetGoogleBusinessSearchKeywords200ResponseKeywordsInner.md +20 -0
  20. data/docs/GetGoogleBusinessSearchKeywords200ResponseMonthRange.md +20 -0
  21. data/docs/GetGoogleBusinessSearchKeywords400Response.md +18 -0
  22. data/docs/MessagesApi.md +70 -0
  23. data/docs/PostsApi.md +72 -0
  24. data/docs/TwitterPlatformData.md +3 -1
  25. data/docs/UpdatePostRequest.md +2 -0
  26. data/lib/late-sdk/api/analytics_api.rb +153 -0
  27. data/lib/late-sdk/api/messages_api.rb +68 -0
  28. data/lib/late-sdk/api/posts_api.rb +74 -0
  29. data/lib/late-sdk/models/create_inbox_conversation201_response.rb +156 -0
  30. data/lib/late-sdk/models/create_inbox_conversation201_response_data.rb +188 -0
  31. data/lib/late-sdk/models/create_inbox_conversation400_response.rb +190 -0
  32. data/lib/late-sdk/models/create_inbox_conversation422_response.rb +190 -0
  33. data/lib/late-sdk/models/create_inbox_conversation_request.rb +207 -0
  34. data/lib/late-sdk/models/create_post_request.rb +11 -1
  35. data/lib/late-sdk/models/edit_post200_response.rb +176 -0
  36. data/lib/late-sdk/models/edit_post_request.rb +216 -0
  37. data/lib/late-sdk/models/facebook_platform_data.rb +14 -2
  38. data/lib/late-sdk/models/get_google_business_performance200_response.rb +195 -0
  39. data/lib/late-sdk/models/get_google_business_performance200_response_date_range.rb +156 -0
  40. data/lib/late-sdk/models/get_google_business_performance200_response_metrics_value.rb +159 -0
  41. data/lib/late-sdk/models/get_google_business_performance200_response_metrics_value_values_inner.rb +156 -0
  42. data/lib/late-sdk/models/get_google_business_performance400_response.rb +158 -0
  43. data/lib/late-sdk/models/get_google_business_search_keywords200_response.rb +194 -0
  44. data/lib/late-sdk/models/get_google_business_search_keywords200_response_keywords_inner.rb +156 -0
  45. data/lib/late-sdk/models/get_google_business_search_keywords200_response_month_range.rb +156 -0
  46. data/lib/late-sdk/models/get_google_business_search_keywords400_response.rb +147 -0
  47. data/lib/late-sdk/models/twitter_platform_data.rb +16 -4
  48. data/lib/late-sdk/models/update_post_request.rb +11 -1
  49. data/lib/late-sdk/version.rb +1 -1
  50. data/lib/late-sdk.rb +16 -0
  51. data/openapi.yaml +423 -1
  52. data/spec/api/analytics_api_spec.rb +29 -0
  53. data/spec/api/messages_api_spec.rb +12 -0
  54. data/spec/api/posts_api_spec.rb +13 -0
  55. data/spec/models/create_inbox_conversation201_response_data_spec.rb +60 -0
  56. data/spec/models/create_inbox_conversation201_response_spec.rb +42 -0
  57. data/spec/models/create_inbox_conversation400_response_spec.rb +46 -0
  58. data/spec/models/create_inbox_conversation422_response_spec.rb +46 -0
  59. data/spec/models/create_inbox_conversation_request_spec.rb +60 -0
  60. data/spec/models/create_post_request_spec.rb +6 -0
  61. data/spec/models/edit_post200_response_spec.rb +54 -0
  62. data/spec/models/edit_post_request_spec.rb +46 -0
  63. data/spec/models/facebook_platform_data_spec.rb +6 -0
  64. data/spec/models/get_google_business_performance200_response_date_range_spec.rb +42 -0
  65. data/spec/models/get_google_business_performance200_response_metrics_value_spec.rb +42 -0
  66. data/spec/models/get_google_business_performance200_response_metrics_value_values_inner_spec.rb +42 -0
  67. data/spec/models/get_google_business_performance200_response_spec.rb +66 -0
  68. data/spec/models/get_google_business_performance400_response_spec.rb +42 -0
  69. data/spec/models/get_google_business_search_keywords200_response_keywords_inner_spec.rb +42 -0
  70. data/spec/models/get_google_business_search_keywords200_response_month_range_spec.rb +42 -0
  71. data/spec/models/get_google_business_search_keywords200_response_spec.rb +66 -0
  72. data/spec/models/get_google_business_search_keywords400_response_spec.rb +36 -0
  73. data/spec/models/twitter_platform_data_spec.rb +6 -0
  74. data/spec/models/update_post_request_spec.rb +6 -0
  75. data/zernio-sdk-0.0.112.gem +0 -0
  76. metadata +67 -3
  77. data/zernio-sdk-0.0.110.gem +0 -0
data/docs/MessagesApi.md CHANGED
@@ -5,6 +5,7 @@ All URIs are relative to *https://zernio.com/api*
5
5
  | Method | HTTP request | Description |
6
6
  | ------ | ------------ | ----------- |
7
7
  | [**add_message_reaction**](MessagesApi.md#add_message_reaction) | **POST** /v1/inbox/conversations/{conversationId}/messages/{messageId}/reactions | Add reaction |
8
+ | [**create_inbox_conversation**](MessagesApi.md#create_inbox_conversation) | **POST** /v1/inbox/conversations | Create conversation |
8
9
  | [**delete_inbox_message**](MessagesApi.md#delete_inbox_message) | **DELETE** /v1/inbox/conversations/{conversationId}/messages/{messageId} | Delete message |
9
10
  | [**edit_inbox_message**](MessagesApi.md#edit_inbox_message) | **PATCH** /v1/inbox/conversations/{conversationId}/messages/{messageId} | Edit message |
10
11
  | [**get_inbox_conversation**](MessagesApi.md#get_inbox_conversation) | **GET** /v1/inbox/conversations/{conversationId} | Get conversation |
@@ -90,6 +91,75 @@ end
90
91
  - **Accept**: application/json
91
92
 
92
93
 
94
+ ## create_inbox_conversation
95
+
96
+ > <CreateInboxConversation201Response> create_inbox_conversation(create_inbox_conversation_request)
97
+
98
+ Create conversation
99
+
100
+ 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. **Currently supported platforms:** Twitter/X only. Other platforms will return `PLATFORM_NOT_SUPPORTED`. **DM eligibility:** 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:** 200 requests per 15 minutes, 1,000 per 24 hours per user, 15,000 per 24 hours per app (shared across all DM endpoints).
101
+
102
+ ### Examples
103
+
104
+ ```ruby
105
+ require 'time'
106
+ require 'late-sdk'
107
+ # setup authorization
108
+ Late.configure do |config|
109
+ # Configure Bearer authorization (JWT): bearerAuth
110
+ config.access_token = 'YOUR_BEARER_TOKEN'
111
+ end
112
+
113
+ api_instance = Late::MessagesApi.new
114
+ create_inbox_conversation_request = Late::CreateInboxConversationRequest.new({account_id: 'account_id_example'}) # CreateInboxConversationRequest |
115
+
116
+ begin
117
+ # Create conversation
118
+ result = api_instance.create_inbox_conversation(create_inbox_conversation_request)
119
+ p result
120
+ rescue Late::ApiError => e
121
+ puts "Error when calling MessagesApi->create_inbox_conversation: #{e}"
122
+ end
123
+ ```
124
+
125
+ #### Using the create_inbox_conversation_with_http_info variant
126
+
127
+ This returns an Array which contains the response data, status code and headers.
128
+
129
+ > <Array(<CreateInboxConversation201Response>, Integer, Hash)> create_inbox_conversation_with_http_info(create_inbox_conversation_request)
130
+
131
+ ```ruby
132
+ begin
133
+ # Create conversation
134
+ data, status_code, headers = api_instance.create_inbox_conversation_with_http_info(create_inbox_conversation_request)
135
+ p status_code # => 2xx
136
+ p headers # => { ... }
137
+ p data # => <CreateInboxConversation201Response>
138
+ rescue Late::ApiError => e
139
+ puts "Error when calling MessagesApi->create_inbox_conversation_with_http_info: #{e}"
140
+ end
141
+ ```
142
+
143
+ ### Parameters
144
+
145
+ | Name | Type | Description | Notes |
146
+ | ---- | ---- | ----------- | ----- |
147
+ | **create_inbox_conversation_request** | [**CreateInboxConversationRequest**](CreateInboxConversationRequest.md) | | |
148
+
149
+ ### Return type
150
+
151
+ [**CreateInboxConversation201Response**](CreateInboxConversation201Response.md)
152
+
153
+ ### Authorization
154
+
155
+ [bearerAuth](../README.md#bearerAuth)
156
+
157
+ ### HTTP request headers
158
+
159
+ - **Content-Type**: application/json, multipart/form-data
160
+ - **Accept**: application/json
161
+
162
+
93
163
  ## delete_inbox_message
94
164
 
95
165
  > <UpdateYoutubeDefaultPlaylist200Response> delete_inbox_message(conversation_id, message_id, account_id)
data/docs/PostsApi.md CHANGED
@@ -7,6 +7,7 @@ All URIs are relative to *https://zernio.com/api*
7
7
  | [**bulk_upload_posts**](PostsApi.md#bulk_upload_posts) | **POST** /v1/posts/bulk-upload | Bulk upload from CSV |
8
8
  | [**create_post**](PostsApi.md#create_post) | **POST** /v1/posts | Create post |
9
9
  | [**delete_post**](PostsApi.md#delete_post) | **DELETE** /v1/posts/{postId} | Delete post |
10
+ | [**edit_post**](PostsApi.md#edit_post) | **POST** /v1/posts/{postId}/edit | Edit published post |
10
11
  | [**get_post**](PostsApi.md#get_post) | **GET** /v1/posts/{postId} | Get post |
11
12
  | [**list_posts**](PostsApi.md#list_posts) | **GET** /v1/posts | List posts |
12
13
  | [**retry_post**](PostsApi.md#retry_post) | **POST** /v1/posts/{postId}/retry | Retry failed post |
@@ -226,6 +227,77 @@ end
226
227
  - **Accept**: application/json
227
228
 
228
229
 
230
+ ## edit_post
231
+
232
+ > <EditPost200Response> edit_post(post_id, edit_post_request)
233
+
234
+ Edit published post
235
+
236
+ Edit a published post on a social media platform. Currently only supported for X (Twitter). **Requirements:** - Connected X account must have an active X Premium subscription - Must be within 1 hour of original publish time - Maximum 5 edits per tweet (enforced by X) - Text-only edits (media changes are not supported) The post record in Zernio is updated with the new content and edit history.
237
+
238
+ ### Examples
239
+
240
+ ```ruby
241
+ require 'time'
242
+ require 'late-sdk'
243
+ # setup authorization
244
+ Late.configure do |config|
245
+ # Configure Bearer authorization (JWT): bearerAuth
246
+ config.access_token = 'YOUR_BEARER_TOKEN'
247
+ end
248
+
249
+ api_instance = Late::PostsApi.new
250
+ post_id = 'post_id_example' # String |
251
+ edit_post_request = Late::EditPostRequest.new({platform: 'twitter', content: 'content_example'}) # EditPostRequest |
252
+
253
+ begin
254
+ # Edit published post
255
+ result = api_instance.edit_post(post_id, edit_post_request)
256
+ p result
257
+ rescue Late::ApiError => e
258
+ puts "Error when calling PostsApi->edit_post: #{e}"
259
+ end
260
+ ```
261
+
262
+ #### Using the edit_post_with_http_info variant
263
+
264
+ This returns an Array which contains the response data, status code and headers.
265
+
266
+ > <Array(<EditPost200Response>, Integer, Hash)> edit_post_with_http_info(post_id, edit_post_request)
267
+
268
+ ```ruby
269
+ begin
270
+ # Edit published post
271
+ data, status_code, headers = api_instance.edit_post_with_http_info(post_id, edit_post_request)
272
+ p status_code # => 2xx
273
+ p headers # => { ... }
274
+ p data # => <EditPost200Response>
275
+ rescue Late::ApiError => e
276
+ puts "Error when calling PostsApi->edit_post_with_http_info: #{e}"
277
+ end
278
+ ```
279
+
280
+ ### Parameters
281
+
282
+ | Name | Type | Description | Notes |
283
+ | ---- | ---- | ----------- | ----- |
284
+ | **post_id** | **String** | | |
285
+ | **edit_post_request** | [**EditPostRequest**](EditPostRequest.md) | | |
286
+
287
+ ### Return type
288
+
289
+ [**EditPost200Response**](EditPost200Response.md)
290
+
291
+ ### Authorization
292
+
293
+ [bearerAuth](../README.md#bearerAuth)
294
+
295
+ ### HTTP request headers
296
+
297
+ - **Content-Type**: application/json
298
+ - **Accept**: application/json
299
+
300
+
229
301
  ## get_post
230
302
 
231
303
  > <PostGetResponse> get_post(post_id)
@@ -8,6 +8,7 @@
8
8
  | **reply_settings** | **String** | Controls who can reply to the tweet. \&quot;following\&quot; allows only people you follow, \&quot;mentionedUsers\&quot; allows only mentioned users, \&quot;subscribers\&quot; allows only subscribers, \&quot;verified\&quot; allows only verified users. Omit for default (everyone can reply). For threads, applies to the first tweet only. Cannot be combined with replyToTweetId. | [optional] |
9
9
  | **thread_items** | [**Array&lt;TwitterPlatformDataThreadItemsInner&gt;**](TwitterPlatformDataThreadItemsInner.md) | Sequence of tweets in a thread. First item is the root tweet. | [optional] |
10
10
  | **poll** | [**TwitterPlatformDataPoll**](TwitterPlatformDataPoll.md) | | [optional] |
11
+ | **long_video** | **Boolean** | Enable long video uploads (over 140 seconds) using amplify_video media category. Requires the connected X account to have an active X Premium subscription. When true, videos are uploaded with the amplify_video category which supports longer durations (up to 10 minutes via API). When false or omitted, the standard tweet_video category is used (140 second limit). Note that not all Premium accounts have API long-video access, as X may require separate allowlisting. | [optional][default to false] |
11
12
 
12
13
  ## Example
13
14
 
@@ -18,7 +19,8 @@ instance = Late::TwitterPlatformData.new(
18
19
  reply_to_tweet_id: null,
19
20
  reply_settings: null,
20
21
  thread_items: null,
21
- poll: null
22
+ poll: null,
23
+ long_video: null
22
24
  )
23
25
  ```
24
26
 
@@ -7,6 +7,7 @@
7
7
  | **content** | **String** | | [optional] |
8
8
  | **scheduled_for** | **Time** | | [optional] |
9
9
  | **tiktok_settings** | [**TikTokPlatformData**](TikTokPlatformData.md) | Root-level TikTok settings applied to all TikTok platforms. Merged into each platform&#39;s platformSpecificData, with platform-specific settings taking precedence. | [optional] |
10
+ | **facebook_settings** | [**FacebookPlatformData**](FacebookPlatformData.md) | Root-level Facebook settings applied to all Facebook platforms. Merged into each platform&#39;s platformSpecificData, with platform-specific settings taking precedence. | [optional] |
10
11
  | **recycling** | [**RecyclingConfig**](RecyclingConfig.md) | | [optional] |
11
12
 
12
13
  ## Example
@@ -18,6 +19,7 @@ instance = Late::UpdatePostRequest.new(
18
19
  content: null,
19
20
  scheduled_for: null,
20
21
  tiktok_settings: null,
22
+ facebook_settings: null,
21
23
  recycling: null
22
24
  )
23
25
  ```
@@ -428,6 +428,159 @@ module Late
428
428
  return data, status_code, headers
429
429
  end
430
430
 
431
+ # Get Google Business Profile performance metrics
432
+ # Returns daily performance metrics for a Google Business Profile location. Metrics include impressions (Maps/Search, desktop/mobile), website clicks, call clicks, direction requests, conversations, bookings, and food orders. Data may be delayed 2-3 days. Max 18 months of historical data. Requires the Analytics add-on.
433
+ # @param account_id [String] The Zernio SocialAccount ID for the Google Business Profile account.
434
+ # @param [Hash] opts the optional parameters
435
+ # @option opts [String] :metrics Comma-separated metric names. Defaults to all available metrics. Valid values: BUSINESS_IMPRESSIONS_DESKTOP_MAPS, BUSINESS_IMPRESSIONS_DESKTOP_SEARCH, BUSINESS_IMPRESSIONS_MOBILE_MAPS, BUSINESS_IMPRESSIONS_MOBILE_SEARCH, BUSINESS_CONVERSATIONS, BUSINESS_DIRECTION_REQUESTS, CALL_CLICKS, WEBSITE_CLICKS, BUSINESS_BOOKINGS, BUSINESS_FOOD_ORDERS, BUSINESS_FOOD_MENU_CLICKS
436
+ # @option opts [Date] :start_date Start date (YYYY-MM-DD). Defaults to 30 days ago. Max 18 months back.
437
+ # @option opts [Date] :end_date End date (YYYY-MM-DD). Defaults to today.
438
+ # @return [GetGoogleBusinessPerformance200Response]
439
+ def get_google_business_performance(account_id, opts = {})
440
+ data, _status_code, _headers = get_google_business_performance_with_http_info(account_id, opts)
441
+ data
442
+ end
443
+
444
+ # Get Google Business Profile performance metrics
445
+ # Returns daily performance metrics for a Google Business Profile location. Metrics include impressions (Maps/Search, desktop/mobile), website clicks, call clicks, direction requests, conversations, bookings, and food orders. Data may be delayed 2-3 days. Max 18 months of historical data. Requires the Analytics add-on.
446
+ # @param account_id [String] The Zernio SocialAccount ID for the Google Business Profile account.
447
+ # @param [Hash] opts the optional parameters
448
+ # @option opts [String] :metrics Comma-separated metric names. Defaults to all available metrics. Valid values: BUSINESS_IMPRESSIONS_DESKTOP_MAPS, BUSINESS_IMPRESSIONS_DESKTOP_SEARCH, BUSINESS_IMPRESSIONS_MOBILE_MAPS, BUSINESS_IMPRESSIONS_MOBILE_SEARCH, BUSINESS_CONVERSATIONS, BUSINESS_DIRECTION_REQUESTS, CALL_CLICKS, WEBSITE_CLICKS, BUSINESS_BOOKINGS, BUSINESS_FOOD_ORDERS, BUSINESS_FOOD_MENU_CLICKS
449
+ # @option opts [Date] :start_date Start date (YYYY-MM-DD). Defaults to 30 days ago. Max 18 months back.
450
+ # @option opts [Date] :end_date End date (YYYY-MM-DD). Defaults to today.
451
+ # @return [Array<(GetGoogleBusinessPerformance200Response, Integer, Hash)>] GetGoogleBusinessPerformance200Response data, response status code and response headers
452
+ def get_google_business_performance_with_http_info(account_id, opts = {})
453
+ if @api_client.config.debugging
454
+ @api_client.config.logger.debug 'Calling API: AnalyticsApi.get_google_business_performance ...'
455
+ end
456
+ # verify the required parameter 'account_id' is set
457
+ if @api_client.config.client_side_validation && account_id.nil?
458
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling AnalyticsApi.get_google_business_performance"
459
+ end
460
+ # resource path
461
+ local_var_path = '/v1/analytics/googlebusiness/performance'
462
+
463
+ # query parameters
464
+ query_params = opts[:query_params] || {}
465
+ query_params[:'accountId'] = account_id
466
+ query_params[:'metrics'] = opts[:'metrics'] if !opts[:'metrics'].nil?
467
+ query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
468
+ query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
469
+
470
+ # header parameters
471
+ header_params = opts[:header_params] || {}
472
+ # HTTP header 'Accept' (if needed)
473
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
474
+
475
+ # form parameters
476
+ form_params = opts[:form_params] || {}
477
+
478
+ # http body (model)
479
+ post_body = opts[:debug_body]
480
+
481
+ # return_type
482
+ return_type = opts[:debug_return_type] || 'GetGoogleBusinessPerformance200Response'
483
+
484
+ # auth_names
485
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
486
+
487
+ new_options = opts.merge(
488
+ :operation => :"AnalyticsApi.get_google_business_performance",
489
+ :header_params => header_params,
490
+ :query_params => query_params,
491
+ :form_params => form_params,
492
+ :body => post_body,
493
+ :auth_names => auth_names,
494
+ :return_type => return_type
495
+ )
496
+
497
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
498
+ if @api_client.config.debugging
499
+ @api_client.config.logger.debug "API called: AnalyticsApi#get_google_business_performance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
500
+ end
501
+ return data, status_code, headers
502
+ end
503
+
504
+ # Get Google Business Profile search keywords
505
+ # Returns search keywords that triggered impressions for a Google Business Profile location. Data is aggregated monthly. Keywords below a minimum impression threshold set by Google are excluded. Max 18 months of historical data. Requires the Analytics add-on.
506
+ # @param account_id [String] The Zernio SocialAccount ID for the Google Business Profile account.
507
+ # @param [Hash] opts the optional parameters
508
+ # @option opts [String] :start_month Start month (YYYY-MM). Defaults to 3 months ago.
509
+ # @option opts [String] :end_month End month (YYYY-MM). Defaults to current month.
510
+ # @return [GetGoogleBusinessSearchKeywords200Response]
511
+ def get_google_business_search_keywords(account_id, opts = {})
512
+ data, _status_code, _headers = get_google_business_search_keywords_with_http_info(account_id, opts)
513
+ data
514
+ end
515
+
516
+ # Get Google Business Profile search keywords
517
+ # Returns search keywords that triggered impressions for a Google Business Profile location. Data is aggregated monthly. Keywords below a minimum impression threshold set by Google are excluded. Max 18 months of historical data. Requires the Analytics add-on.
518
+ # @param account_id [String] The Zernio SocialAccount ID for the Google Business Profile account.
519
+ # @param [Hash] opts the optional parameters
520
+ # @option opts [String] :start_month Start month (YYYY-MM). Defaults to 3 months ago.
521
+ # @option opts [String] :end_month End month (YYYY-MM). Defaults to current month.
522
+ # @return [Array<(GetGoogleBusinessSearchKeywords200Response, Integer, Hash)>] GetGoogleBusinessSearchKeywords200Response data, response status code and response headers
523
+ def get_google_business_search_keywords_with_http_info(account_id, opts = {})
524
+ if @api_client.config.debugging
525
+ @api_client.config.logger.debug 'Calling API: AnalyticsApi.get_google_business_search_keywords ...'
526
+ end
527
+ # verify the required parameter 'account_id' is set
528
+ if @api_client.config.client_side_validation && account_id.nil?
529
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling AnalyticsApi.get_google_business_search_keywords"
530
+ end
531
+ pattern = Regexp.new(/^\d{4}-\d{2}$/)
532
+ if @api_client.config.client_side_validation && !opts[:'start_month'].nil? && opts[:'start_month'] !~ pattern
533
+ fail ArgumentError, "invalid value for 'opts[:\"start_month\"]' when calling AnalyticsApi.get_google_business_search_keywords, must conform to the pattern #{pattern}."
534
+ end
535
+
536
+ pattern = Regexp.new(/^\d{4}-\d{2}$/)
537
+ if @api_client.config.client_side_validation && !opts[:'end_month'].nil? && opts[:'end_month'] !~ pattern
538
+ fail ArgumentError, "invalid value for 'opts[:\"end_month\"]' when calling AnalyticsApi.get_google_business_search_keywords, must conform to the pattern #{pattern}."
539
+ end
540
+
541
+ # resource path
542
+ local_var_path = '/v1/analytics/googlebusiness/search-keywords'
543
+
544
+ # query parameters
545
+ query_params = opts[:query_params] || {}
546
+ query_params[:'accountId'] = account_id
547
+ query_params[:'startMonth'] = opts[:'start_month'] if !opts[:'start_month'].nil?
548
+ query_params[:'endMonth'] = opts[:'end_month'] if !opts[:'end_month'].nil?
549
+
550
+ # header parameters
551
+ header_params = opts[:header_params] || {}
552
+ # HTTP header 'Accept' (if needed)
553
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
554
+
555
+ # form parameters
556
+ form_params = opts[:form_params] || {}
557
+
558
+ # http body (model)
559
+ post_body = opts[:debug_body]
560
+
561
+ # return_type
562
+ return_type = opts[:debug_return_type] || 'GetGoogleBusinessSearchKeywords200Response'
563
+
564
+ # auth_names
565
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
566
+
567
+ new_options = opts.merge(
568
+ :operation => :"AnalyticsApi.get_google_business_search_keywords",
569
+ :header_params => header_params,
570
+ :query_params => query_params,
571
+ :form_params => form_params,
572
+ :body => post_body,
573
+ :auth_names => auth_names,
574
+ :return_type => return_type
575
+ )
576
+
577
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
578
+ if @api_client.config.debugging
579
+ @api_client.config.logger.debug "API called: AnalyticsApi#get_google_business_search_keywords\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
580
+ end
581
+ return data, status_code, headers
582
+ end
583
+
431
584
  # Get Instagram account-level insights
432
585
  # Returns account-level Instagram insights such as reach, views, accounts engaged, and total interactions. These metrics reflect the entire account's performance across all content surfaces (feed, stories, explore, profile), and are fundamentally different from post-level metrics. Data may be delayed up to 48 hours. Max 90 days, defaults to last 30 days. Requires the Analytics add-on.
433
586
  # @param account_id [String] The Zernio SocialAccount ID for the Instagram account
@@ -99,6 +99,74 @@ module Late
99
99
  return data, status_code, headers
100
100
  end
101
101
 
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. **Currently supported platforms:** Twitter/X only. Other platforms will return `PLATFORM_NOT_SUPPORTED`. **DM eligibility:** 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:** 200 requests per 15 minutes, 1,000 per 24 hours per user, 15,000 per 24 hours per app (shared across all DM endpoints).
104
+ # @param create_inbox_conversation_request [CreateInboxConversationRequest]
105
+ # @param [Hash] opts the optional parameters
106
+ # @return [CreateInboxConversation201Response]
107
+ def create_inbox_conversation(create_inbox_conversation_request, opts = {})
108
+ data, _status_code, _headers = create_inbox_conversation_with_http_info(create_inbox_conversation_request, opts)
109
+ data
110
+ end
111
+
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. **Currently supported platforms:** Twitter/X only. Other platforms will return &#x60;PLATFORM_NOT_SUPPORTED&#x60;. **DM eligibility:** Before sending, the endpoint checks if the recipient accepts DMs from your account (via the &#x60;receives_your_dm&#x60; field). If not, a 422 error with code &#x60;DM_NOT_ALLOWED&#x60; is returned. You can skip this check with &#x60;skipDmCheck: true&#x60; 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:** 200 requests per 15 minutes, 1,000 per 24 hours per user, 15,000 per 24 hours per app (shared across all DM endpoints).
114
+ # @param create_inbox_conversation_request [CreateInboxConversationRequest]
115
+ # @param [Hash] opts the optional parameters
116
+ # @return [Array<(CreateInboxConversation201Response, Integer, Hash)>] CreateInboxConversation201Response data, response status code and response headers
117
+ def create_inbox_conversation_with_http_info(create_inbox_conversation_request, opts = {})
118
+ if @api_client.config.debugging
119
+ @api_client.config.logger.debug 'Calling API: MessagesApi.create_inbox_conversation ...'
120
+ end
121
+ # verify the required parameter 'create_inbox_conversation_request' is set
122
+ if @api_client.config.client_side_validation && create_inbox_conversation_request.nil?
123
+ fail ArgumentError, "Missing the required parameter 'create_inbox_conversation_request' when calling MessagesApi.create_inbox_conversation"
124
+ end
125
+ # resource path
126
+ local_var_path = '/v1/inbox/conversations'
127
+
128
+ # query parameters
129
+ query_params = opts[:query_params] || {}
130
+
131
+ # header parameters
132
+ header_params = opts[:header_params] || {}
133
+ # HTTP header 'Accept' (if needed)
134
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
135
+ # HTTP header 'Content-Type'
136
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])
137
+ if !content_type.nil?
138
+ header_params['Content-Type'] = content_type
139
+ end
140
+
141
+ # form parameters
142
+ form_params = opts[:form_params] || {}
143
+
144
+ # http body (model)
145
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_inbox_conversation_request)
146
+
147
+ # return_type
148
+ return_type = opts[:debug_return_type] || 'CreateInboxConversation201Response'
149
+
150
+ # auth_names
151
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
152
+
153
+ new_options = opts.merge(
154
+ :operation => :"MessagesApi.create_inbox_conversation",
155
+ :header_params => header_params,
156
+ :query_params => query_params,
157
+ :form_params => form_params,
158
+ :body => post_body,
159
+ :auth_names => auth_names,
160
+ :return_type => return_type
161
+ )
162
+
163
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
164
+ if @api_client.config.debugging
165
+ @api_client.config.logger.debug "API called: MessagesApi#create_inbox_conversation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
166
+ end
167
+ return data, status_code, headers
168
+ end
169
+
102
170
  # Delete message
103
171
  # Delete a message from a conversation. Platform support varies: - **Telegram**: Full delete (bot's own messages anytime, others if admin) - **X/Twitter**: Full delete (own DM events only) - **Bluesky**: Delete for self only (recipient still sees it) - **Reddit**: Delete from sender's view only - **Facebook, Instagram, WhatsApp**: Not supported (returns 400)
104
172
  # @param conversation_id [String] The conversation ID
@@ -218,6 +218,80 @@ module Late
218
218
  return data, status_code, headers
219
219
  end
220
220
 
221
+ # Edit published post
222
+ # Edit a published post on a social media platform. Currently only supported for X (Twitter). **Requirements:** - Connected X account must have an active X Premium subscription - Must be within 1 hour of original publish time - Maximum 5 edits per tweet (enforced by X) - Text-only edits (media changes are not supported) The post record in Zernio is updated with the new content and edit history.
223
+ # @param post_id [String]
224
+ # @param edit_post_request [EditPostRequest]
225
+ # @param [Hash] opts the optional parameters
226
+ # @return [EditPost200Response]
227
+ def edit_post(post_id, edit_post_request, opts = {})
228
+ data, _status_code, _headers = edit_post_with_http_info(post_id, edit_post_request, opts)
229
+ data
230
+ end
231
+
232
+ # Edit published post
233
+ # Edit a published post on a social media platform. Currently only supported for X (Twitter). **Requirements:** - Connected X account must have an active X Premium subscription - Must be within 1 hour of original publish time - Maximum 5 edits per tweet (enforced by X) - Text-only edits (media changes are not supported) The post record in Zernio is updated with the new content and edit history.
234
+ # @param post_id [String]
235
+ # @param edit_post_request [EditPostRequest]
236
+ # @param [Hash] opts the optional parameters
237
+ # @return [Array<(EditPost200Response, Integer, Hash)>] EditPost200Response data, response status code and response headers
238
+ def edit_post_with_http_info(post_id, edit_post_request, opts = {})
239
+ if @api_client.config.debugging
240
+ @api_client.config.logger.debug 'Calling API: PostsApi.edit_post ...'
241
+ end
242
+ # verify the required parameter 'post_id' is set
243
+ if @api_client.config.client_side_validation && post_id.nil?
244
+ fail ArgumentError, "Missing the required parameter 'post_id' when calling PostsApi.edit_post"
245
+ end
246
+ # verify the required parameter 'edit_post_request' is set
247
+ if @api_client.config.client_side_validation && edit_post_request.nil?
248
+ fail ArgumentError, "Missing the required parameter 'edit_post_request' when calling PostsApi.edit_post"
249
+ end
250
+ # resource path
251
+ local_var_path = '/v1/posts/{postId}/edit'.sub('{' + 'postId' + '}', CGI.escape(post_id.to_s))
252
+
253
+ # query parameters
254
+ query_params = opts[:query_params] || {}
255
+
256
+ # header parameters
257
+ header_params = opts[:header_params] || {}
258
+ # HTTP header 'Accept' (if needed)
259
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
260
+ # HTTP header 'Content-Type'
261
+ content_type = @api_client.select_header_content_type(['application/json'])
262
+ if !content_type.nil?
263
+ header_params['Content-Type'] = content_type
264
+ end
265
+
266
+ # form parameters
267
+ form_params = opts[:form_params] || {}
268
+
269
+ # http body (model)
270
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(edit_post_request)
271
+
272
+ # return_type
273
+ return_type = opts[:debug_return_type] || 'EditPost200Response'
274
+
275
+ # auth_names
276
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
277
+
278
+ new_options = opts.merge(
279
+ :operation => :"PostsApi.edit_post",
280
+ :header_params => header_params,
281
+ :query_params => query_params,
282
+ :form_params => form_params,
283
+ :body => post_body,
284
+ :auth_names => auth_names,
285
+ :return_type => return_type
286
+ )
287
+
288
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
289
+ if @api_client.config.debugging
290
+ @api_client.config.logger.debug "API called: PostsApi#edit_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
291
+ end
292
+ return data, status_code, headers
293
+ end
294
+
221
295
  # Get post
222
296
  # Fetch a single post by ID. For published posts, this returns platformPostUrl for each platform.
223
297
  # @param post_id [String]