zernio-sdk 0.0.739 → 0.0.741
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 +4 -4
- data/README.md +6 -0
- data/docs/AdCreativesApi.md +145 -1
- data/docs/CommentsApi.md +2 -2
- data/docs/DeleteAdVideo200Response.md +22 -0
- data/docs/UploadAdVideo201Response.md +20 -0
- data/docs/UploadAdVideo201ResponseVideo.md +20 -0
- data/docs/UploadAdVideoRequest.md +26 -0
- data/lib/zernio-sdk/api/ad_creatives_api.rb +147 -2
- data/lib/zernio-sdk/api/comments_api.rb +4 -4
- data/lib/zernio-sdk/models/delete_ad_video200_response.rb +165 -0
- data/lib/zernio-sdk/models/upload_ad_video201_response.rb +156 -0
- data/lib/zernio-sdk/models/upload_ad_video201_response_video.rb +159 -0
- data/lib/zernio-sdk/models/upload_ad_video_request.rb +222 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +4 -0
- data/openapi.yaml +99 -1
- data/spec/api/ad_creatives_api_spec.rb +27 -1
- data/spec/api/comments_api_spec.rb +2 -2
- data/spec/models/delete_ad_video200_response_spec.rb +48 -0
- data/spec/models/upload_ad_video201_response_spec.rb +42 -0
- data/spec/models/upload_ad_video201_response_video_spec.rb +42 -0
- data/spec/models/upload_ad_video_request_spec.rb +60 -0
- metadata +17 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6dc0c0d367402f7053993f3ba521801e62237c524c13e02fbf176ad5e3b50798
|
|
4
|
+
data.tar.gz: 21d3efb59761e41ad841ed745d92b175b6e80ee3c864bfec06d8664d49b15091
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e79881e0d24ee7f5b938f0d6324f86f64ee8554f77554d9df538c018cff5b4f2515d10a82dbe3dd42dff202b5efbe4dcbada861d94bcb3ebf8a009f132adc662
|
|
7
|
+
data.tar.gz: bcc525d958ee83a893740e3558f065355bd18374f50530b56978491df63262618c390840a3b676d3b6a12c3557bc12554fe11c8f4b2bb2e2d9791edfb5b40635
|
data/README.md
CHANGED
|
@@ -156,6 +156,7 @@ Class | Method | HTTP request | Description
|
|
|
156
156
|
*Zernio::AdCampaignsApi* | [**update_ad_status**](docs/AdCampaignsApi.md#update_ad_status) | **PUT** /v1/ads/{adId}/status | Pause or resume a single ad
|
|
157
157
|
*Zernio::AdCreativesApi* | [**create_ad_creative**](docs/AdCreativesApi.md#create_ad_creative) | **POST** /v1/ads/creatives | Create a standalone creative
|
|
158
158
|
*Zernio::AdCreativesApi* | [**delete_ad_creative**](docs/AdCreativesApi.md#delete_ad_creative) | **DELETE** /v1/ads/creatives/{creativeId} | Delete a creative
|
|
159
|
+
*Zernio::AdCreativesApi* | [**delete_ad_video**](docs/AdCreativesApi.md#delete_ad_video) | **DELETE** /v1/ads/videos/{videoId} | Delete an ad video
|
|
159
160
|
*Zernio::AdCreativesApi* | [**generate_ad_previews**](docs/AdCreativesApi.md#generate_ad_previews) | **POST** /v1/ads/preview | Render pre-create ad previews
|
|
160
161
|
*Zernio::AdCreativesApi* | [**get_ad_creative**](docs/AdCreativesApi.md#get_ad_creative) | **GET** /v1/ads/creatives/{creativeId} | Creative details
|
|
161
162
|
*Zernio::AdCreativesApi* | [**get_ad_previews**](docs/AdCreativesApi.md#get_ad_previews) | **GET** /v1/ads/{adId}/preview | Render previews of an existing ad
|
|
@@ -166,6 +167,7 @@ Class | Method | HTTP request | Description
|
|
|
166
167
|
*Zernio::AdCreativesApi* | [**list_ad_videos**](docs/AdCreativesApi.md#list_ad_videos) | **GET** /v1/ads/videos | Ad video library
|
|
167
168
|
*Zernio::AdCreativesApi* | [**update_ad_creative**](docs/AdCreativesApi.md#update_ad_creative) | **PUT** /v1/ads/creatives/{creativeId} | Rename a creative
|
|
168
169
|
*Zernio::AdCreativesApi* | [**upload_ad_image**](docs/AdCreativesApi.md#upload_ad_image) | **POST** /v1/ads/images | Upload an ad image from base64
|
|
170
|
+
*Zernio::AdCreativesApi* | [**upload_ad_video**](docs/AdCreativesApi.md#upload_ad_video) | **POST** /v1/ads/videos | Upload an ad video
|
|
169
171
|
*Zernio::AdInsightsApi* | [**create_ad_insights_report**](docs/AdInsightsApi.md#create_ad_insights_report) | **POST** /v1/ads/insights/reports | Submit an async insights report run
|
|
170
172
|
*Zernio::AdInsightsApi* | [**generate_keyword_historical_metrics**](docs/AdInsightsApi.md#generate_keyword_historical_metrics) | **POST** /v1/ads/keywords/historical-metrics | Historical keyword metrics (Google Keyword Planner)
|
|
171
173
|
*Zernio::AdInsightsApi* | [**generate_keyword_ideas**](docs/AdInsightsApi.md#generate_keyword_ideas) | **POST** /v1/ads/keywords/ideas | Generate keyword ideas (Google Keyword Planner)
|
|
@@ -1011,6 +1013,7 @@ Class | Method | HTTP request | Description
|
|
|
1011
1013
|
- [Zernio::DeleteAdCampaign200Response](docs/DeleteAdCampaign200Response.md)
|
|
1012
1014
|
- [Zernio::DeleteAdCampaignRequest](docs/DeleteAdCampaignRequest.md)
|
|
1013
1015
|
- [Zernio::DeleteAdCreative200Response](docs/DeleteAdCreative200Response.md)
|
|
1016
|
+
- [Zernio::DeleteAdVideo200Response](docs/DeleteAdVideo200Response.md)
|
|
1014
1017
|
- [Zernio::DeleteDiscordScheduledEvent200Response](docs/DeleteDiscordScheduledEvent200Response.md)
|
|
1015
1018
|
- [Zernio::DeleteGoogleBusinessMedia200Response](docs/DeleteGoogleBusinessMedia200Response.md)
|
|
1016
1019
|
- [Zernio::DeleteGoogleBusinessPlaceAction200Response](docs/DeleteGoogleBusinessPlaceAction200Response.md)
|
|
@@ -2156,6 +2159,9 @@ Class | Method | HTTP request | Description
|
|
|
2156
2159
|
- [Zernio::UploadAdImage201Response](docs/UploadAdImage201Response.md)
|
|
2157
2160
|
- [Zernio::UploadAdImage201ResponseImage](docs/UploadAdImage201ResponseImage.md)
|
|
2158
2161
|
- [Zernio::UploadAdImageRequest](docs/UploadAdImageRequest.md)
|
|
2162
|
+
- [Zernio::UploadAdVideo201Response](docs/UploadAdVideo201Response.md)
|
|
2163
|
+
- [Zernio::UploadAdVideo201ResponseVideo](docs/UploadAdVideo201ResponseVideo.md)
|
|
2164
|
+
- [Zernio::UploadAdVideoRequest](docs/UploadAdVideoRequest.md)
|
|
2159
2165
|
- [Zernio::UploadMediaDirect200Response](docs/UploadMediaDirect200Response.md)
|
|
2160
2166
|
- [Zernio::UploadPhoneNumberKycDocument200Response](docs/UploadPhoneNumberKycDocument200Response.md)
|
|
2161
2167
|
- [Zernio::UploadPhoneNumberPortInDocument200Response](docs/UploadPhoneNumberPortInDocument200Response.md)
|
data/docs/AdCreativesApi.md
CHANGED
|
@@ -6,6 +6,7 @@ All URIs are relative to *https://zernio.com/api*
|
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
7
|
| [**create_ad_creative**](AdCreativesApi.md#create_ad_creative) | **POST** /v1/ads/creatives | Create a standalone creative |
|
|
8
8
|
| [**delete_ad_creative**](AdCreativesApi.md#delete_ad_creative) | **DELETE** /v1/ads/creatives/{creativeId} | Delete a creative |
|
|
9
|
+
| [**delete_ad_video**](AdCreativesApi.md#delete_ad_video) | **DELETE** /v1/ads/videos/{videoId} | Delete an ad video |
|
|
9
10
|
| [**generate_ad_previews**](AdCreativesApi.md#generate_ad_previews) | **POST** /v1/ads/preview | Render pre-create ad previews |
|
|
10
11
|
| [**get_ad_creative**](AdCreativesApi.md#get_ad_creative) | **GET** /v1/ads/creatives/{creativeId} | Creative details |
|
|
11
12
|
| [**get_ad_previews**](AdCreativesApi.md#get_ad_previews) | **GET** /v1/ads/{adId}/preview | Render previews of an existing ad |
|
|
@@ -16,6 +17,7 @@ All URIs are relative to *https://zernio.com/api*
|
|
|
16
17
|
| [**list_ad_videos**](AdCreativesApi.md#list_ad_videos) | **GET** /v1/ads/videos | Ad video library |
|
|
17
18
|
| [**update_ad_creative**](AdCreativesApi.md#update_ad_creative) | **PUT** /v1/ads/creatives/{creativeId} | Rename a creative |
|
|
18
19
|
| [**upload_ad_image**](AdCreativesApi.md#upload_ad_image) | **POST** /v1/ads/images | Upload an ad image from base64 |
|
|
20
|
+
| [**upload_ad_video**](AdCreativesApi.md#upload_ad_video) | **POST** /v1/ads/videos | Upload an ad video |
|
|
19
21
|
|
|
20
22
|
|
|
21
23
|
## create_ad_creative
|
|
@@ -158,6 +160,79 @@ end
|
|
|
158
160
|
- **Accept**: application/json
|
|
159
161
|
|
|
160
162
|
|
|
163
|
+
## delete_ad_video
|
|
164
|
+
|
|
165
|
+
> <DeleteAdVideo200Response> delete_ad_video(video_id, account_id, ad_account_id)
|
|
166
|
+
|
|
167
|
+
Delete an ad video
|
|
168
|
+
|
|
169
|
+
Removes a video from the ad account's video library. Meta's canonical `DELETE /{video_id}` fails with code 10 / subcode 1363055 for videos uploaded via `/act_X/advideos` even with `ads_management`; this endpoint uses the working account-scoped shape `DELETE /act_X/advideos?video_id=<id>` and returns Meta's `{success: true}` verbatim. Deleting a video that lives in a different ad account, or that Meta has already removed, returns Meta's error verbatim as a 4xx.
|
|
170
|
+
|
|
171
|
+
### Examples
|
|
172
|
+
|
|
173
|
+
```ruby
|
|
174
|
+
require 'time'
|
|
175
|
+
require 'zernio-sdk'
|
|
176
|
+
# setup authorization
|
|
177
|
+
Zernio.configure do |config|
|
|
178
|
+
# Configure Bearer authorization (JWT): bearerAuth
|
|
179
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
api_instance = Zernio::AdCreativesApi.new
|
|
183
|
+
video_id = 'video_id_example' # String | Meta ad video id (numeric).
|
|
184
|
+
account_id = 'account_id_example' # String | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
185
|
+
ad_account_id = 'ad_account_id_example' # String | Meta ad account id (act_<n>) that owns the video.
|
|
186
|
+
|
|
187
|
+
begin
|
|
188
|
+
# Delete an ad video
|
|
189
|
+
result = api_instance.delete_ad_video(video_id, account_id, ad_account_id)
|
|
190
|
+
p result
|
|
191
|
+
rescue Zernio::ApiError => e
|
|
192
|
+
puts "Error when calling AdCreativesApi->delete_ad_video: #{e}"
|
|
193
|
+
end
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
#### Using the delete_ad_video_with_http_info variant
|
|
197
|
+
|
|
198
|
+
This returns an Array which contains the response data, status code and headers.
|
|
199
|
+
|
|
200
|
+
> <Array(<DeleteAdVideo200Response>, Integer, Hash)> delete_ad_video_with_http_info(video_id, account_id, ad_account_id)
|
|
201
|
+
|
|
202
|
+
```ruby
|
|
203
|
+
begin
|
|
204
|
+
# Delete an ad video
|
|
205
|
+
data, status_code, headers = api_instance.delete_ad_video_with_http_info(video_id, account_id, ad_account_id)
|
|
206
|
+
p status_code # => 2xx
|
|
207
|
+
p headers # => { ... }
|
|
208
|
+
p data # => <DeleteAdVideo200Response>
|
|
209
|
+
rescue Zernio::ApiError => e
|
|
210
|
+
puts "Error when calling AdCreativesApi->delete_ad_video_with_http_info: #{e}"
|
|
211
|
+
end
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Parameters
|
|
215
|
+
|
|
216
|
+
| Name | Type | Description | Notes |
|
|
217
|
+
| ---- | ---- | ----------- | ----- |
|
|
218
|
+
| **video_id** | **String** | Meta ad video id (numeric). | |
|
|
219
|
+
| **account_id** | **String** | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token. | |
|
|
220
|
+
| **ad_account_id** | **String** | Meta ad account id (act_<n>) that owns the video. | |
|
|
221
|
+
|
|
222
|
+
### Return type
|
|
223
|
+
|
|
224
|
+
[**DeleteAdVideo200Response**](DeleteAdVideo200Response.md)
|
|
225
|
+
|
|
226
|
+
### Authorization
|
|
227
|
+
|
|
228
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
229
|
+
|
|
230
|
+
### HTTP request headers
|
|
231
|
+
|
|
232
|
+
- **Content-Type**: Not defined
|
|
233
|
+
- **Accept**: application/json
|
|
234
|
+
|
|
235
|
+
|
|
161
236
|
## generate_ad_previews
|
|
162
237
|
|
|
163
238
|
> <GenerateAdPreviews200Response> generate_ad_previews(generate_ad_previews_request)
|
|
@@ -681,7 +756,7 @@ end
|
|
|
681
756
|
|
|
682
757
|
Ad video library
|
|
683
758
|
|
|
684
|
-
Lists the ad account's video library (Meta's `/act_X/advideos`), rows returned verbatim. The default projection covers id, title, status, poster frames and length; `fields` is a raw-passthrough override. Any `id` here is reusable as `video.id` on the create endpoints, so N ads that differ only in copy share one upload. This is the only way to reach a video uploaded OUTSIDE Zernio (Ads Manager, another tool); videos we uploaded also come back as `creative.videoId` on GET /v1/ads. Meta transcodes asynchronously, so a row is only usable once `status.video_status` reads `ready`.
|
|
759
|
+
Lists the ad account's video library (Meta's `/act_X/advideos`), rows returned verbatim. The default projection covers id, title, status, poster frames and length; `fields` is a raw-passthrough override. Any `id` here is reusable as `video.id` on the create endpoints, so N ads that differ only in copy share one upload. This is the only way to reach a video uploaded OUTSIDE Zernio (Ads Manager, another tool); videos we uploaded also come back as `creative.videoId` on GET /v1/ads. Meta transcodes asynchronously, so a row is only usable once `status.video_status` reads `ready`. Upload a new video via POST /v1/ads/videos, or inline via `video.url` on POST /v1/ads/create.
|
|
685
760
|
|
|
686
761
|
### Examples
|
|
687
762
|
|
|
@@ -893,3 +968,72 @@ end
|
|
|
893
968
|
- **Content-Type**: application/json
|
|
894
969
|
- **Accept**: application/json
|
|
895
970
|
|
|
971
|
+
|
|
972
|
+
## upload_ad_video
|
|
973
|
+
|
|
974
|
+
> <UploadAdVideo201Response> upload_ad_video(upload_ad_video_request)
|
|
975
|
+
|
|
976
|
+
Upload an ad video
|
|
977
|
+
|
|
978
|
+
Standalone ad-video upload (parallel to POST /v1/ads/images), so a video creative can be rendered via POST /v1/ads/preview or attached via `video.id` on POST /v1/ads/create before an ad exists. Accepts either an https `videoUrl` we download server-side (SSRF-guarded) or raw `videoBase64` bytes; exactly one is required. `videoBase64` is capped by Vercel's body limit — around 4.5 MB payload in practice, so larger videos must come via `videoUrl`. Returns the Meta `video.id` (reusable wherever `video.id` is accepted) plus Meta's auto-generated poster URL when available. The endpoint waits until Meta reports the video ready (chunked upload + transcode can take minutes; the handler runs up to 800 s).
|
|
979
|
+
|
|
980
|
+
### Examples
|
|
981
|
+
|
|
982
|
+
```ruby
|
|
983
|
+
require 'time'
|
|
984
|
+
require 'zernio-sdk'
|
|
985
|
+
# setup authorization
|
|
986
|
+
Zernio.configure do |config|
|
|
987
|
+
# Configure Bearer authorization (JWT): bearerAuth
|
|
988
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
989
|
+
end
|
|
990
|
+
|
|
991
|
+
api_instance = Zernio::AdCreativesApi.new
|
|
992
|
+
upload_ad_video_request = Zernio::UploadAdVideoRequest.new({account_id: 'account_id_example', ad_account_id: 'ad_account_id_example'}) # UploadAdVideoRequest |
|
|
993
|
+
|
|
994
|
+
begin
|
|
995
|
+
# Upload an ad video
|
|
996
|
+
result = api_instance.upload_ad_video(upload_ad_video_request)
|
|
997
|
+
p result
|
|
998
|
+
rescue Zernio::ApiError => e
|
|
999
|
+
puts "Error when calling AdCreativesApi->upload_ad_video: #{e}"
|
|
1000
|
+
end
|
|
1001
|
+
```
|
|
1002
|
+
|
|
1003
|
+
#### Using the upload_ad_video_with_http_info variant
|
|
1004
|
+
|
|
1005
|
+
This returns an Array which contains the response data, status code and headers.
|
|
1006
|
+
|
|
1007
|
+
> <Array(<UploadAdVideo201Response>, Integer, Hash)> upload_ad_video_with_http_info(upload_ad_video_request)
|
|
1008
|
+
|
|
1009
|
+
```ruby
|
|
1010
|
+
begin
|
|
1011
|
+
# Upload an ad video
|
|
1012
|
+
data, status_code, headers = api_instance.upload_ad_video_with_http_info(upload_ad_video_request)
|
|
1013
|
+
p status_code # => 2xx
|
|
1014
|
+
p headers # => { ... }
|
|
1015
|
+
p data # => <UploadAdVideo201Response>
|
|
1016
|
+
rescue Zernio::ApiError => e
|
|
1017
|
+
puts "Error when calling AdCreativesApi->upload_ad_video_with_http_info: #{e}"
|
|
1018
|
+
end
|
|
1019
|
+
```
|
|
1020
|
+
|
|
1021
|
+
### Parameters
|
|
1022
|
+
|
|
1023
|
+
| Name | Type | Description | Notes |
|
|
1024
|
+
| ---- | ---- | ----------- | ----- |
|
|
1025
|
+
| **upload_ad_video_request** | [**UploadAdVideoRequest**](UploadAdVideoRequest.md) | | |
|
|
1026
|
+
|
|
1027
|
+
### Return type
|
|
1028
|
+
|
|
1029
|
+
[**UploadAdVideo201Response**](UploadAdVideo201Response.md)
|
|
1030
|
+
|
|
1031
|
+
### Authorization
|
|
1032
|
+
|
|
1033
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
1034
|
+
|
|
1035
|
+
### HTTP request headers
|
|
1036
|
+
|
|
1037
|
+
- **Content-Type**: application/json
|
|
1038
|
+
- **Accept**: application/json
|
|
1039
|
+
|
data/docs/CommentsApi.md
CHANGED
|
@@ -171,7 +171,7 @@ end
|
|
|
171
171
|
|
|
172
172
|
Get post comments
|
|
173
173
|
|
|
174
|
-
Fetch comments for a specific post. Requires accountId query parameter. On Facebook and Instagram, passing a COMMENT id as `postId` is also supported and returns that comment's replies instead of the post's top-level comments. This is not available on YouTube, where `postId` must be a video id.
|
|
174
|
+
Fetch comments for a specific post. Requires accountId query parameter. On Facebook and Instagram, passing a COMMENT id as `postId` is also supported and returns that comment's replies instead of the post's top-level comments. This is not available on YouTube, where `postId` must be a video id. Responses are cached for up to 10 minutes, so a page may lag new comments by that window. Do not poll this endpoint for real-time updates: subscribe to the `comment.received` webhook, which delivers new comments as they arrive. Your own writes (creating, replying to, or deleting a comment) refresh the cache immediately.
|
|
175
175
|
|
|
176
176
|
### Examples
|
|
177
177
|
|
|
@@ -469,7 +469,7 @@ end
|
|
|
469
469
|
|
|
470
470
|
List commented posts
|
|
471
471
|
|
|
472
|
-
Returns posts with comment counts from all connected accounts. Aggregates data across multiple accounts. For users with the Ads add-on (Metronome plans always qualify), the user's Meta ads (boosted/dark posts) are included too. There's one row per (ad, placement-with-comments): an ad that runs on both Facebook feed and Instagram feed produces up to two rows (the Page dark post and the IG media have separate comment threads), each flagged `isAd: true` with `adId` and `placement` (`id` is `{adId}:{placement}`). Use `?platform=metaads` to return *only* ad rows; passing `facebook`/`instagram` returns *organic* posts only (no ads); omitting `platform` returns both. Fetch a row's thread from GET /v1/ads/{adId}/comments?placement={placement}. Ad comment counts are read with the Marketing API token (Facebook side) or the connected Instagram account's token (Instagram side); a row whose count can't be read is omitted. Pagination walks each account's platform listing. Following `nextCursor` reaches past the first page on Facebook, Instagram, Threads, LinkedIn and YouTube, since they are the platforms that support a server-side date window; on the others the listing stops at its first page. Cursor pagination is only coherent for the default sort (`sortBy=date`, `sortOrder=desc`): with `sortOrder=asc`, or with `sortBy=comments`, the cursor filter does not match the sort order and the second page is unreliable. `nextCursor` is opaque: pass it back verbatim, never construct or parse it, its composition may change without notice. Because each page re-queries a live window, results can still shift between requests, so dedupe by `id` on the client. `commentCount` semantics differ by platform: YouTube's includes replies, Facebook's counts top-level comments only.
|
|
472
|
+
Returns posts with comment counts from all connected accounts. Aggregates data across multiple accounts. Responses are cached for up to 10 minutes, so the feed may lag new comments by that window. Do not poll this endpoint for real-time updates: subscribe to the `comment.received` webhook, which fires for every new comment across your posts and carries the post reference needed to keep this list current. For users with the Ads add-on (Metronome plans always qualify), the user's Meta ads (boosted/dark posts) are included too. There's one row per (ad, placement-with-comments): an ad that runs on both Facebook feed and Instagram feed produces up to two rows (the Page dark post and the IG media have separate comment threads), each flagged `isAd: true` with `adId` and `placement` (`id` is `{adId}:{placement}`). Use `?platform=metaads` to return *only* ad rows; passing `facebook`/`instagram` returns *organic* posts only (no ads); omitting `platform` returns both. Fetch a row's thread from GET /v1/ads/{adId}/comments?placement={placement}. Ad comment counts are read with the Marketing API token (Facebook side) or the connected Instagram account's token (Instagram side); a row whose count can't be read is omitted. Pagination walks each account's platform listing. Following `nextCursor` reaches past the first page on Facebook, Instagram, Threads, LinkedIn and YouTube, since they are the platforms that support a server-side date window; on the others the listing stops at its first page. Cursor pagination is only coherent for the default sort (`sortBy=date`, `sortOrder=desc`): with `sortOrder=asc`, or with `sortBy=comments`, the cursor filter does not match the sort order and the second page is unreliable. `nextCursor` is opaque: pass it back verbatim, never construct or parse it, its composition may change without notice. Because each page re-queries a live window, results can still shift between requests, so dedupe by `id` on the client. `commentCount` semantics differ by platform: YouTube's includes replies, Facebook's counts top-level comments only.
|
|
473
473
|
|
|
474
474
|
### Examples
|
|
475
475
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Zernio::DeleteAdVideo200Response
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **ad_account_id** | **String** | | [optional] |
|
|
8
|
+
| **video_id** | **String** | | [optional] |
|
|
9
|
+
| **success** | **Boolean** | | [optional] |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'zernio-sdk'
|
|
15
|
+
|
|
16
|
+
instance = Zernio::DeleteAdVideo200Response.new(
|
|
17
|
+
ad_account_id: null,
|
|
18
|
+
video_id: null,
|
|
19
|
+
success: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zernio::UploadAdVideo201Response
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **ad_account_id** | **String** | | [optional] |
|
|
8
|
+
| **video** | [**UploadAdVideo201ResponseVideo**](UploadAdVideo201ResponseVideo.md) | | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zernio-sdk'
|
|
14
|
+
|
|
15
|
+
instance = Zernio::UploadAdVideo201Response.new(
|
|
16
|
+
ad_account_id: null,
|
|
17
|
+
video: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zernio::UploadAdVideo201ResponseVideo
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | Meta video id, reusable as video.id on POST /v1/ads/create and inside POST /v1/ads/preview creativeSpec. | [optional] |
|
|
8
|
+
| **thumbnail_url** | **String** | Meta-hosted poster URL if available; null when Meta has not produced a poster yet. | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zernio-sdk'
|
|
14
|
+
|
|
15
|
+
instance = Zernio::UploadAdVideo201ResponseVideo.new(
|
|
16
|
+
id: null,
|
|
17
|
+
thumbnail_url: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Zernio::UploadAdVideoRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **account_id** | **String** | Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token. | |
|
|
8
|
+
| **ad_account_id** | **String** | Meta ad account id (act_<n>). | |
|
|
9
|
+
| **video_url** | **String** | Public https URL of the video; downloaded server-side (SSRF-guarded) before chunked upload. Provide exactly one of videoUrl or videoBase64. | [optional] |
|
|
10
|
+
| **video_base64** | **String** | Raw base64 video bytes, or a full data URL (the data:video/...;base64, prefix is stripped). Capped by Vercel's body limit (~4.5 MB payload). Provide exactly one of videoUrl or videoBase64. | [optional] |
|
|
11
|
+
| **filename** | **String** | Optional filename shown alongside the upload session. Applied only when uploading via videoBase64. | [optional] |
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require 'zernio-sdk'
|
|
17
|
+
|
|
18
|
+
instance = Zernio::UploadAdVideoRequest.new(
|
|
19
|
+
account_id: null,
|
|
20
|
+
ad_account_id: null,
|
|
21
|
+
video_url: null,
|
|
22
|
+
video_base64: null,
|
|
23
|
+
filename: null
|
|
24
|
+
)
|
|
25
|
+
```
|
|
26
|
+
|
|
@@ -157,6 +157,83 @@ module Zernio
|
|
|
157
157
|
return data, status_code, headers
|
|
158
158
|
end
|
|
159
159
|
|
|
160
|
+
# Delete an ad video
|
|
161
|
+
# Removes a video from the ad account's video library. Meta's canonical `DELETE /{video_id}` fails with code 10 / subcode 1363055 for videos uploaded via `/act_X/advideos` even with `ads_management`; this endpoint uses the working account-scoped shape `DELETE /act_X/advideos?video_id=<id>` and returns Meta's `{success: true}` verbatim. Deleting a video that lives in a different ad account, or that Meta has already removed, returns Meta's error verbatim as a 4xx.
|
|
162
|
+
# @param video_id [String] Meta ad video id (numeric).
|
|
163
|
+
# @param account_id [String] Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
164
|
+
# @param ad_account_id [String] Meta ad account id (act_<n>) that owns the video.
|
|
165
|
+
# @param [Hash] opts the optional parameters
|
|
166
|
+
# @return [DeleteAdVideo200Response]
|
|
167
|
+
def delete_ad_video(video_id, account_id, ad_account_id, opts = {})
|
|
168
|
+
data, _status_code, _headers = delete_ad_video_with_http_info(video_id, account_id, ad_account_id, opts)
|
|
169
|
+
data
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Delete an ad video
|
|
173
|
+
# Removes a video from the ad account's video library. Meta's canonical `DELETE /{video_id}` fails with code 10 / subcode 1363055 for videos uploaded via `/act_X/advideos` even with `ads_management`; this endpoint uses the working account-scoped shape `DELETE /act_X/advideos?video_id=<id>` and returns Meta's `{success: true}` verbatim. Deleting a video that lives in a different ad account, or that Meta has already removed, returns Meta's error verbatim as a 4xx.
|
|
174
|
+
# @param video_id [String] Meta ad video id (numeric).
|
|
175
|
+
# @param account_id [String] Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
176
|
+
# @param ad_account_id [String] Meta ad account id (act_<n>) that owns the video.
|
|
177
|
+
# @param [Hash] opts the optional parameters
|
|
178
|
+
# @return [Array<(DeleteAdVideo200Response, Integer, Hash)>] DeleteAdVideo200Response data, response status code and response headers
|
|
179
|
+
def delete_ad_video_with_http_info(video_id, account_id, ad_account_id, opts = {})
|
|
180
|
+
if @api_client.config.debugging
|
|
181
|
+
@api_client.config.logger.debug 'Calling API: AdCreativesApi.delete_ad_video ...'
|
|
182
|
+
end
|
|
183
|
+
# verify the required parameter 'video_id' is set
|
|
184
|
+
if @api_client.config.client_side_validation && video_id.nil?
|
|
185
|
+
fail ArgumentError, "Missing the required parameter 'video_id' when calling AdCreativesApi.delete_ad_video"
|
|
186
|
+
end
|
|
187
|
+
# verify the required parameter 'account_id' is set
|
|
188
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
189
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AdCreativesApi.delete_ad_video"
|
|
190
|
+
end
|
|
191
|
+
# verify the required parameter 'ad_account_id' is set
|
|
192
|
+
if @api_client.config.client_side_validation && ad_account_id.nil?
|
|
193
|
+
fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdCreativesApi.delete_ad_video"
|
|
194
|
+
end
|
|
195
|
+
# resource path
|
|
196
|
+
local_var_path = '/v1/ads/videos/{videoId}'.sub('{' + 'videoId' + '}', CGI.escape(video_id.to_s))
|
|
197
|
+
|
|
198
|
+
# query parameters
|
|
199
|
+
query_params = opts[:query_params] || {}
|
|
200
|
+
query_params[:'accountId'] = account_id
|
|
201
|
+
query_params[:'adAccountId'] = ad_account_id
|
|
202
|
+
|
|
203
|
+
# header parameters
|
|
204
|
+
header_params = opts[:header_params] || {}
|
|
205
|
+
# HTTP header 'Accept' (if needed)
|
|
206
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
207
|
+
|
|
208
|
+
# form parameters
|
|
209
|
+
form_params = opts[:form_params] || {}
|
|
210
|
+
|
|
211
|
+
# http body (model)
|
|
212
|
+
post_body = opts[:debug_body]
|
|
213
|
+
|
|
214
|
+
# return_type
|
|
215
|
+
return_type = opts[:debug_return_type] || 'DeleteAdVideo200Response'
|
|
216
|
+
|
|
217
|
+
# auth_names
|
|
218
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
219
|
+
|
|
220
|
+
new_options = opts.merge(
|
|
221
|
+
:operation => :"AdCreativesApi.delete_ad_video",
|
|
222
|
+
:header_params => header_params,
|
|
223
|
+
:query_params => query_params,
|
|
224
|
+
:form_params => form_params,
|
|
225
|
+
:body => post_body,
|
|
226
|
+
:auth_names => auth_names,
|
|
227
|
+
:return_type => return_type
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
231
|
+
if @api_client.config.debugging
|
|
232
|
+
@api_client.config.logger.debug "API called: AdCreativesApi#delete_ad_video\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
233
|
+
end
|
|
234
|
+
return data, status_code, headers
|
|
235
|
+
end
|
|
236
|
+
|
|
160
237
|
# Render pre-create ad previews
|
|
161
238
|
# Renders how a creative would look per placement BEFORE any ad exists, via Meta's `/generatepreviews`. Provide exactly one creative source: `existingCreativeId` or `creativeSpec`. Each preview is an HTML `<iframe>` snippet embeddable directly. Unknown `formats` values return Meta's 400 verbatim.
|
|
162
239
|
# @param generate_ad_previews_request [GenerateAdPreviewsRequest]
|
|
@@ -682,7 +759,7 @@ module Zernio
|
|
|
682
759
|
end
|
|
683
760
|
|
|
684
761
|
# Ad video library
|
|
685
|
-
# Lists the ad account's video library (Meta's `/act_X/advideos`), rows returned verbatim. The default projection covers id, title, status, poster frames and length; `fields` is a raw-passthrough override. Any `id` here is reusable as `video.id` on the create endpoints, so N ads that differ only in copy share one upload. This is the only way to reach a video uploaded OUTSIDE Zernio (Ads Manager, another tool); videos we uploaded also come back as `creative.videoId` on GET /v1/ads. Meta transcodes asynchronously, so a row is only usable once `status.video_status` reads `ready`.
|
|
762
|
+
# Lists the ad account's video library (Meta's `/act_X/advideos`), rows returned verbatim. The default projection covers id, title, status, poster frames and length; `fields` is a raw-passthrough override. Any `id` here is reusable as `video.id` on the create endpoints, so N ads that differ only in copy share one upload. This is the only way to reach a video uploaded OUTSIDE Zernio (Ads Manager, another tool); videos we uploaded also come back as `creative.videoId` on GET /v1/ads. Meta transcodes asynchronously, so a row is only usable once `status.video_status` reads `ready`. Upload a new video via POST /v1/ads/videos, or inline via `video.url` on POST /v1/ads/create.
|
|
686
763
|
# @param account_id [String] Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
687
764
|
# @param ad_account_id [String] Meta ad account id (act_<n>).
|
|
688
765
|
# @param [Hash] opts the optional parameters
|
|
@@ -696,7 +773,7 @@ module Zernio
|
|
|
696
773
|
end
|
|
697
774
|
|
|
698
775
|
# Ad video library
|
|
699
|
-
# Lists the ad account's video library (Meta's `/act_X/advideos`), rows returned verbatim. The default projection covers id, title, status, poster frames and length; `fields` is a raw-passthrough override. Any `id` here is reusable as `video.id` on the create endpoints, so N ads that differ only in copy share one upload. This is the only way to reach a video uploaded OUTSIDE Zernio (Ads Manager, another tool); videos we uploaded also come back as `creative.videoId` on GET /v1/ads. Meta transcodes asynchronously, so a row is only usable once `status.video_status` reads `ready`.
|
|
776
|
+
# Lists the ad account's video library (Meta's `/act_X/advideos`), rows returned verbatim. The default projection covers id, title, status, poster frames and length; `fields` is a raw-passthrough override. Any `id` here is reusable as `video.id` on the create endpoints, so N ads that differ only in copy share one upload. This is the only way to reach a video uploaded OUTSIDE Zernio (Ads Manager, another tool); videos we uploaded also come back as `creative.videoId` on GET /v1/ads. Meta transcodes asynchronously, so a row is only usable once `status.video_status` reads `ready`. Upload a new video via POST /v1/ads/videos, or inline via `video.url` on POST /v1/ads/create.
|
|
700
777
|
# @param account_id [String] Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
701
778
|
# @param ad_account_id [String] Meta ad account id (act_<n>).
|
|
702
779
|
# @param [Hash] opts the optional parameters
|
|
@@ -910,5 +987,73 @@ module Zernio
|
|
|
910
987
|
end
|
|
911
988
|
return data, status_code, headers
|
|
912
989
|
end
|
|
990
|
+
|
|
991
|
+
# Upload an ad video
|
|
992
|
+
# Standalone ad-video upload (parallel to POST /v1/ads/images), so a video creative can be rendered via POST /v1/ads/preview or attached via `video.id` on POST /v1/ads/create before an ad exists. Accepts either an https `videoUrl` we download server-side (SSRF-guarded) or raw `videoBase64` bytes; exactly one is required. `videoBase64` is capped by Vercel's body limit — around 4.5 MB payload in practice, so larger videos must come via `videoUrl`. Returns the Meta `video.id` (reusable wherever `video.id` is accepted) plus Meta's auto-generated poster URL when available. The endpoint waits until Meta reports the video ready (chunked upload + transcode can take minutes; the handler runs up to 800 s).
|
|
993
|
+
# @param upload_ad_video_request [UploadAdVideoRequest]
|
|
994
|
+
# @param [Hash] opts the optional parameters
|
|
995
|
+
# @return [UploadAdVideo201Response]
|
|
996
|
+
def upload_ad_video(upload_ad_video_request, opts = {})
|
|
997
|
+
data, _status_code, _headers = upload_ad_video_with_http_info(upload_ad_video_request, opts)
|
|
998
|
+
data
|
|
999
|
+
end
|
|
1000
|
+
|
|
1001
|
+
# Upload an ad video
|
|
1002
|
+
# Standalone ad-video upload (parallel to POST /v1/ads/images), so a video creative can be rendered via POST /v1/ads/preview or attached via `video.id` on POST /v1/ads/create before an ad exists. Accepts either an https `videoUrl` we download server-side (SSRF-guarded) or raw `videoBase64` bytes; exactly one is required. `videoBase64` is capped by Vercel's body limit — around 4.5 MB payload in practice, so larger videos must come via `videoUrl`. Returns the Meta `video.id` (reusable wherever `video.id` is accepted) plus Meta's auto-generated poster URL when available. The endpoint waits until Meta reports the video ready (chunked upload + transcode can take minutes; the handler runs up to 800 s).
|
|
1003
|
+
# @param upload_ad_video_request [UploadAdVideoRequest]
|
|
1004
|
+
# @param [Hash] opts the optional parameters
|
|
1005
|
+
# @return [Array<(UploadAdVideo201Response, Integer, Hash)>] UploadAdVideo201Response data, response status code and response headers
|
|
1006
|
+
def upload_ad_video_with_http_info(upload_ad_video_request, opts = {})
|
|
1007
|
+
if @api_client.config.debugging
|
|
1008
|
+
@api_client.config.logger.debug 'Calling API: AdCreativesApi.upload_ad_video ...'
|
|
1009
|
+
end
|
|
1010
|
+
# verify the required parameter 'upload_ad_video_request' is set
|
|
1011
|
+
if @api_client.config.client_side_validation && upload_ad_video_request.nil?
|
|
1012
|
+
fail ArgumentError, "Missing the required parameter 'upload_ad_video_request' when calling AdCreativesApi.upload_ad_video"
|
|
1013
|
+
end
|
|
1014
|
+
# resource path
|
|
1015
|
+
local_var_path = '/v1/ads/videos'
|
|
1016
|
+
|
|
1017
|
+
# query parameters
|
|
1018
|
+
query_params = opts[:query_params] || {}
|
|
1019
|
+
|
|
1020
|
+
# header parameters
|
|
1021
|
+
header_params = opts[:header_params] || {}
|
|
1022
|
+
# HTTP header 'Accept' (if needed)
|
|
1023
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1024
|
+
# HTTP header 'Content-Type'
|
|
1025
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
1026
|
+
if !content_type.nil?
|
|
1027
|
+
header_params['Content-Type'] = content_type
|
|
1028
|
+
end
|
|
1029
|
+
|
|
1030
|
+
# form parameters
|
|
1031
|
+
form_params = opts[:form_params] || {}
|
|
1032
|
+
|
|
1033
|
+
# http body (model)
|
|
1034
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(upload_ad_video_request)
|
|
1035
|
+
|
|
1036
|
+
# return_type
|
|
1037
|
+
return_type = opts[:debug_return_type] || 'UploadAdVideo201Response'
|
|
1038
|
+
|
|
1039
|
+
# auth_names
|
|
1040
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
1041
|
+
|
|
1042
|
+
new_options = opts.merge(
|
|
1043
|
+
:operation => :"AdCreativesApi.upload_ad_video",
|
|
1044
|
+
:header_params => header_params,
|
|
1045
|
+
:query_params => query_params,
|
|
1046
|
+
:form_params => form_params,
|
|
1047
|
+
:body => post_body,
|
|
1048
|
+
:auth_names => auth_names,
|
|
1049
|
+
:return_type => return_type
|
|
1050
|
+
)
|
|
1051
|
+
|
|
1052
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
1053
|
+
if @api_client.config.debugging
|
|
1054
|
+
@api_client.config.logger.debug "API called: AdCreativesApi#upload_ad_video\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1055
|
+
end
|
|
1056
|
+
return data, status_code, headers
|
|
1057
|
+
end
|
|
913
1058
|
end
|
|
914
1059
|
end
|
|
@@ -177,7 +177,7 @@ module Zernio
|
|
|
177
177
|
end
|
|
178
178
|
|
|
179
179
|
# Get post comments
|
|
180
|
-
# Fetch comments for a specific post. Requires accountId query parameter. On Facebook and Instagram, passing a COMMENT id as `postId` is also supported and returns that comment's replies instead of the post's top-level comments. This is not available on YouTube, where `postId` must be a video id.
|
|
180
|
+
# Fetch comments for a specific post. Requires accountId query parameter. On Facebook and Instagram, passing a COMMENT id as `postId` is also supported and returns that comment's replies instead of the post's top-level comments. This is not available on YouTube, where `postId` must be a video id. Responses are cached for up to 10 minutes, so a page may lag new comments by that window. Do not poll this endpoint for real-time updates: subscribe to the `comment.received` webhook, which delivers new comments as they arrive. Your own writes (creating, replying to, or deleting a comment) refresh the cache immediately.
|
|
181
181
|
# @param post_id [String] Zernio post ID or platform-specific post ID. Zernio IDs are auto-resolved. LinkedIn third-party posts accept full activity URN or numeric ID. On Facebook and Instagram, a comment ID is also accepted here and returns that comment's replies.
|
|
182
182
|
# @param account_id [String]
|
|
183
183
|
# @param [Hash] opts the optional parameters
|
|
@@ -192,7 +192,7 @@ module Zernio
|
|
|
192
192
|
end
|
|
193
193
|
|
|
194
194
|
# Get post comments
|
|
195
|
-
# Fetch comments for a specific post. Requires accountId query parameter. On Facebook and Instagram, passing a COMMENT id as `postId` is also supported and returns that comment's replies instead of the post's top-level comments. This is not available on YouTube, where `postId` must be a video id.
|
|
195
|
+
# Fetch comments for a specific post. Requires accountId query parameter. On Facebook and Instagram, passing a COMMENT id as `postId` is also supported and returns that comment's replies instead of the post's top-level comments. This is not available on YouTube, where `postId` must be a video id. Responses are cached for up to 10 minutes, so a page may lag new comments by that window. Do not poll this endpoint for real-time updates: subscribe to the `comment.received` webhook, which delivers new comments as they arrive. Your own writes (creating, replying to, or deleting a comment) refresh the cache immediately.
|
|
196
196
|
# @param post_id [String] Zernio post ID or platform-specific post ID. Zernio IDs are auto-resolved. LinkedIn third-party posts accept full activity URN or numeric ID. On Facebook and Instagram, a comment ID is also accepted here and returns that comment's replies.
|
|
197
197
|
# @param account_id [String]
|
|
198
198
|
# @param [Hash] opts the optional parameters
|
|
@@ -501,7 +501,7 @@ module Zernio
|
|
|
501
501
|
end
|
|
502
502
|
|
|
503
503
|
# List commented posts
|
|
504
|
-
# Returns posts with comment counts from all connected accounts. Aggregates data across multiple accounts. For users with the Ads add-on (Metronome plans always qualify), the user's Meta ads (boosted/dark posts) are included too. There's one row per (ad, placement-with-comments): an ad that runs on both Facebook feed and Instagram feed produces up to two rows (the Page dark post and the IG media have separate comment threads), each flagged `isAd: true` with `adId` and `placement` (`id` is `{adId}:{placement}`). Use `?platform=metaads` to return *only* ad rows; passing `facebook`/`instagram` returns *organic* posts only (no ads); omitting `platform` returns both. Fetch a row's thread from GET /v1/ads/{adId}/comments?placement={placement}. Ad comment counts are read with the Marketing API token (Facebook side) or the connected Instagram account's token (Instagram side); a row whose count can't be read is omitted. Pagination walks each account's platform listing. Following `nextCursor` reaches past the first page on Facebook, Instagram, Threads, LinkedIn and YouTube, since they are the platforms that support a server-side date window; on the others the listing stops at its first page. Cursor pagination is only coherent for the default sort (`sortBy=date`, `sortOrder=desc`): with `sortOrder=asc`, or with `sortBy=comments`, the cursor filter does not match the sort order and the second page is unreliable. `nextCursor` is opaque: pass it back verbatim, never construct or parse it, its composition may change without notice. Because each page re-queries a live window, results can still shift between requests, so dedupe by `id` on the client. `commentCount` semantics differ by platform: YouTube's includes replies, Facebook's counts top-level comments only.
|
|
504
|
+
# Returns posts with comment counts from all connected accounts. Aggregates data across multiple accounts. Responses are cached for up to 10 minutes, so the feed may lag new comments by that window. Do not poll this endpoint for real-time updates: subscribe to the `comment.received` webhook, which fires for every new comment across your posts and carries the post reference needed to keep this list current. For users with the Ads add-on (Metronome plans always qualify), the user's Meta ads (boosted/dark posts) are included too. There's one row per (ad, placement-with-comments): an ad that runs on both Facebook feed and Instagram feed produces up to two rows (the Page dark post and the IG media have separate comment threads), each flagged `isAd: true` with `adId` and `placement` (`id` is `{adId}:{placement}`). Use `?platform=metaads` to return *only* ad rows; passing `facebook`/`instagram` returns *organic* posts only (no ads); omitting `platform` returns both. Fetch a row's thread from GET /v1/ads/{adId}/comments?placement={placement}. Ad comment counts are read with the Marketing API token (Facebook side) or the connected Instagram account's token (Instagram side); a row whose count can't be read is omitted. Pagination walks each account's platform listing. Following `nextCursor` reaches past the first page on Facebook, Instagram, Threads, LinkedIn and YouTube, since they are the platforms that support a server-side date window; on the others the listing stops at its first page. Cursor pagination is only coherent for the default sort (`sortBy=date`, `sortOrder=desc`): with `sortOrder=asc`, or with `sortBy=comments`, the cursor filter does not match the sort order and the second page is unreliable. `nextCursor` is opaque: pass it back verbatim, never construct or parse it, its composition may change without notice. Because each page re-queries a live window, results can still shift between requests, so dedupe by `id` on the client. `commentCount` semantics differ by platform: YouTube's includes replies, Facebook's counts top-level comments only.
|
|
505
505
|
# @param [Hash] opts the optional parameters
|
|
506
506
|
# @option opts [String] :profile_id Filter by profile ID
|
|
507
507
|
# @option opts [String] :platform Filter by platform. `metaads` is a synthetic value meaning the user's ads (boosted/dark posts) only; `facebook`/`instagram` return organic posts only.
|
|
@@ -519,7 +519,7 @@ module Zernio
|
|
|
519
519
|
end
|
|
520
520
|
|
|
521
521
|
# List commented posts
|
|
522
|
-
# Returns posts with comment counts from all connected accounts. Aggregates data across multiple accounts. For users with the Ads add-on (Metronome plans always qualify), the user's Meta ads (boosted/dark posts) are included too. There's one row per (ad, placement-with-comments): an ad that runs on both Facebook feed and Instagram feed produces up to two rows (the Page dark post and the IG media have separate comment threads), each flagged `isAd: true` with `adId` and `placement` (`id` is `{adId}:{placement}`). Use `?platform=metaads` to return *only* ad rows; passing `facebook`/`instagram` returns *organic* posts only (no ads); omitting `platform` returns both. Fetch a row's thread from GET /v1/ads/{adId}/comments?placement={placement}. Ad comment counts are read with the Marketing API token (Facebook side) or the connected Instagram account's token (Instagram side); a row whose count can't be read is omitted. Pagination walks each account's platform listing. Following `nextCursor` reaches past the first page on Facebook, Instagram, Threads, LinkedIn and YouTube, since they are the platforms that support a server-side date window; on the others the listing stops at its first page. Cursor pagination is only coherent for the default sort (`sortBy=date`, `sortOrder=desc`): with `sortOrder=asc`, or with `sortBy=comments`, the cursor filter does not match the sort order and the second page is unreliable. `nextCursor` is opaque: pass it back verbatim, never construct or parse it, its composition may change without notice. Because each page re-queries a live window, results can still shift between requests, so dedupe by `id` on the client. `commentCount` semantics differ by platform: YouTube's includes replies, Facebook's counts top-level comments only.
|
|
522
|
+
# Returns posts with comment counts from all connected accounts. Aggregates data across multiple accounts. Responses are cached for up to 10 minutes, so the feed may lag new comments by that window. Do not poll this endpoint for real-time updates: subscribe to the `comment.received` webhook, which fires for every new comment across your posts and carries the post reference needed to keep this list current. For users with the Ads add-on (Metronome plans always qualify), the user's Meta ads (boosted/dark posts) are included too. There's one row per (ad, placement-with-comments): an ad that runs on both Facebook feed and Instagram feed produces up to two rows (the Page dark post and the IG media have separate comment threads), each flagged `isAd: true` with `adId` and `placement` (`id` is `{adId}:{placement}`). Use `?platform=metaads` to return *only* ad rows; passing `facebook`/`instagram` returns *organic* posts only (no ads); omitting `platform` returns both. Fetch a row's thread from GET /v1/ads/{adId}/comments?placement={placement}. Ad comment counts are read with the Marketing API token (Facebook side) or the connected Instagram account's token (Instagram side); a row whose count can't be read is omitted. Pagination walks each account's platform listing. Following `nextCursor` reaches past the first page on Facebook, Instagram, Threads, LinkedIn and YouTube, since they are the platforms that support a server-side date window; on the others the listing stops at its first page. Cursor pagination is only coherent for the default sort (`sortBy=date`, `sortOrder=desc`): with `sortOrder=asc`, or with `sortBy=comments`, the cursor filter does not match the sort order and the second page is unreliable. `nextCursor` is opaque: pass it back verbatim, never construct or parse it, its composition may change without notice. Because each page re-queries a live window, results can still shift between requests, so dedupe by `id` on the client. `commentCount` semantics differ by platform: YouTube's includes replies, Facebook's counts top-level comments only.
|
|
523
523
|
# @param [Hash] opts the optional parameters
|
|
524
524
|
# @option opts [String] :profile_id Filter by profile ID
|
|
525
525
|
# @option opts [String] :platform Filter by platform. `metaads` is a synthetic value meaning the user's ads (boosted/dark posts) only; `facebook`/`instagram` return organic posts only.
|