Class: Zernio::AdsApi
- Inherits:
-
Object
- Object
- Zernio::AdsApi
- Defined in:
- lib/zernio-sdk/api/ads_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#add_conversion_associations(account_id, destination_id, add_conversion_associations_request, opts = {}) ⇒ AddConversionAssociations200Response
Associate campaigns Associate one or more campaigns with this conversion rule.
-
#add_conversion_associations_with_http_info(account_id, destination_id, add_conversion_associations_request, opts = {}) ⇒ Array<(AddConversionAssociations200Response, Integer, Hash)>
Associate campaigns Associate one or more campaigns with this conversion rule.
-
#adjust_conversions(adjust_conversions_request, opts = {}) ⇒ AdjustConversions200Response
Adjust uploaded conversions Adjust conversions that were previously uploaded via
POST /v1/ads/conversions— retract them, restate their value, or enhance them with first-party data. -
#adjust_conversions_with_http_info(adjust_conversions_request, opts = {}) ⇒ Array<(AdjustConversions200Response, Integer, Hash)>
Adjust uploaded conversions Adjust conversions that were previously uploaded via `POST /v1/ads/conversions` — retract them, restate their value, or enhance them with first-party data.
-
#archive_lead_form(form_id, account_id, opts = {}) ⇒ ArchiveLeadForm200Response
Archive a lead form Meta has no hard delete for forms; this archives the form (status=ARCHIVED).
-
#archive_lead_form_with_http_info(form_id, account_id, opts = {}) ⇒ Array<(ArchiveLeadForm200Response, Integer, Hash)>
Archive a lead form Meta has no hard delete for forms; this archives the form (status=ARCHIVED).
-
#boost_post(boost_post_request, opts = {}) ⇒ UpdateAd200Response
Boost post as ad Creates a paid ad campaign from an existing published post.
-
#boost_post_with_http_info(boost_post_request, opts = {}) ⇒ Array<(UpdateAd200Response, Integer, Hash)>
Boost post as ad Creates a paid ad campaign from an existing published post.
-
#cancel_rf_reservation(prediction_id, account_id, ad_account_id, opts = {}) ⇒ nil
Cancel a Reach & Frequency reservation (Meta) Releases a RESERVATION's locked price and inventory.
-
#cancel_rf_reservation_with_http_info(prediction_id, account_id, ad_account_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Cancel a Reach & Frequency reservation (Meta) Releases a RESERVATION's locked price and inventory.
-
#create_ad_creative(create_ad_creative_request, opts = {}) ⇒ CreateAdCreative201Response
Create a standalone creative (Meta) Creates a creative in the library WITHOUT an ad, reusable on the create endpoints via
existingCreativeId. -
#create_ad_creative_with_http_info(create_ad_creative_request, opts = {}) ⇒ Array<(CreateAdCreative201Response, Integer, Hash)>
Create a standalone creative (Meta) Creates a creative in the library WITHOUT an ad, reusable on the create endpoints via `existingCreativeId`.
-
#create_ad_insights_report(create_ad_insights_report_request, opts = {}) ⇒ CreateAdInsightsReport202Response
Submit an async insights report run (Meta) Submits an asynchronous Meta insights report.
-
#create_ad_insights_report_with_http_info(create_ad_insights_report_request, opts = {}) ⇒ Array<(CreateAdInsightsReport202Response, Integer, Hash)>
Submit an async insights report run (Meta) Submits an asynchronous Meta insights report.
-
#create_call_ad(create_call_ad_request, opts = {}) ⇒ nil
Create Click-to-Call ad Same shape and flow as POST /v1/ads/ctwa, but the CTA is CALL_NOW dialing
phoneNumbervia a tel: link. -
#create_call_ad_with_http_info(create_call_ad_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create Click-to-Call ad Same shape and flow as POST /v1/ads/ctwa, but the CTA is CALL_NOW dialing `phoneNumber` via a tel: link.
-
#create_conversion_destination(account_id, create_conversion_destination_request, opts = {}) ⇒ CreateConversionDestination201Response
Create a conversion destination Create a new conversion destination on the platform.
-
#create_conversion_destination_with_http_info(account_id, create_conversion_destination_request, opts = {}) ⇒ Array<(CreateConversionDestination201Response, Integer, Hash)>
Create a conversion destination Create a new conversion destination on the platform.
-
#create_ctwa_ad(ctwa_ad_request_body, opts = {}) ⇒ CreateCtwaAd201Response
Create Click-to-WhatsApp ad (deprecated) Deprecated: use POST /v1/ads/messaging with
destination: whatsapp. -
#create_ctwa_ad_with_http_info(ctwa_ad_request_body, opts = {}) ⇒ Array<(CreateCtwaAd201Response, Integer, Hash)>
Create Click-to-WhatsApp ad (deprecated) Deprecated: use POST /v1/ads/messaging with `destination: whatsapp`.
-
#create_lead_form(create_lead_form_request, opts = {}) ⇒ CreateLeadForm200Response
Create a lead form Creates a Lead Gen form on the connected Facebook Page (POST /page-id/leadgen_forms).
-
#create_lead_form_with_http_info(create_lead_form_request, opts = {}) ⇒ Array<(CreateLeadForm200Response, Integer, Hash)>
Create a lead form Creates a Lead Gen form on the connected Facebook Page (POST /page-id/leadgen_forms).
-
#create_messaging_ad(create_messaging_ad_request, opts = {}) ⇒ nil
Create click-to-message ad (WhatsApp / Messenger / Instagram Direct) Creates a click-to-message ad;
destinationselects where the tapped ad opens a conversation: WhatsApp, the Page's Messenger inbox or the linked Instagram account's Direct inbox. -
#create_messaging_ad_with_http_info(create_messaging_ad_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create click-to-message ad (WhatsApp / Messenger / Instagram Direct) Creates a click-to-message ad; `destination` selects where the tapped ad opens a conversation: WhatsApp, the Page's Messenger inbox or the linked Instagram account's Direct inbox.
-
#create_rf_prediction(create_rf_prediction_request, opts = {}) ⇒ CreateRfPrediction201Response
Create a Reach & Frequency prediction (Meta) Creates an R&F prediction — a QUOTE, nothing is bought and no ad entities are created.
-
#create_rf_prediction_with_http_info(create_rf_prediction_request, opts = {}) ⇒ Array<(CreateRfPrediction201Response, Integer, Hash)>
Create a Reach & Frequency prediction (Meta) Creates an R&F prediction — a QUOTE, nothing is bought and no ad entities are created.
-
#create_standalone_ad(create_standalone_ad_request, opts = {}) ⇒ CreateStandaloneAd201Response
Create standalone ad Creates a paid ad with custom creative across Meta, Google Ads, Pinterest, TikTok, X/Twitter, and LinkedIn.
-
#create_standalone_ad_with_http_info(create_standalone_ad_request, opts = {}) ⇒ Array<(CreateStandaloneAd201Response, Integer, Hash)>
Create standalone ad Creates a paid ad with custom creative across Meta, Google Ads, Pinterest, TikTok, X/Twitter, and LinkedIn.
-
#create_test_lead(form_id, create_test_lead_request, opts = {}) ⇒ CreateTestLead200Response
Create a test lead Submits a test lead against the form (POST /form-id/test_leads) to exercise retrieval without waiting for real ad impressions.
-
#create_test_lead_with_http_info(form_id, create_test_lead_request, opts = {}) ⇒ Array<(CreateTestLead200Response, Integer, Hash)>
Create a test lead Submits a test lead against the form (POST /form-id/test_leads) to exercise retrieval without waiting for real ad impressions.
-
#delete_ad(ad_id, opts = {}) ⇒ DeleteAccountGroup200Response
Cancel an ad Cancels the ad on the platform and marks it as cancelled in the database.
-
#delete_ad_creative(creative_id, account_id, opts = {}) ⇒ DeleteAdCreative200Response
Delete a creative (Meta) Deletes a creative from the library.
-
#delete_ad_creative_with_http_info(creative_id, account_id, opts = {}) ⇒ Array<(DeleteAdCreative200Response, Integer, Hash)>
Delete a creative (Meta) Deletes a creative from the library.
-
#delete_ad_with_http_info(ad_id, opts = {}) ⇒ Array<(DeleteAccountGroup200Response, Integer, Hash)>
Cancel an ad Cancels the ad on the platform and marks it as cancelled in the database.
-
#delete_conversion_destination(account_id, destination_id, opts = {}) ⇒ nil
Delete a conversion destination LinkedIn-only today.
-
#delete_conversion_destination_with_http_info(account_id, destination_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete a conversion destination LinkedIn-only today.
-
#duplicate_ad(ad_id, opts = {}) ⇒ DuplicateAd200Response
Duplicate an ad (Meta) Duplicates a single ad via Meta's native
POST /{ad-id}/copies. -
#duplicate_ad_with_http_info(ad_id, opts = {}) ⇒ Array<(DuplicateAd200Response, Integer, Hash)>
Duplicate an ad (Meta) Duplicates a single ad via Meta's native `POST /ad-id/copies`.
-
#estimate_ad_reach(estimate_ad_reach_request, opts = {}) ⇒ EstimateAdReach200Response
Estimate audience reach Returns a normalized pre-flight audience-size estimate for a targeting spec, before any campaign is created.
-
#estimate_ad_reach_with_http_info(estimate_ad_reach_request, opts = {}) ⇒ Array<(EstimateAdReach200Response, Integer, Hash)>
Estimate audience reach Returns a normalized pre-flight audience-size estimate for a targeting spec, before any campaign is created.
-
#generate_ad_previews(generate_ad_previews_request, opts = {}) ⇒ GenerateAdPreviews200Response
Render pre-create ad previews (Meta) Renders how a creative would look per placement BEFORE any ad exists, via Meta's
/generatepreviews. -
#generate_ad_previews_with_http_info(generate_ad_previews_request, opts = {}) ⇒ Array<(GenerateAdPreviews200Response, Integer, Hash)>
Render pre-create ad previews (Meta) Renders how a creative would look per placement BEFORE any ad exists, via Meta's `/generatepreviews`.
-
#get_ad(ad_id, opts = {}) ⇒ GetAd200Response
Get ad details Returns an ad with its creative, targeting, status, and performance metrics.
-
#get_ad_account_finance(account_id, ad_account_id, opts = {}) ⇒ GetAdAccountFinance200Response
Ad account finances (Meta) Finances of one Meta ad account: prepaid
balance, lifetimeamountSpent, accountspendCap(null = no cap) and thefundingSource. -
#get_ad_account_finance_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(GetAdAccountFinance200Response, Integer, Hash)>
Ad account finances (Meta) Finances of one Meta ad account: prepaid `balance`, lifetime `amountSpent`, account `spendCap` (null = no cap) and the `fundingSource`.
-
#get_ad_analytics(ad_id, opts = {}) ⇒ GetAdAnalytics200Response
Get ad analytics Returns detailed performance analytics for an ad.
-
#get_ad_analytics_with_http_info(ad_id, opts = {}) ⇒ Array<(GetAdAnalytics200Response, Integer, Hash)>
Get ad analytics Returns detailed performance analytics for an ad.
-
#get_ad_comments(ad_id, opts = {}) ⇒ GetAdComments200Response
List comments on an ad Returns comments on an ad's underlying creative post.
-
#get_ad_comments_with_http_info(ad_id, opts = {}) ⇒ Array<(GetAdComments200Response, Integer, Hash)>
List comments on an ad Returns comments on an ad's underlying creative post.
-
#get_ad_creative(creative_id, account_id, opts = {}) ⇒ GetAdCreative200Response
Creative details (Meta) One creative's details, verbatim from Meta.
-
#get_ad_creative_with_http_info(creative_id, account_id, opts = {}) ⇒ Array<(GetAdCreative200Response, Integer, Hash)>
Creative details (Meta) One creative's details, verbatim from Meta.
-
#get_ad_insights_report(report_run_id, account_id, opts = {}) ⇒ GetAdInsightsReport200Response
Poll an async insights report run (Meta) Status and results for a report run created via POST /v1/ads/insights/reports.
-
#get_ad_insights_report_with_http_info(report_run_id, account_id, opts = {}) ⇒ Array<(GetAdInsightsReport200Response, Integer, Hash)>
Poll an async insights report run (Meta) Status and results for a report run created via POST /v1/ads/insights/reports.
-
#get_ad_previews(ad_id, opts = {}) ⇒ GetAdPreviews200Response
Render previews of an existing ad (Meta) Renders an EXISTING ad per placement via Meta's
/{ad_id}/previews. -
#get_ad_previews_with_http_info(ad_id, opts = {}) ⇒ Array<(GetAdPreviews200Response, Integer, Hash)>
Render previews of an existing ad (Meta) Renders an EXISTING ad per placement via Meta's `/ad_id/previews`.
-
#get_ad_tracking_tags(ad_id, opts = {}) ⇒ GetAdTrackingTags200Response
Get ad tracking tags Unified read of the platform's native click-URL tracking params.
-
#get_ad_tracking_tags_with_http_info(ad_id, opts = {}) ⇒ Array<(GetAdTrackingTags200Response, Integer, Hash)>
Get ad tracking tags Unified read of the platform's native click-URL tracking params.
-
#get_ad_with_http_info(ad_id, opts = {}) ⇒ Array<(GetAd200Response, Integer, Hash)>
Get ad details Returns an ad with its creative, targeting, status, and performance metrics.
-
#get_ads_activity_log(account_id, ad_account_id, opts = {}) ⇒ GetAdsActivityLog200Response
Ad account change / audit log (Meta) Account-level audit log from Meta's
/act_X/activities: who changed what and when (creates, edits, status flips, budget changes...) with Meta's translated event names and the structured before/after inextra_data. -
#get_ads_activity_log_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(GetAdsActivityLog200Response, Integer, Hash)>
Ad account change / audit log (Meta) Account-level audit log from Meta's `/act_X/activities`: who changed what and when (creates, edits, status flips, budget changes...) with Meta's translated event names and the structured before/after in `extra_data`.
-
#get_campaign_analytics(campaign_id, opts = {}) ⇒ GetCampaignAnalytics200Response
Get campaign analytics Returns performance analytics for a whole campaign in one call: summary metrics, a daily timeline over the requested date range (summed across the campaign's ads), and optional demographic breakdowns.
-
#get_campaign_analytics_with_http_info(campaign_id, opts = {}) ⇒ Array<(GetCampaignAnalytics200Response, Integer, Hash)>
Get campaign analytics Returns performance analytics for a whole campaign in one call: summary metrics, a daily timeline over the requested date range (summed across the campaign's ads), and optional demographic breakdowns.
-
#get_conversion_destination(account_id, destination_id, ad_account_id, opts = {}) ⇒ GetConversionDestination200Response
Get a conversion destination LinkedIn-only today.
-
#get_conversion_destination_with_http_info(account_id, destination_id, ad_account_id, opts = {}) ⇒ Array<(GetConversionDestination200Response, Integer, Hash)>
Get a conversion destination LinkedIn-only today.
-
#get_conversion_metrics(account_id, destination_id, ad_account_id, start_date, opts = {}) ⇒ GetConversionMetrics200Response
Get attribution metrics LinkedIn-only today.
-
#get_conversion_metrics_with_http_info(account_id, destination_id, ad_account_id, start_date, opts = {}) ⇒ Array<(GetConversionMetrics200Response, Integer, Hash)>
Get attribution metrics LinkedIn-only today.
-
#get_conversions_quality(account_id, destination_id, opts = {}) ⇒ GetConversionsQuality200Response
Get Event Match Quality Reads Meta Event Match Quality (EMQ) and pixel↔CAPI event coverage for a pixel/dataset, live from Meta's Dataset Quality API.
-
#get_conversions_quality_with_http_info(account_id, destination_id, opts = {}) ⇒ Array<(GetConversionsQuality200Response, Integer, Hash)>
Get Event Match Quality Reads Meta Event Match Quality (EMQ) and pixel↔CAPI event coverage for a pixel/dataset, live from Meta's Dataset Quality API.
-
#get_dsa_defaults(account_id, ad_account_id, opts = {}) ⇒ UpdateAdAccount200Response
Get ad account DSA defaults Returns the default DSA beneficiary and payor currently set on a Meta ad account, whether they were set via
PATCH /v1/ads/accountsor in Meta Ads Manager. -
#get_dsa_defaults_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(UpdateAdAccount200Response, Integer, Hash)>
Get ad account DSA defaults Returns the default DSA beneficiary and payor currently set on a Meta ad account, whether they were set via `PATCH /v1/ads/accounts` or in Meta Ads Manager.
-
#get_dsa_recommendations(account_id, ad_account_id, opts = {}) ⇒ GetDsaRecommendations200Response
List DSA beneficiary/payor suggestions Returns Meta's suggested beneficiary/payor names for an ad account, derived by Meta from the account's recent activity.
-
#get_dsa_recommendations_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(GetDsaRecommendations200Response, Integer, Hash)>
List DSA beneficiary/payor suggestions Returns Meta's suggested beneficiary/payor names for an ad account, derived by Meta from the account's recent activity.
-
#get_lead_form(form_id, account_id, opts = {}) ⇒ GetLeadForm200Response
Get a lead form.
-
#get_lead_form_with_http_info(form_id, account_id, opts = {}) ⇒ Array<(GetLeadForm200Response, Integer, Hash)>
Get a lead form.
-
#get_linked_in_bid_pricing(get_linked_in_bid_pricing_request, opts = {}) ⇒ GetLinkedInBidPricing200Response
Suggested bid and budget bounds (LinkedIn) LinkedIn-only.
-
#get_linked_in_bid_pricing_with_http_info(get_linked_in_bid_pricing_request, opts = {}) ⇒ Array<(GetLinkedInBidPricing200Response, Integer, Hash)>
Suggested bid and budget bounds (LinkedIn) LinkedIn-only.
-
#get_linked_in_supply_forecast(get_linked_in_supply_forecast_request, opts = {}) ⇒ GetLinkedInSupplyForecast200Response
Impressions, clicks and spend forecast (LinkedIn) LinkedIn-only.
-
#get_linked_in_supply_forecast_with_http_info(get_linked_in_supply_forecast_request, opts = {}) ⇒ Array<(GetLinkedInSupplyForecast200Response, Integer, Hash)>
Impressions, clicks and spend forecast (LinkedIn) LinkedIn-only.
-
#get_rf_prediction(prediction_id, account_id, ad_account_id, opts = {}) ⇒ CreateRfPrediction201Response
Read a Reach & Frequency prediction (Meta).
-
#get_rf_prediction_with_http_info(prediction_id, account_id, ad_account_id, opts = {}) ⇒ Array<(CreateRfPrediction201Response, Integer, Hash)>
Read a Reach & Frequency prediction (Meta).
-
#initialize(api_client = ApiClient.default) ⇒ AdsApi
constructor
A new instance of AdsApi.
-
#list_ad_accounts(account_id, opts = {}) ⇒ ListAdAccounts200Response
List ad accounts Returns the platform ad accounts available for the given social account (e.g. Meta ad accounts, TikTok advertiser IDs, Google Ads customer IDs).
-
#list_ad_accounts_with_http_info(account_id, opts = {}) ⇒ Array<(ListAdAccounts200Response, Integer, Hash)>
List ad accounts Returns the platform ad accounts available for the given social account (e.g. Meta ad accounts, TikTok advertiser IDs, Google Ads customer IDs).
-
#list_ad_catalog_product_sets(catalog_id, account_id, opts = {}) ⇒ ListAdCatalogProductSets200Response
List a catalog's product sets Lists a Meta product catalog's product sets — the unit a catalog ad promotes.
-
#list_ad_catalog_product_sets_with_http_info(catalog_id, account_id, opts = {}) ⇒ Array<(ListAdCatalogProductSets200Response, Integer, Hash)>
List a catalog's product sets Lists a Meta product catalog's product sets — the unit a catalog ad promotes.
-
#list_ad_catalogs(account_id, ad_account_id, opts = {}) ⇒ ListAdCatalogs200Response
List Meta product catalogs Lists the Meta product catalogs reachable from an ad account (owned + agency-shared catalogs of the ad account's business), for Advantage+ catalog ads (
goal: catalog_saleson POST /v1/ads/create — e.g. vehicle inventory catalogs). -
#list_ad_catalogs_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(ListAdCatalogs200Response, Integer, Hash)>
List Meta product catalogs Lists the Meta product catalogs reachable from an ad account (owned + agency-shared catalogs of the ad account's business), for Advantage+ catalog ads (`goal: catalog_sales` on POST /v1/ads/create — e.g. vehicle inventory catalogs).
-
#list_ad_creatives(account_id, ad_account_id, opts = {}) ⇒ ListAdCreatives200Response
Creative library (Meta) Lists the ad account's creative library (Meta's
/act_X/adcreatives), rows returned verbatim. -
#list_ad_creatives_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(ListAdCreatives200Response, Integer, Hash)>
Creative library (Meta) Lists the ad account's creative library (Meta's `/act_X/adcreatives`), rows returned verbatim.
-
#list_ad_images(account_id, ad_account_id, opts = {}) ⇒ ListAdImages200Response
Ad image library (Meta) Lists the ad account's image library (Meta's
/act_X/adimages), rows returned verbatim. -
#list_ad_images_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(ListAdImages200Response, Integer, Hash)>
Ad image library (Meta) Lists the ad account's image library (Meta's `/act_X/adimages`), rows returned verbatim.
-
#list_ad_labels(account_id, ad_account_id, opts = {}) ⇒ ListAdLabels200Response
Ad labels (Meta) Lists the ad account's organizational labels (Meta's
/act_X/adlabels), rows returned verbatim (id, name, created/updated time). -
#list_ad_labels_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(ListAdLabels200Response, Integer, Hash)>
Ad labels (Meta) Lists the ad account's organizational labels (Meta's `/act_X/adlabels`), rows returned verbatim (id, name, created/updated time).
-
#list_ad_studies(account_id, ad_account_id, opts = {}) ⇒ ListAdStudies200Response
A/B tests and lift studies (Meta) Lists the ad account's A/B tests and lift studies (Meta's
/act_X/ad_studies), rows returned verbatim. -
#list_ad_studies_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(ListAdStudies200Response, Integer, Hash)>
A/B tests and lift studies (Meta) Lists the ad account's A/B tests and lift studies (Meta's `/act_X/ad_studies`), rows returned verbatim.
-
#list_ads(opts = {}) ⇒ ListAds200Response
List ads Returns a paginated list of ads with metrics computed over an optional date range.
-
#list_ads_business_centers(account_id, opts = {}) ⇒ ListAdsBusinessCenters200Response
List TikTok Business Centers Returns the TikTok Business Centers (BCs) the connected
tiktokadsaccount can read. -
#list_ads_business_centers_with_http_info(account_id, opts = {}) ⇒ Array<(ListAdsBusinessCenters200Response, Integer, Hash)>
List TikTok Business Centers Returns the TikTok Business Centers (BCs) the connected `tiktokads` account can read.
-
#list_ads_with_http_info(opts = {}) ⇒ Array<(ListAds200Response, Integer, Hash)>
List ads Returns a paginated list of ads with metrics computed over an optional date range.
-
#list_conversion_associations(account_id, destination_id, ad_account_id, opts = {}) ⇒ ListConversionAssociations200Response
List associated campaigns LinkedIn-only today.
-
#list_conversion_associations_with_http_info(account_id, destination_id, ad_account_id, opts = {}) ⇒ Array<(ListConversionAssociations200Response, Integer, Hash)>
List associated campaigns LinkedIn-only today.
-
#list_conversion_destinations(account_id, opts = {}) ⇒ ListConversionDestinations200Response
List conversion destinations Returns the list of pixels (Meta), conversion actions (Google), or conversion rules (LinkedIn) accessible to the connected ads account.
-
#list_conversion_destinations_with_http_info(account_id, opts = {}) ⇒ Array<(ListConversionDestinations200Response, Integer, Hash)>
List conversion destinations Returns the list of pixels (Meta), conversion actions (Google), or conversion rules (LinkedIn) accessible to the connected ads account.
-
#list_form_leads(form_id, account_id, opts = {}) ⇒ ListFormLeads200Response
List leads for a single form Returns leads for one form.
-
#list_form_leads_with_http_info(form_id, account_id, opts = {}) ⇒ Array<(ListFormLeads200Response, Integer, Hash)>
List leads for a single form Returns leads for one form.
-
#list_high_demand_periods(account_id, opts = {}) ⇒ ListHighDemandPeriods200Response
High demand periods / budget schedules (Meta) Scheduled budget increases (Meta's budget-scheduling API).
-
#list_high_demand_periods_with_http_info(account_id, opts = {}) ⇒ Array<(ListHighDemandPeriods200Response, Integer, Hash)>
High demand periods / budget schedules (Meta) Scheduled budget increases (Meta's budget-scheduling API).
-
#list_lead_forms(account_id, opts = {}) ⇒ ListLeadForms200Response
List lead forms Lists the Lead Gen forms owned by the connected Facebook Page.
-
#list_lead_forms_with_http_info(account_id, opts = {}) ⇒ Array<(ListLeadForms200Response, Integer, Hash)>
List lead forms Lists the Lead Gen forms owned by the connected Facebook Page.
-
#list_leads(opts = {}) ⇒ ListLeads200Response
List submitted leads Returns persisted Meta Lead Gen leads for your team, newest-first, with keyset pagination on
cursor. -
#list_leads_with_http_info(opts = {}) ⇒ Array<(ListLeads200Response, Integer, Hash)>
List submitted leads Returns persisted Meta Lead Gen leads for your team, newest-first, with keyset pagination on `cursor`.
-
#list_whats_app_conversions(account_id, opts = {}) ⇒ ListWhatsAppConversions200Response
List conversion events Returns the most recent conversion events sent through
POST /v1/whatsapp/conversionsfor the given WhatsApp account. -
#list_whats_app_conversions_with_http_info(account_id, opts = {}) ⇒ Array<(ListWhatsAppConversions200Response, Integer, Hash)>
List conversion events Returns the most recent conversion events sent through `POST /v1/whatsapp/conversions` for the given WhatsApp account.
-
#query_ad_insights(account_id, object_id, opts = {}) ⇒ QueryAdInsights200Response
Flexible live insights query (Meta) Live, flexible insights query against Meta's Graph API.
-
#query_ad_insights_with_http_info(account_id, object_id, opts = {}) ⇒ Array<(QueryAdInsights200Response, Integer, Hash)>
Flexible live insights query (Meta) Live, flexible insights query against Meta's Graph API.
-
#remove_conversion_associations(account_id, destination_id, ad_account_id, campaign_ids, opts = {}) ⇒ RemoveConversionAssociations200Response
Remove associated campaigns Remove one or more campaign associations from this conversion rule.
-
#remove_conversion_associations_with_http_info(account_id, destination_id, ad_account_id, campaign_ids, opts = {}) ⇒ Array<(RemoveConversionAssociations200Response, Integer, Hash)>
Remove associated campaigns Remove one or more campaign associations from this conversion rule.
-
#reserve_rf_prediction(prediction_id, reserve_rf_prediction_request, opts = {}) ⇒ ReserveRfPrediction201Response
Reserve a Reach & Frequency prediction (Meta) Locks the quoted price + inventory until the returned
expiresAtand mints a NEW prediction id — pass that RESERVED id (not the original) asrfPredictionIdon POST /v1/ads/create. -
#reserve_rf_prediction_with_http_info(prediction_id, reserve_rf_prediction_request, opts = {}) ⇒ Array<(ReserveRfPrediction201Response, Integer, Hash)>
Reserve a Reach & Frequency prediction (Meta) Locks the quoted price + inventory until the returned `expiresAt` and mints a NEW prediction id — pass that RESERVED id (not the original) as `rfPredictionId` on POST /v1/ads/create.
-
#search_ad_interests(q, account_id, opts = {}) ⇒ SearchAdInterests200Response
Search targeting interests Deprecated alias for
GET /v1/ads/targeting/search?dimension=interest. -
#search_ad_interests_with_http_info(q, account_id, opts = {}) ⇒ Array<(SearchAdInterests200Response, Integer, Hash)>
Search targeting interests Deprecated alias for `GET /v1/ads/targeting/search?dimension=interest`.
-
#search_ad_targeting(account_id, q, opts = {}) ⇒ SearchAdTargeting200Response
Search targeting options Resolve a human-readable query into the platform's opaque targeting ids used in the
TargetingSpec(countries/regions/cities/zips/metrosgeo keys, andinterests/behaviorsentity ids) onPOST /v1/ads/create,POST /v1/ads/targeting/reach-estimate, andsaved_targetingaudiences. -
#search_ad_targeting_with_http_info(account_id, q, opts = {}) ⇒ Array<(SearchAdTargeting200Response, Integer, Hash)>
Search targeting options Resolve a human-readable query into the platform's opaque targeting ids used in the `TargetingSpec` (`countries`/`regions`/`cities`/`zips`/`metros` geo keys, and `interests`/`behaviors` entity ids) on `POST /v1/ads/create`, `POST /v1/ads/targeting/reach-estimate`, and `saved_targeting` audiences.
-
#send_conversions(send_conversions_request, opts = {}) ⇒ SendConversions200Response
Send conversion events Relay one or more conversion events to the target ad platform's native Conversions API.
-
#send_conversions_with_http_info(send_conversions_request, opts = {}) ⇒ Array<(SendConversions200Response, Integer, Hash)>
Send conversion events Relay one or more conversion events to the target ad platform's native Conversions API.
-
#send_whats_app_conversion(send_whats_app_conversion_request, opts = {}) ⇒ SendWhatsAppConversion200Response
Send WhatsApp conversion event Forward a WhatsApp Business Messaging conversion event (
LeadSubmitted,Purchase,AddToCart,InitiateCheckout,ViewContent) to Meta's Conversions API withaction_source = business_messagingandmessaging_channel = whatsapp. -
#send_whats_app_conversion_with_http_info(send_whats_app_conversion_request, opts = {}) ⇒ Array<(SendWhatsAppConversion200Response, Integer, Hash)>
Send WhatsApp conversion event Forward a WhatsApp Business Messaging conversion event (`LeadSubmitted`, `Purchase`, `AddToCart`, `InitiateCheckout`, `ViewContent`) to Meta's Conversions API with `action_source = business_messaging` and `messaging_channel = whatsapp`.
-
#update_ad(ad_id, update_ad_request, opts = {}) ⇒ UpdateAd200Response
Update ad Patch one or more fields on an ad.
-
#update_ad_account(update_ad_account_request, opts = {}) ⇒ UpdateAdAccount200Response
Update ad account settings Sets the default DSA beneficiary and payor on a Meta ad account (EU DSA, Article 26).
-
#update_ad_account_with_http_info(update_ad_account_request, opts = {}) ⇒ Array<(UpdateAdAccount200Response, Integer, Hash)>
Update ad account settings Sets the default DSA beneficiary and payor on a Meta ad account (EU DSA, Article 26).
-
#update_ad_creative(creative_id, update_ad_creative_request, opts = {}) ⇒ UpdateAdCreative200Response
Rename a creative (Meta) Renames a creative.
-
#update_ad_creative_with_http_info(creative_id, update_ad_creative_request, opts = {}) ⇒ Array<(UpdateAdCreative200Response, Integer, Hash)>
Rename a creative (Meta) Renames a creative.
-
#update_ad_status(ad_id, update_ad_status_request, opts = {}) ⇒ UpdateAdStatus200Response
Pause or resume a single ad Ad-scoped pause/resume — touches ONLY this ad, never its parent ad set or campaign (so sibling ads keep running).
-
#update_ad_status_with_http_info(ad_id, update_ad_status_request, opts = {}) ⇒ Array<(UpdateAdStatus200Response, Integer, Hash)>
Pause or resume a single ad Ad-scoped pause/resume — touches ONLY this ad, never its parent ad set or campaign (so sibling ads keep running).
-
#update_ad_tracking_tags(ad_id, update_ad_tracking_tags_request, opts = {}) ⇒ nil
Set ad tracking tags Unified update.
-
#update_ad_tracking_tags_with_http_info(ad_id, update_ad_tracking_tags_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Set ad tracking tags Unified update.
-
#update_ad_with_http_info(ad_id, update_ad_request, opts = {}) ⇒ Array<(UpdateAd200Response, Integer, Hash)>
Update ad Patch one or more fields on an ad.
-
#update_conversion_destination(account_id, destination_id, update_conversion_destination_request, opts = {}) ⇒ GetConversionDestination200Response
Update a conversion destination Partial-update a conversion rule.
-
#update_conversion_destination_with_http_info(account_id, destination_id, update_conversion_destination_request, opts = {}) ⇒ Array<(GetConversionDestination200Response, Integer, Hash)>
Update a conversion destination Partial-update a conversion rule.
-
#upload_ad_image(upload_ad_image_request, opts = {}) ⇒ UploadAdImage201Response
Upload an ad image from base64 (Meta) Uploads raw image bytes to the Meta ad account's image library — for callers whose creatives aren't hosted at a public URL.
-
#upload_ad_image_with_http_info(upload_ad_image_request, opts = {}) ⇒ Array<(UploadAdImage201Response, Integer, Hash)>
Upload an ad image from base64 (Meta) Uploads raw image bytes to the Meta ad account's image library — for callers whose creatives aren't hosted at a public URL.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#add_conversion_associations(account_id, destination_id, add_conversion_associations_request, opts = {}) ⇒ AddConversionAssociations200Response
Associate campaigns Associate one or more campaigns with this conversion rule. Returns a per-campaign success/failure result so callers can retry only the rows that failed (e.g. wrong campaign type for the rule's objective).
29 30 31 32 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 29 def add_conversion_associations(account_id, destination_id, add_conversion_associations_request, opts = {}) data, _status_code, _headers = add_conversion_associations_with_http_info(account_id, destination_id, add_conversion_associations_request, opts) data end |
#add_conversion_associations_with_http_info(account_id, destination_id, add_conversion_associations_request, opts = {}) ⇒ Array<(AddConversionAssociations200Response, Integer, Hash)>
Associate campaigns Associate one or more campaigns with this conversion rule. Returns a per-campaign success/failure result so callers can retry only the rows that failed (e.g. wrong campaign type for the rule's objective).
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 41 def add_conversion_associations_with_http_info(account_id, destination_id, add_conversion_associations_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.add_conversion_associations ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.add_conversion_associations" end # verify the required parameter 'destination_id' is set if @api_client.config.client_side_validation && destination_id.nil? fail ArgumentError, "Missing the required parameter 'destination_id' when calling AdsApi.add_conversion_associations" end # verify the required parameter 'add_conversion_associations_request' is set if @api_client.config.client_side_validation && add_conversion_associations_request.nil? fail ArgumentError, "Missing the required parameter 'add_conversion_associations_request' when calling AdsApi.add_conversion_associations" end # resource path local_var_path = '/v1/accounts/{accountId}/conversion-destinations/{destinationId}/associations'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'destinationId' + '}', CGI.escape(destination_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(add_conversion_associations_request) # return_type return_type = opts[:debug_return_type] || 'AddConversionAssociations200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.add_conversion_associations", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#add_conversion_associations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#adjust_conversions(adjust_conversions_request, opts = {}) ⇒ AdjustConversions200Response
Adjust uploaded conversions
Adjust conversions that were previously uploaded via POST /v1/ads/conversions — retract them, restate their value, or enhance them with first-party data. Requires the Ads add-on. Google Ads only. Google handles adjustments through the classic Google Ads API (ConversionAdjustmentUploadService); the Data Manager ingestEvents path used for sending conversions is ingest-only. Meta and LinkedIn have no equivalent, so this endpoint returns 405 for those platforms. Adjustment types: - RETRACTION — remove the conversion entirely (refund, chargeback, cancelled order, churn). - RESTATEMENT — change the conversion's value (upgrade / downgrade / partial refund). Send the corrected total value in restatementValue (not a delta). - ENHANCEMENT — attach first-party identifiers (hashed email / phone) to an existing conversion (enhanced conversions applied after the fact). Identifying the original conversion (per adjustment): - orderId — the transaction ID you sent as eventId on the original conversion. Recommended, and required for ENHANCEMENT. - or gclid + conversionTime — the click ID and the original conversion's time (unix seconds). Not available for ENHANCEMENT. destinationId is the conversion action resource name, e.g. customers/1234567890/conversionActions/987654321 (same value you send to POST /v1/ads/conversions). PII in user is hashed with SHA-256 server-side (Gmail-specific normalization included). Send plaintext. Times are unix seconds; we convert to Google's required yyyy-MM-dd HH:mm:ss+00:00 format. Up to 2000 adjustments per request; partial failure is supported (inspect adjustmentsFailed / failures[]).
107 108 109 110 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 107 def adjust_conversions(adjust_conversions_request, opts = {}) data, _status_code, _headers = adjust_conversions_with_http_info(adjust_conversions_request, opts) data end |
#adjust_conversions_with_http_info(adjust_conversions_request, opts = {}) ⇒ Array<(AdjustConversions200Response, Integer, Hash)>
Adjust uploaded conversions Adjust conversions that were previously uploaded via `POST /v1/ads/conversions` — retract them, restate their value, or enhance them with first-party data. Requires the Ads add-on. Google Ads only. Google handles adjustments through the classic Google Ads API (`ConversionAdjustmentUploadService`); the Data Manager `ingestEvents` path used for sending conversions is ingest-only. Meta and LinkedIn have no equivalent, so this endpoint returns `405` for those platforms. Adjustment types: - `RETRACTION` — remove the conversion entirely (refund, chargeback, cancelled order, churn). - `RESTATEMENT` — change the conversion's value (upgrade / downgrade / partial refund). Send the corrected total value in `restatementValue` (not a delta). - `ENHANCEMENT` — attach first-party identifiers (hashed email / phone) to an existing conversion (enhanced conversions applied after the fact). Identifying the original conversion (per adjustment): - `orderId` — the transaction ID you sent as `eventId` on the original conversion. Recommended, and required for `ENHANCEMENT`. - or `gclid` + `conversionTime` — the click ID and the original conversion's time (unix seconds). Not available for `ENHANCEMENT`. `destinationId` is the conversion action resource name, e.g. `customers/1234567890/conversionActions/987654321` (same value you send to `POST /v1/ads/conversions`). PII in `user` is hashed with SHA-256 server-side (Gmail-specific normalization included). Send plaintext. Times are unix seconds; we convert to Google's required `yyyy-MM-dd HH:mm:ss+00:00` format. Up to 2000 adjustments per request; partial failure is supported (inspect `adjustmentsFailed` / `failures`).
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 117 def adjust_conversions_with_http_info(adjust_conversions_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.adjust_conversions ...' end # verify the required parameter 'adjust_conversions_request' is set if @api_client.config.client_side_validation && adjust_conversions_request.nil? fail ArgumentError, "Missing the required parameter 'adjust_conversions_request' when calling AdsApi.adjust_conversions" end # resource path local_var_path = '/v1/ads/conversions/adjustments' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(adjust_conversions_request) # return_type return_type = opts[:debug_return_type] || 'AdjustConversions200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.adjust_conversions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#adjust_conversions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#archive_lead_form(form_id, account_id, opts = {}) ⇒ ArchiveLeadForm200Response
Archive a lead form Meta has no hard delete for forms; this archives the form (status=ARCHIVED).
176 177 178 179 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 176 def archive_lead_form(form_id, account_id, opts = {}) data, _status_code, _headers = archive_lead_form_with_http_info(form_id, account_id, opts) data end |
#archive_lead_form_with_http_info(form_id, account_id, opts = {}) ⇒ Array<(ArchiveLeadForm200Response, Integer, Hash)>
Archive a lead form Meta has no hard delete for forms; this archives the form (status=ARCHIVED).
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 187 def archive_lead_form_with_http_info(form_id, account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.archive_lead_form ...' end # verify the required parameter 'form_id' is set if @api_client.config.client_side_validation && form_id.nil? fail ArgumentError, "Missing the required parameter 'form_id' when calling AdsApi.archive_lead_form" end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.archive_lead_form" end # resource path local_var_path = '/v1/ads/lead-forms/{formId}'.sub('{' + 'formId' + '}', CGI.escape(form_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ArchiveLeadForm200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.archive_lead_form", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#archive_lead_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#boost_post(boost_post_request, opts = {}) ⇒ UpdateAd200Response
Boost post as ad Creates a paid ad campaign from an existing published post. Creates the full platform campaign hierarchy (campaign, ad set, ad).
245 246 247 248 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 245 def boost_post(boost_post_request, opts = {}) data, _status_code, _headers = boost_post_with_http_info(boost_post_request, opts) data end |
#boost_post_with_http_info(boost_post_request, opts = {}) ⇒ Array<(UpdateAd200Response, Integer, Hash)>
Boost post as ad Creates a paid ad campaign from an existing published post. Creates the full platform campaign hierarchy (campaign, ad set, ad).
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 255 def boost_post_with_http_info(boost_post_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.boost_post ...' end # verify the required parameter 'boost_post_request' is set if @api_client.config.client_side_validation && boost_post_request.nil? fail ArgumentError, "Missing the required parameter 'boost_post_request' when calling AdsApi.boost_post" end # resource path local_var_path = '/v1/ads/boost' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(boost_post_request) # return_type return_type = opts[:debug_return_type] || 'UpdateAd200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.boost_post", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#boost_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#cancel_rf_reservation(prediction_id, account_id, ad_account_id, opts = {}) ⇒ nil
Cancel a Reach & Frequency reservation (Meta) Releases a RESERVATION's locked price and inventory. Unreserved predictions expire on their own.
315 316 317 318 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 315 def cancel_rf_reservation(prediction_id, account_id, ad_account_id, opts = {}) cancel_rf_reservation_with_http_info(prediction_id, account_id, ad_account_id, opts) nil end |
#cancel_rf_reservation_with_http_info(prediction_id, account_id, ad_account_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Cancel a Reach & Frequency reservation (Meta) Releases a RESERVATION's locked price and inventory. Unreserved predictions expire on their own.
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 327 def cancel_rf_reservation_with_http_info(prediction_id, account_id, ad_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.cancel_rf_reservation ...' end # verify the required parameter 'prediction_id' is set if @api_client.config.client_side_validation && prediction_id.nil? fail ArgumentError, "Missing the required parameter 'prediction_id' when calling AdsApi.cancel_rf_reservation" end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.cancel_rf_reservation" end # verify the required parameter 'ad_account_id' is set if @api_client.config.client_side_validation && ad_account_id.nil? fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdsApi.cancel_rf_reservation" end # resource path local_var_path = '/v1/ads/rf-predictions/{predictionId}'.sub('{' + 'predictionId' + '}', CGI.escape(prediction_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'adAccountId'] = ad_account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.cancel_rf_reservation", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#cancel_rf_reservation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_ad_creative(create_ad_creative_request, opts = {}) ⇒ CreateAdCreative201Response
Create a standalone creative (Meta)
Creates a creative in the library WITHOUT an ad, reusable on the create endpoints via existingCreativeId. Provide exactly one of imageUrl (uploaded server-side), imageHash (from POST /v1/ads/images or the library list), or carouselCards (2-10 hand-built cards). The Page (and linked Instagram account, when present) is resolved from accountId as the story actor. Meta only.
390 391 392 393 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 390 def create_ad_creative(create_ad_creative_request, opts = {}) data, _status_code, _headers = create_ad_creative_with_http_info(create_ad_creative_request, opts) data end |
#create_ad_creative_with_http_info(create_ad_creative_request, opts = {}) ⇒ Array<(CreateAdCreative201Response, Integer, Hash)>
Create a standalone creative (Meta) Creates a creative in the library WITHOUT an ad, reusable on the create endpoints via `existingCreativeId`. Provide exactly one of `imageUrl` (uploaded server-side), `imageHash` (from POST /v1/ads/images or the library list), or `carouselCards` (2-10 hand-built cards). The Page (and linked Instagram account, when present) is resolved from `accountId` as the story actor. Meta only.
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 400 def create_ad_creative_with_http_info(create_ad_creative_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.create_ad_creative ...' end # verify the required parameter 'create_ad_creative_request' is set if @api_client.config.client_side_validation && create_ad_creative_request.nil? fail ArgumentError, "Missing the required parameter 'create_ad_creative_request' when calling AdsApi.create_ad_creative" end # resource path local_var_path = '/v1/ads/creatives' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_ad_creative_request) # return_type return_type = opts[:debug_return_type] || 'CreateAdCreative201Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.create_ad_creative", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#create_ad_creative\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_ad_insights_report(create_ad_insights_report_request, opts = {}) ⇒ CreateAdInsightsReport202Response
Submit an async insights report run (Meta)
Submits an asynchronous Meta insights report. Same query surface as GET /v1/ads/insights, but in the JSON body; Meta processes the report server-side, which is the right choice for long ranges or large accounts where the sync query is slow or rate-limited. Returns a reportRunId to poll via GET /v1/ads/insights/reports/reportRunId. Meta only.
458 459 460 461 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 458 def create_ad_insights_report(create_ad_insights_report_request, opts = {}) data, _status_code, _headers = create_ad_insights_report_with_http_info(create_ad_insights_report_request, opts) data end |
#create_ad_insights_report_with_http_info(create_ad_insights_report_request, opts = {}) ⇒ Array<(CreateAdInsightsReport202Response, Integer, Hash)>
Submit an async insights report run (Meta) Submits an asynchronous Meta insights report. Same query surface as GET /v1/ads/insights, but in the JSON body; Meta processes the report server-side, which is the right choice for long ranges or large accounts where the sync query is slow or rate-limited. Returns a `reportRunId` to poll via GET /v1/ads/insights/reports/reportRunId. Meta only.
468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 468 def create_ad_insights_report_with_http_info(create_ad_insights_report_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.create_ad_insights_report ...' end # verify the required parameter 'create_ad_insights_report_request' is set if @api_client.config.client_side_validation && create_ad_insights_report_request.nil? fail ArgumentError, "Missing the required parameter 'create_ad_insights_report_request' when calling AdsApi.create_ad_insights_report" end # resource path local_var_path = '/v1/ads/insights/reports' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_ad_insights_report_request) # return_type return_type = opts[:debug_return_type] || 'CreateAdInsightsReport202Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.create_ad_insights_report", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#create_ad_insights_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_call_ad(create_call_ad_request, opts = {}) ⇒ nil
Create Click-to-Call ad
Same shape and flow as POST /v1/ads/ctwa, but the CTA is CALL_NOW dialing phoneNumber via a tel: link. The ad set is destination_type PHONE_CALL optimizing QUALITY_CALL and the campaign objective defaults to OUTCOME_LEADS. Supports the same single-creative and multi-creative shapes as CTWA.
526 527 528 529 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 526 def create_call_ad(create_call_ad_request, opts = {}) create_call_ad_with_http_info(create_call_ad_request, opts) nil end |
#create_call_ad_with_http_info(create_call_ad_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create Click-to-Call ad Same shape and flow as POST /v1/ads/ctwa, but the CTA is CALL_NOW dialing `phoneNumber` via a tel: link. The ad set is destination_type PHONE_CALL optimizing QUALITY_CALL and the campaign objective defaults to OUTCOME_LEADS. Supports the same single-creative and multi-creative shapes as CTWA.
536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 536 def create_call_ad_with_http_info(create_call_ad_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.create_call_ad ...' end # verify the required parameter 'create_call_ad_request' is set if @api_client.config.client_side_validation && create_call_ad_request.nil? fail ArgumentError, "Missing the required parameter 'create_call_ad_request' when calling AdsApi.create_call_ad" end # resource path local_var_path = '/v1/ads/call' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_call_ad_request) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.create_call_ad", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#create_call_ad\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_conversion_destination(account_id, create_conversion_destination_request, opts = {}) ⇒ CreateConversionDestination201Response
Create a conversion destination
Create a new conversion destination on the platform. Supported for LinkedIn (conversion rule) and Google Ads (conversion action). Meta manages destinations in its own UI and returns 405. LinkedIn: creation is NOT idempotent. A retry creates a second destination. Deduplicate before retrying. Google Ads: calling with a name that already exists reuses the existing conversion action transparently (the response is identical to a fresh create). Calling with the same name but a different category returns a typed IDEMPOTENCY_CONFLICT (409) rather than silently returning the mismatched action. LinkedIn: the rule is created with conversionMethod=CONVERSIONS_API and (by default) auto-associated with all of the ad account's campaigns via autoAssociationType=ALL_CAMPAIGNS. Pass autoAssociationType: NONE to opt out and manage associations explicitly via the associations endpoints below. 365-day attribution windows are only valid for SUBMIT_APPLICATION, PURCHASE, ADD_TO_CART, QUALIFIED_LEAD, and LEAD rule types; the API rejects other combinations locally. Google Ads: the conversion action is created with type=UPLOAD_CLICKS (required for API-uploaded offline conversions, immutable after creation). The type field carries the Google ConversionActionCategory enum value, e.g. PURCHASE, SUBSCRIBE_PAID, SIGNUP, IMPORTED_LEAD, BOOK_APPOINTMENT. Unified standard event names (e.g. Purchase, Subscribe, CompleteRegistration, Lead, Schedule) are resolved to their Google category equivalents automatically. The action defaults to secondary (non-primary) to avoid immediately steering Smart Bidding; pass primaryForGoal: true to opt in.
595 596 597 598 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 595 def create_conversion_destination(account_id, create_conversion_destination_request, opts = {}) data, _status_code, _headers = create_conversion_destination_with_http_info(account_id, create_conversion_destination_request, opts) data end |
#create_conversion_destination_with_http_info(account_id, create_conversion_destination_request, opts = {}) ⇒ Array<(CreateConversionDestination201Response, Integer, Hash)>
Create a conversion destination Create a new conversion destination on the platform. Supported for LinkedIn (conversion rule) and Google Ads (conversion action). Meta manages destinations in its own UI and returns 405. LinkedIn: creation is NOT idempotent. A retry creates a second destination. Deduplicate before retrying. Google Ads: calling with a name that already exists reuses the existing conversion action transparently (the response is identical to a fresh create). Calling with the same name but a different category returns a typed `IDEMPOTENCY_CONFLICT` (409) rather than silently returning the mismatched action. LinkedIn: the rule is created with `conversionMethod=CONVERSIONS_API` and (by default) auto-associated with all of the ad account's campaigns via `autoAssociationType=ALL_CAMPAIGNS`. Pass `autoAssociationType: NONE` to opt out and manage associations explicitly via the associations endpoints below. 365-day attribution windows are only valid for `SUBMIT_APPLICATION`, `PURCHASE`, `ADD_TO_CART`, `QUALIFIED_LEAD`, and `LEAD` rule types; the API rejects other combinations locally. Google Ads: the conversion action is created with `type=UPLOAD_CLICKS` (required for API-uploaded offline conversions, immutable after creation). The `type` field carries the Google `ConversionActionCategory` enum value, e.g. `PURCHASE`, `SUBSCRIBE_PAID`, `SIGNUP`, `IMPORTED_LEAD`, `BOOK_APPOINTMENT`. Unified standard event names (e.g. `Purchase`, `Subscribe`, `CompleteRegistration`, `Lead`, `Schedule`) are resolved to their Google category equivalents automatically. The action defaults to secondary (non-primary) to avoid immediately steering Smart Bidding; pass `primaryForGoal: true` to opt in.
606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 606 def create_conversion_destination_with_http_info(account_id, create_conversion_destination_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.create_conversion_destination ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.create_conversion_destination" end # verify the required parameter 'create_conversion_destination_request' is set if @api_client.config.client_side_validation && create_conversion_destination_request.nil? fail ArgumentError, "Missing the required parameter 'create_conversion_destination_request' when calling AdsApi.create_conversion_destination" end # resource path local_var_path = '/v1/accounts/{accountId}/conversion-destinations'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_conversion_destination_request) # return_type return_type = opts[:debug_return_type] || 'CreateConversionDestination201Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.create_conversion_destination", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#create_conversion_destination\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_ctwa_ad(ctwa_ad_request_body, opts = {}) ⇒ CreateCtwaAd201Response
Create Click-to-WhatsApp ad (deprecated)
Deprecated: use POST /v1/ads/messaging with destination: whatsapp. This endpoint stays available for back-compat; no removal planned. Creates one or more Click-to-WhatsApp (CTWA) ads on Meta under a single campaign and ad set. When tapped, each ad opens a WhatsApp conversation with the business attached to the supplied Facebook Page. The full hierarchy (campaign, ad set, creative(s), ad(s)) is created and activated in one call. The CTA is locked to WHATSAPP_MESSAGE and the destination is hard-coded to api.whatsapp.com/send; Meta resolves the actual WhatsApp number from the Page-to-WA pairing configured in Page settings or Business Manager. Supports two mutually-exclusive shapes: - Single-creative: supply top-level headline, body, and one of imageUrl / video. Creates 1 campaign + 1 ad set + 1 ad. - Multi-creative: supply a creatives[] array with N entries (each carrying its own headline, body, and image/video). Creates 1 campaign + 1 ad set + N ads sharing budget and targeting so Meta A/Bs the creatives inside a single auction instead of fragmenting budget across N parallel campaigns. Recommended when launching multiple creative variants for the same campaign. Prerequisites enforced by Meta (surfaced as platform_error on failure): the Facebook Page must be paired with a verified WhatsApp Business number, the WhatsApp Business Account must be business-verified, and the Meta access token must carry ads_management.
668 669 670 671 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 668 def create_ctwa_ad(ctwa_ad_request_body, opts = {}) data, _status_code, _headers = create_ctwa_ad_with_http_info(ctwa_ad_request_body, opts) data end |
#create_ctwa_ad_with_http_info(ctwa_ad_request_body, opts = {}) ⇒ Array<(CreateCtwaAd201Response, Integer, Hash)>
Create Click-to-WhatsApp ad (deprecated) Deprecated: use POST /v1/ads/messaging with `destination: whatsapp`. This endpoint stays available for back-compat; no removal planned. Creates one or more Click-to-WhatsApp (CTWA) ads on Meta under a single campaign and ad set. When tapped, each ad opens a WhatsApp conversation with the business attached to the supplied Facebook Page. The full hierarchy (campaign, ad set, creative(s), ad(s)) is created and activated in one call. The CTA is locked to WHATSAPP_MESSAGE and the destination is hard-coded to api.whatsapp.com/send; Meta resolves the actual WhatsApp number from the Page-to-WA pairing configured in Page settings or Business Manager. Supports two mutually-exclusive shapes: - Single-creative: supply top-level `headline`, `body`, and one of `imageUrl` / `video`. Creates 1 campaign + 1 ad set + 1 ad. - Multi-creative: supply a `creatives` array with N entries (each carrying its own headline, body, and image/video). Creates 1 campaign + 1 ad set + N ads sharing budget and targeting so Meta A/Bs the creatives inside a single auction instead of fragmenting budget across N parallel campaigns. Recommended when launching multiple creative variants for the same campaign. Prerequisites enforced by Meta (surfaced as platform_error on failure): the Facebook Page must be paired with a verified WhatsApp Business number, the WhatsApp Business Account must be business-verified, and the Meta access token must carry ads_management.
678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 678 def create_ctwa_ad_with_http_info(ctwa_ad_request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.create_ctwa_ad ...' end # verify the required parameter 'ctwa_ad_request_body' is set if @api_client.config.client_side_validation && ctwa_ad_request_body.nil? fail ArgumentError, "Missing the required parameter 'ctwa_ad_request_body' when calling AdsApi.create_ctwa_ad" end # resource path local_var_path = '/v1/ads/ctwa' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(ctwa_ad_request_body) # return_type return_type = opts[:debug_return_type] || 'CreateCtwaAd201Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.create_ctwa_ad", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#create_ctwa_ad\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_lead_form(create_lead_form_request, opts = {}) ⇒ CreateLeadForm200Response
Create a lead form Creates a Lead Gen form on the connected Facebook Page (POST /page-id/leadgen_forms). NOT idempotent — a retry creates a second form. Prefilled question types (EMAIL, PHONE, FULL_NAME, …) must omit label/key; CUSTOM questions require both. Requires the Ads add-on.
736 737 738 739 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 736 def create_lead_form(create_lead_form_request, opts = {}) data, _status_code, _headers = create_lead_form_with_http_info(create_lead_form_request, opts) data end |
#create_lead_form_with_http_info(create_lead_form_request, opts = {}) ⇒ Array<(CreateLeadForm200Response, Integer, Hash)>
Create a lead form Creates a Lead Gen form on the connected Facebook Page (POST /page-id/leadgen_forms). NOT idempotent — a retry creates a second form. Prefilled question types (EMAIL, PHONE, FULL_NAME, …) must omit label/key; CUSTOM questions require both. Requires the Ads add-on.
746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 746 def create_lead_form_with_http_info(create_lead_form_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.create_lead_form ...' end # verify the required parameter 'create_lead_form_request' is set if @api_client.config.client_side_validation && create_lead_form_request.nil? fail ArgumentError, "Missing the required parameter 'create_lead_form_request' when calling AdsApi.create_lead_form" end # resource path local_var_path = '/v1/ads/lead-forms' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_lead_form_request) # return_type return_type = opts[:debug_return_type] || 'CreateLeadForm200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.create_lead_form", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#create_lead_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_messaging_ad(create_messaging_ad_request, opts = {}) ⇒ nil
Create click-to-message ad (WhatsApp / Messenger / Instagram Direct)
Creates a click-to-message ad; destination selects where the tapped ad opens a conversation: WhatsApp, the Page's Messenger inbox or the linked Instagram account's Direct inbox. The ad set is created with the matching destination_type and CONVERSATIONS optimization; the campaign objective defaults to OUTCOME_ENGAGEMENT. Supports single-creative and multi-creative shapes. Supersedes POST /v1/ads/ctwa (deprecated, equivalent to destination: whatsapp).
804 805 806 807 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 804 def create_messaging_ad(create_messaging_ad_request, opts = {}) create_messaging_ad_with_http_info(create_messaging_ad_request, opts) nil end |
#create_messaging_ad_with_http_info(create_messaging_ad_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create click-to-message ad (WhatsApp / Messenger / Instagram Direct) Creates a click-to-message ad; `destination` selects where the tapped ad opens a conversation: WhatsApp, the Page's Messenger inbox or the linked Instagram account's Direct inbox. The ad set is created with the matching destination_type and CONVERSATIONS optimization; the campaign objective defaults to OUTCOME_ENGAGEMENT. Supports single-creative and multi-creative shapes. Supersedes POST /v1/ads/ctwa (deprecated, equivalent to `destination: whatsapp`).
814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 814 def create_messaging_ad_with_http_info(create_messaging_ad_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.create_messaging_ad ...' end # verify the required parameter 'create_messaging_ad_request' is set if @api_client.config.client_side_validation && create_messaging_ad_request.nil? fail ArgumentError, "Missing the required parameter 'create_messaging_ad_request' when calling AdsApi.create_messaging_ad" end # resource path local_var_path = '/v1/ads/messaging' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_messaging_ad_request) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.create_messaging_ad", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#create_messaging_ad\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_rf_prediction(create_rf_prediction_request, opts = {}) ⇒ CreateRfPrediction201Response
Create a Reach & Frequency prediction (Meta)
Creates an R&F prediction — a QUOTE, nothing is bought and no ad entities are created. Provide a date range plus exactly one of budgetAmount (Meta predicts reach) or reach (Meta predicts the budget). The response carries the estimate and its allowed bounds (min/max budget and reach). Predictions expire on their own; to buy, reserve one via POST /v1/ads/rf-predictions/predictionId/reserve and pass the RESERVED id to POST /v1/ads/create with buyingType: \"RESERVED\". Reservation campaigns reject automatic placements, so omitted placements default to Facebook feed (+ Instagram stream when a linked IG professional account resolves); Instagram placements require that IG account. Meta only.
872 873 874 875 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 872 def create_rf_prediction(create_rf_prediction_request, opts = {}) data, _status_code, _headers = create_rf_prediction_with_http_info(create_rf_prediction_request, opts) data end |
#create_rf_prediction_with_http_info(create_rf_prediction_request, opts = {}) ⇒ Array<(CreateRfPrediction201Response, Integer, Hash)>
Create a Reach & Frequency prediction (Meta) Creates an R&F prediction — a QUOTE, nothing is bought and no ad entities are created. Provide a date range plus exactly one of `budgetAmount` (Meta predicts reach) or `reach` (Meta predicts the budget). The response carries the estimate and its allowed bounds (min/max budget and reach). Predictions expire on their own; to buy, reserve one via POST /v1/ads/rf-predictions/predictionId/reserve and pass the RESERVED id to POST /v1/ads/create with `buyingType: "RESERVED"`. Reservation campaigns reject automatic placements, so omitted `placements` default to Facebook feed (+ Instagram stream when a linked IG professional account resolves); Instagram placements require that IG account. Meta only.
882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 882 def create_rf_prediction_with_http_info(create_rf_prediction_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.create_rf_prediction ...' end # verify the required parameter 'create_rf_prediction_request' is set if @api_client.config.client_side_validation && create_rf_prediction_request.nil? fail ArgumentError, "Missing the required parameter 'create_rf_prediction_request' when calling AdsApi.create_rf_prediction" end # resource path local_var_path = '/v1/ads/rf-predictions' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_rf_prediction_request) # return_type return_type = opts[:debug_return_type] || 'CreateRfPrediction201Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.create_rf_prediction", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#create_rf_prediction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_standalone_ad(create_standalone_ad_request, opts = {}) ⇒ CreateStandaloneAd201Response
Create standalone ad
Creates a paid ad with custom creative across Meta, Google Ads, Pinterest, TikTok, X/Twitter, and LinkedIn. Supports three mutually-exclusive request shapes selected by the body, a legacy single-creative shape (all platforms, default), a Meta-only multi-creative shape via the creatives array (one ad set with N ads sharing budget and targeting), and a Meta-only attach shape via adSetId (adds one new ad to an existing ad set). Per-platform required fields, budget minimums, and video-ad rules are documented on each property below. LinkedIn creates a Single Image or Single Video Ad backed by a Direct Sponsored Content "dark post" authored by a Company Page (see organizationId); supported goals are engagement, traffic, awareness, and video_views (video ads use the video field; video_views requires a video), and traffic ads require linkUrl. Idempotency: this endpoint is not idempotent at the platform level (a blind retry creates a second campaign/ad set/ad). Send an Idempotency-Key header to make retries safe: the first request with a given key creates the ad and we store the response; a retry with the same key replays that exact response (with Idempotent-Replayed: true) instead of creating duplicates. Reusing a key with a different body returns 422; a key whose first request is still in flight returns 409 (retry after a short backoff). Keys are scoped to your credential and expire after 24h.
941 942 943 944 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 941 def create_standalone_ad(create_standalone_ad_request, opts = {}) data, _status_code, _headers = create_standalone_ad_with_http_info(create_standalone_ad_request, opts) data end |
#create_standalone_ad_with_http_info(create_standalone_ad_request, opts = {}) ⇒ Array<(CreateStandaloneAd201Response, Integer, Hash)>
Create standalone ad Creates a paid ad with custom creative across Meta, Google Ads, Pinterest, TikTok, X/Twitter, and LinkedIn. Supports three mutually-exclusive request shapes selected by the body, a legacy single-creative shape (all platforms, default), a Meta-only multi-creative shape via the creatives array (one ad set with N ads sharing budget and targeting), and a Meta-only attach shape via adSetId (adds one new ad to an existing ad set). Per-platform required fields, budget minimums, and video-ad rules are documented on each property below. LinkedIn creates a Single Image or Single Video Ad backed by a Direct Sponsored Content "dark post" authored by a Company Page (see `organizationId`); supported goals are engagement, traffic, awareness, and video_views (video ads use the `video` field; video_views requires a video), and traffic ads require `linkUrl`. Idempotency: this endpoint is not idempotent at the platform level (a blind retry creates a second campaign/ad set/ad). Send an `Idempotency-Key` header to make retries safe: the first request with a given key creates the ad and we store the response; a retry with the same key replays that exact response (with `Idempotent-Replayed: true`) instead of creating duplicates. Reusing a key with a different body returns 422; a key whose first request is still in flight returns 409 (retry after a short backoff). Keys are scoped to your credential and expire after 24h.
952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 952 def create_standalone_ad_with_http_info(create_standalone_ad_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.create_standalone_ad ...' end # verify the required parameter 'create_standalone_ad_request' is set if @api_client.config.client_side_validation && create_standalone_ad_request.nil? fail ArgumentError, "Missing the required parameter 'create_standalone_ad_request' when calling AdsApi.create_standalone_ad" end if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255 fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling AdsApi.create_standalone_ad, the character length must be smaller than or equal to 255.' end # resource path local_var_path = '/v1/ads/create' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_standalone_ad_request) # return_type return_type = opts[:debug_return_type] || 'CreateStandaloneAd201Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.create_standalone_ad", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#create_standalone_ad\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_test_lead(form_id, create_test_lead_request, opts = {}) ⇒ CreateTestLead200Response
Create a test lead Submits a test lead against the form (POST /form-id/test_leads) to exercise retrieval without waiting for real ad impressions. Meta allows one test lead per form at a time.
1016 1017 1018 1019 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1016 def create_test_lead(form_id, create_test_lead_request, opts = {}) data, _status_code, _headers = create_test_lead_with_http_info(form_id, create_test_lead_request, opts) data end |
#create_test_lead_with_http_info(form_id, create_test_lead_request, opts = {}) ⇒ Array<(CreateTestLead200Response, Integer, Hash)>
Create a test lead Submits a test lead against the form (POST /form-id/test_leads) to exercise retrieval without waiting for real ad impressions. Meta allows one test lead per form at a time.
1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1027 def create_test_lead_with_http_info(form_id, create_test_lead_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.create_test_lead ...' end # verify the required parameter 'form_id' is set if @api_client.config.client_side_validation && form_id.nil? fail ArgumentError, "Missing the required parameter 'form_id' when calling AdsApi.create_test_lead" end # verify the required parameter 'create_test_lead_request' is set if @api_client.config.client_side_validation && create_test_lead_request.nil? fail ArgumentError, "Missing the required parameter 'create_test_lead_request' when calling AdsApi.create_test_lead" end # resource path local_var_path = '/v1/ads/lead-forms/{formId}/test-leads'.sub('{' + 'formId' + '}', CGI.escape(form_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_test_lead_request) # return_type return_type = opts[:debug_return_type] || 'CreateTestLead200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.create_test_lead", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#create_test_lead\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_ad(ad_id, opts = {}) ⇒ DeleteAccountGroup200Response
Cancel an ad Cancels the ad on the platform and marks it as cancelled in the database. The ad is preserved for history.
1089 1090 1091 1092 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1089 def delete_ad(ad_id, opts = {}) data, _status_code, _headers = delete_ad_with_http_info(ad_id, opts) data end |
#delete_ad_creative(creative_id, account_id, opts = {}) ⇒ DeleteAdCreative200Response
Delete a creative (Meta) Deletes a creative from the library. Meta only allows deleting creatives not referenced by any ad — otherwise its 400 surfaces verbatim.
1153 1154 1155 1156 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1153 def delete_ad_creative(creative_id, account_id, opts = {}) data, _status_code, _headers = delete_ad_creative_with_http_info(creative_id, account_id, opts) data end |
#delete_ad_creative_with_http_info(creative_id, account_id, opts = {}) ⇒ Array<(DeleteAdCreative200Response, Integer, Hash)>
Delete a creative (Meta) Deletes a creative from the library. Meta only allows deleting creatives not referenced by any ad — otherwise its 400 surfaces verbatim.
1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1164 def delete_ad_creative_with_http_info(creative_id, account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.delete_ad_creative ...' end # verify the required parameter 'creative_id' is set if @api_client.config.client_side_validation && creative_id.nil? fail ArgumentError, "Missing the required parameter 'creative_id' when calling AdsApi.delete_ad_creative" end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.delete_ad_creative" end # resource path local_var_path = '/v1/ads/creatives/{creativeId}'.sub('{' + 'creativeId' + '}', CGI.escape(creative_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'DeleteAdCreative200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.delete_ad_creative", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#delete_ad_creative\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_ad_with_http_info(ad_id, opts = {}) ⇒ Array<(DeleteAccountGroup200Response, Integer, Hash)>
Cancel an ad Cancels the ad on the platform and marks it as cancelled in the database. The ad is preserved for history.
1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1099 def delete_ad_with_http_info(ad_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.delete_ad ...' end # verify the required parameter 'ad_id' is set if @api_client.config.client_side_validation && ad_id.nil? fail ArgumentError, "Missing the required parameter 'ad_id' when calling AdsApi.delete_ad" end # resource path local_var_path = '/v1/ads/{adId}'.sub('{' + 'adId' + '}', CGI.escape(ad_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'DeleteAccountGroup200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.delete_ad", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#delete_ad\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_conversion_destination(account_id, destination_id, opts = {}) ⇒ nil
Delete a conversion destination
LinkedIn-only today. LinkedIn does not expose hard-delete on conversion rules — what their UI calls "delete" is the same enabled: false flip we apply here. The rule remains fetchable via GET with status: 'inactive'; the unified discovery endpoint hides it by default. adAccountId may be passed as a query parameter (recommended) or as a JSON body field for clients that can send DELETE bodies.
1224 1225 1226 1227 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1224 def delete_conversion_destination(account_id, destination_id, opts = {}) delete_conversion_destination_with_http_info(account_id, destination_id, opts) nil end |
#delete_conversion_destination_with_http_info(account_id, destination_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete a conversion destination LinkedIn-only today. LinkedIn does not expose hard-delete on conversion rules — what their UI calls "delete" is the same `enabled: false` flip we apply here. The rule remains fetchable via GET with `status: 'inactive'`; the unified discovery endpoint hides it by default. `adAccountId` may be passed as a query parameter (recommended) or as a JSON body field for clients that can send DELETE bodies.
1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1236 def delete_conversion_destination_with_http_info(account_id, destination_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.delete_conversion_destination ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.delete_conversion_destination" end # verify the required parameter 'destination_id' is set if @api_client.config.client_side_validation && destination_id.nil? fail ArgumentError, "Missing the required parameter 'destination_id' when calling AdsApi.delete_conversion_destination" end # resource path local_var_path = '/v1/accounts/{accountId}/conversion-destinations/{destinationId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'destinationId' + '}', CGI.escape(destination_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'adAccountId'] = opts[:'ad_account_id'] if !opts[:'ad_account_id'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.delete_conversion_destination", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#delete_conversion_destination\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#duplicate_ad(ad_id, opts = {}) ⇒ DuplicateAd200Response
Duplicate an ad (Meta)
Duplicates a single ad via Meta's native POST /{ad-id}/copies. The copy is created paused. adSetId retargets the copy into another ad set; omitted = the source's own ad set. Accepts the Zernio ad id or the platform ad id. Sync discovery is triggered automatically (syncAfter: false to skip). Meta only.
1295 1296 1297 1298 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1295 def duplicate_ad(ad_id, opts = {}) data, _status_code, _headers = duplicate_ad_with_http_info(ad_id, opts) data end |
#duplicate_ad_with_http_info(ad_id, opts = {}) ⇒ Array<(DuplicateAd200Response, Integer, Hash)>
Duplicate an ad (Meta) Duplicates a single ad via Meta's native `POST /ad-id/copies`. The copy is created paused. `adSetId` retargets the copy into another ad set; omitted = the source's own ad set. Accepts the Zernio ad id or the platform ad id. Sync discovery is triggered automatically (`syncAfter: false` to skip). Meta only.
1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1306 def duplicate_ad_with_http_info(ad_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.duplicate_ad ...' end # verify the required parameter 'ad_id' is set if @api_client.config.client_side_validation && ad_id.nil? fail ArgumentError, "Missing the required parameter 'ad_id' when calling AdsApi.duplicate_ad" end # resource path local_var_path = '/v1/ads/{adId}/duplicate'.sub('{' + 'adId' + '}', CGI.escape(ad_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'duplicate_ad_request']) # return_type return_type = opts[:debug_return_type] || 'DuplicateAd200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.duplicate_ad", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#duplicate_ad\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#estimate_ad_reach(estimate_ad_reach_request, opts = {}) ⇒ EstimateAdReach200Response
Estimate audience reach
Returns a normalized pre-flight audience-size estimate for a targeting spec, before any campaign is created. Backed by each platform's native reach API (Meta delivery_estimate, LinkedIn audienceCounts, X audience_summary, Pinterest audience_sizing). Platforms without a usable pre-flight reach API (Google Search/Display, TikTok) return available: false with no bounds, so clients can hide or grey out the estimate rather than treat the absence as an error.
1364 1365 1366 1367 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1364 def estimate_ad_reach(estimate_ad_reach_request, opts = {}) data, _status_code, _headers = estimate_ad_reach_with_http_info(estimate_ad_reach_request, opts) data end |
#estimate_ad_reach_with_http_info(estimate_ad_reach_request, opts = {}) ⇒ Array<(EstimateAdReach200Response, Integer, Hash)>
Estimate audience reach Returns a normalized pre-flight audience-size estimate for a targeting spec, before any campaign is created. Backed by each platform's native reach API (Meta `delivery_estimate`, LinkedIn `audienceCounts`, X `audience_summary`, Pinterest `audience_sizing`). Platforms without a usable pre-flight reach API (Google Search/Display, TikTok) return `available: false` with no bounds, so clients can hide or grey out the estimate rather than treat the absence as an error.
1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1374 def estimate_ad_reach_with_http_info(estimate_ad_reach_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.estimate_ad_reach ...' end # verify the required parameter 'estimate_ad_reach_request' is set if @api_client.config.client_side_validation && estimate_ad_reach_request.nil? fail ArgumentError, "Missing the required parameter 'estimate_ad_reach_request' when calling AdsApi.estimate_ad_reach" end # resource path local_var_path = '/v1/ads/targeting/reach-estimate' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(estimate_ad_reach_request) # return_type return_type = opts[:debug_return_type] || 'EstimateAdReach200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.estimate_ad_reach", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#estimate_ad_reach\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#generate_ad_previews(generate_ad_previews_request, opts = {}) ⇒ GenerateAdPreviews200Response
Render pre-create ad previews (Meta)
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. Meta only.
1432 1433 1434 1435 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1432 def generate_ad_previews(generate_ad_previews_request, opts = {}) data, _status_code, _headers = generate_ad_previews_with_http_info(generate_ad_previews_request, opts) data end |
#generate_ad_previews_with_http_info(generate_ad_previews_request, opts = {}) ⇒ Array<(GenerateAdPreviews200Response, Integer, Hash)>
Render pre-create ad previews (Meta) 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. Meta only.
1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1442 def generate_ad_previews_with_http_info(generate_ad_previews_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.generate_ad_previews ...' end # verify the required parameter 'generate_ad_previews_request' is set if @api_client.config.client_side_validation && generate_ad_previews_request.nil? fail ArgumentError, "Missing the required parameter 'generate_ad_previews_request' when calling AdsApi.generate_ad_previews" end # resource path local_var_path = '/v1/ads/preview' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(generate_ad_previews_request) # return_type return_type = opts[:debug_return_type] || 'GenerateAdPreviews200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.generate_ad_previews", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#generate_ad_previews\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_ad(ad_id, opts = {}) ⇒ GetAd200Response
Get ad details
Returns an ad with its creative, targeting, status, and performance metrics. The {adId} path segment accepts any identifier dialect Zernio indexes for the ad: - the Zernio internal _id (24-char hex) - Meta's numeric platformAdId (the value shipped in comment.received webhooks as comment.ad.id) - the creative's effective_object_story_id ({pageId}_{postId} shape, Facebook side) - the creative's effective_instagram_media_id (Instagram side) Any of the four resolve to the same ad. Caller doesn't need a translation step.
1500 1501 1502 1503 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1500 def get_ad(ad_id, opts = {}) data, _status_code, _headers = get_ad_with_http_info(ad_id, opts) data end |
#get_ad_account_finance(account_id, ad_account_id, opts = {}) ⇒ GetAdAccountFinance200Response
Ad account finances (Meta)
Finances of one Meta ad account: prepaid balance, lifetime amountSpent, account spendCap (null = no cap) and the fundingSource. Money values are converted from Meta's minor units to whole units of currency. Meta only.
1564 1565 1566 1567 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1564 def get_ad_account_finance(account_id, ad_account_id, opts = {}) data, _status_code, _headers = get_ad_account_finance_with_http_info(account_id, ad_account_id, opts) data end |
#get_ad_account_finance_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(GetAdAccountFinance200Response, Integer, Hash)>
Ad account finances (Meta) Finances of one Meta ad account: prepaid `balance`, lifetime `amountSpent`, account `spendCap` (null = no cap) and the `fundingSource`. Money values are converted from Meta's minor units to whole units of `currency`. Meta only.
1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1575 def get_ad_account_finance_with_http_info(account_id, ad_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_ad_account_finance ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.get_ad_account_finance" end # verify the required parameter 'ad_account_id' is set if @api_client.config.client_side_validation && ad_account_id.nil? fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdsApi.get_ad_account_finance" end # resource path local_var_path = '/v1/ads/accounts/finance' # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'adAccountId'] = ad_account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetAdAccountFinance200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_ad_account_finance", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_ad_account_finance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_ad_analytics(ad_id, opts = {}) ⇒ GetAdAnalytics200Response
Get ad analytics Returns detailed performance analytics for an ad. Includes summary metrics, a daily timeline over the requested date range, and optional demographic breakdowns (Meta and TikTok only). If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max.
1637 1638 1639 1640 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1637 def get_ad_analytics(ad_id, opts = {}) data, _status_code, _headers = get_ad_analytics_with_http_info(ad_id, opts) data end |
#get_ad_analytics_with_http_info(ad_id, opts = {}) ⇒ Array<(GetAdAnalytics200Response, Integer, Hash)>
Get ad analytics Returns detailed performance analytics for an ad. Includes summary metrics, a daily timeline over the requested date range, and optional demographic breakdowns (Meta and TikTok only). If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max.
1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1650 def get_ad_analytics_with_http_info(ad_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_ad_analytics ...' end # verify the required parameter 'ad_id' is set if @api_client.config.client_side_validation && ad_id.nil? fail ArgumentError, "Missing the required parameter 'ad_id' when calling AdsApi.get_ad_analytics" end # resource path local_var_path = '/v1/ads/{adId}/analytics'.sub('{' + 'adId' + '}', CGI.escape(ad_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil? query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil? query_params[:'breakdowns'] = opts[:'breakdowns'] if !opts[:'breakdowns'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetAdAnalytics200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_ad_analytics", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_ad_analytics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_ad_comments(ad_id, opts = {}) ⇒ GetAdComments200Response
List comments on an ad
Returns comments on an ad's underlying creative post. Useful for moderating or analyzing engagement on dark posts (ad creatives that never went live organically), which the regular GET /v1/inbox/comments/postId endpoint cannot serve because dark posts are not in Zernio's post database. An ad that runs on both Facebook feed and Instagram feed has two separate underlying posts with separate comment threads (the creative's effective_object_story_id and effective_instagram_media_id). Use the placement query param to pick one; with no param the Instagram side is returned when it exists, otherwise Facebook. The identifiers are read from the ad record (persisted during sync) with a Marketing-API fallback for ads that predate the field. For Instagram-placed comments, the Instagram account that runs the ad must be connected to Zernio — those comments are read through that account's token. If no connected Instagram account on the profile can read the ad's media, the call returns ads_connection_required (the Facebook side, if any, is still readable via ?placement=facebook). Meta-only. Other ad platforms (TikTok, LinkedIn, Pinterest, Google, X) do not expose a public per-ad comments API and return feature_not_available. Requires the Ads add-on. Response shape matches GET /v1/inbox/comments/postId. The {adId} path segment accepts any identifier dialect Zernio indexes for the ad: Zernio internal _id (24-char hex), Meta's numeric platformAdId (the value shipped in comment.received webhooks as comment.ad.id), or the creative's effective_object_story_id / effective_instagram_media_id. Caller doesn't need a translation step.
1709 1710 1711 1712 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1709 def get_ad_comments(ad_id, opts = {}) data, _status_code, _headers = get_ad_comments_with_http_info(ad_id, opts) data end |
#get_ad_comments_with_http_info(ad_id, opts = {}) ⇒ Array<(GetAdComments200Response, Integer, Hash)>
List comments on an ad Returns comments on an ad's underlying creative post. Useful for moderating or analyzing engagement on dark posts (ad creatives that never went live organically), which the regular GET /v1/inbox/comments/postId endpoint cannot serve because dark posts are not in Zernio's post database. An ad that runs on both Facebook feed and Instagram feed has two separate underlying posts with separate comment threads (the creative's effective_object_story_id and effective_instagram_media_id). Use the `placement` query param to pick one; with no param the Instagram side is returned when it exists, otherwise Facebook. The identifiers are read from the ad record (persisted during sync) with a Marketing-API fallback for ads that predate the field. For Instagram-placed comments, the Instagram account that runs the ad must be connected to Zernio — those comments are read through that account's token. If no connected Instagram account on the profile can read the ad's media, the call returns ads_connection_required (the Facebook side, if any, is still readable via ?placement=facebook). Meta-only. Other ad platforms (TikTok, LinkedIn, Pinterest, Google, X) do not expose a public per-ad comments API and return feature_not_available. Requires the Ads add-on. Response shape matches GET /v1/inbox/comments/postId. The `adId` path segment accepts any identifier dialect Zernio indexes for the ad: Zernio internal `_id` (24-char hex), Meta's numeric `platformAdId` (the value shipped in `comment.received` webhooks as `comment.ad.id`), or the creative's `effective_object_story_id` / `effective_instagram_media_id`. Caller doesn't need a translation step.
1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1722 def get_ad_comments_with_http_info(ad_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_ad_comments ...' end # verify the required parameter 'ad_id' is set if @api_client.config.client_side_validation && ad_id.nil? fail ArgumentError, "Missing the required parameter 'ad_id' when calling AdsApi.get_ad_comments" end allowable_values = ["facebook", "instagram"] if @api_client.config.client_side_validation && opts[:'placement'] && !allowable_values.include?(opts[:'placement']) fail ArgumentError, "invalid value for \"placement\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.get_ad_comments, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.get_ad_comments, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/ads/{adId}/comments'.sub('{' + 'adId' + '}', CGI.escape(ad_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'placement'] = opts[:'placement'] if !opts[:'placement'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetAdComments200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_ad_comments", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_ad_comments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_ad_creative(creative_id, account_id, opts = {}) ⇒ GetAdCreative200Response
Creative details (Meta)
One creative's details, verbatim from Meta. fields is a raw-passthrough override of the default projection. Meta only.
1792 1793 1794 1795 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1792 def get_ad_creative(creative_id, account_id, opts = {}) data, _status_code, _headers = get_ad_creative_with_http_info(creative_id, account_id, opts) data end |
#get_ad_creative_with_http_info(creative_id, account_id, opts = {}) ⇒ Array<(GetAdCreative200Response, Integer, Hash)>
Creative details (Meta) One creative's details, verbatim from Meta. `fields` is a raw-passthrough override of the default projection. Meta only.
1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1804 def get_ad_creative_with_http_info(creative_id, account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_ad_creative ...' end # verify the required parameter 'creative_id' is set if @api_client.config.client_side_validation && creative_id.nil? fail ArgumentError, "Missing the required parameter 'creative_id' when calling AdsApi.get_ad_creative" end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.get_ad_creative" end # resource path local_var_path = '/v1/ads/creatives/{creativeId}'.sub('{' + 'creativeId' + '}', CGI.escape(creative_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetAdCreative200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_ad_creative", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_ad_creative\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_ad_insights_report(report_run_id, account_id, opts = {}) ⇒ GetAdInsightsReport200Response
Poll an async insights report run (Meta)
Status and results for a report run created via POST /v1/ads/insights/reports. While the job runs, returns status and percentCompletion. Once status is "Job Completed" the response also carries a data page, cursor-paginated via limit / after.
1866 1867 1868 1869 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1866 def get_ad_insights_report(report_run_id, account_id, opts = {}) data, _status_code, _headers = get_ad_insights_report_with_http_info(report_run_id, account_id, opts) data end |
#get_ad_insights_report_with_http_info(report_run_id, account_id, opts = {}) ⇒ Array<(GetAdInsightsReport200Response, Integer, Hash)>
Poll an async insights report run (Meta) Status and results for a report run created via POST /v1/ads/insights/reports. While the job runs, returns `status` and `percentCompletion`. Once `status` is "Job Completed" the response also carries a `data` page, cursor-paginated via `limit` / `after`.
1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1879 def get_ad_insights_report_with_http_info(report_run_id, account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_ad_insights_report ...' end # verify the required parameter 'report_run_id' is set if @api_client.config.client_side_validation && report_run_id.nil? fail ArgumentError, "Missing the required parameter 'report_run_id' when calling AdsApi.get_ad_insights_report" end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.get_ad_insights_report" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.get_ad_insights_report, must be smaller than or equal to 500.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.get_ad_insights_report, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/ads/insights/reports/{reportRunId}'.sub('{' + 'reportRunId' + '}', CGI.escape(report_run_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetAdInsightsReport200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_ad_insights_report", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_ad_insights_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_ad_previews(ad_id, opts = {}) ⇒ GetAdPreviews200Response
Render previews of an existing ad (Meta)
Renders an EXISTING ad per placement via Meta's /{ad_id}/previews. Each preview is an HTML <iframe> snippet embeddable directly. Unknown formats values return Meta's 400 verbatim. Meta only.
1948 1949 1950 1951 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1948 def get_ad_previews(ad_id, opts = {}) data, _status_code, _headers = get_ad_previews_with_http_info(ad_id, opts) data end |
#get_ad_previews_with_http_info(ad_id, opts = {}) ⇒ Array<(GetAdPreviews200Response, Integer, Hash)>
Render previews of an existing ad (Meta) Renders an EXISTING ad per placement via Meta's `/ad_id/previews`. Each preview is an HTML `<iframe>` snippet embeddable directly. Unknown `formats` values return Meta's 400 verbatim. Meta only.
1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1959 def get_ad_previews_with_http_info(ad_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_ad_previews ...' end # verify the required parameter 'ad_id' is set if @api_client.config.client_side_validation && ad_id.nil? fail ArgumentError, "Missing the required parameter 'ad_id' when calling AdsApi.get_ad_previews" end # resource path local_var_path = '/v1/ads/{adId}/preview'.sub('{' + 'adId' + '}', CGI.escape(ad_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'formats'] = opts[:'formats'] if !opts[:'formats'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetAdPreviews200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_ad_previews", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_ad_previews\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_ad_tracking_tags(ad_id, opts = {}) ⇒ GetAdTrackingTags200Response
Get ad tracking tags
Unified read of the platform's native click-URL tracking params. - Meta (facebook/instagram): the creative's url_tags (and template_url_spec). - Google (googleads): the campaign's trackingUrlTemplate + finalUrlSuffix. Subject to the Google Ads API access-tier daily quota; bulk audits need Standard access. - LinkedIn (linkedinads): the campaign's Dynamic UTM dynamicValueParameters + customValueParameters. Returns 405 for platforms without a click-URL tracking surface (TikTok, X, Pinterest).
2013 2014 2015 2016 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2013 def (ad_id, opts = {}) data, _status_code, _headers = (ad_id, opts) data end |
#get_ad_tracking_tags_with_http_info(ad_id, opts = {}) ⇒ Array<(GetAdTrackingTags200Response, Integer, Hash)>
Get ad tracking tags Unified read of the platform's native click-URL tracking params. - Meta (facebook/instagram): the creative's `url_tags` (and template_url_spec). - Google (googleads): the campaign's `trackingUrlTemplate` + `finalUrlSuffix`. Subject to the Google Ads API access-tier daily quota; bulk audits need Standard access. - LinkedIn (linkedinads): the campaign's Dynamic UTM `dynamicValueParameters` + `customValueParameters`. Returns 405 for platforms without a click-URL tracking surface (TikTok, X, Pinterest).
2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2023 def (ad_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_ad_tracking_tags ...' end # verify the required parameter 'ad_id' is set if @api_client.config.client_side_validation && ad_id.nil? fail ArgumentError, "Missing the required parameter 'ad_id' when calling AdsApi.get_ad_tracking_tags" end # resource path local_var_path = '/v1/ads/{adId}/tracking-tags'.sub('{' + 'adId' + '}', CGI.escape(ad_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetAdTrackingTags200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_ad_tracking_tags", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_ad_tracking_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_ad_with_http_info(ad_id, opts = {}) ⇒ Array<(GetAd200Response, Integer, Hash)>
Get ad details Returns an ad with its creative, targeting, status, and performance metrics. The `adId` path segment accepts any identifier dialect Zernio indexes for the ad: - the Zernio internal `_id` (24-char hex) - Meta's numeric `platformAdId` (the value shipped in `comment.received` webhooks as `comment.ad.id`) - the creative's `effective_object_story_id` (`pageId_postId` shape, Facebook side) - the creative's `effective_instagram_media_id` (Instagram side) Any of the four resolve to the same ad. Caller doesn't need a translation step.
1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 1510 def get_ad_with_http_info(ad_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_ad ...' end # verify the required parameter 'ad_id' is set if @api_client.config.client_side_validation && ad_id.nil? fail ArgumentError, "Missing the required parameter 'ad_id' when calling AdsApi.get_ad" end # resource path local_var_path = '/v1/ads/{adId}'.sub('{' + 'adId' + '}', CGI.escape(ad_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetAd200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_ad", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_ad\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_ads_activity_log(account_id, ad_account_id, opts = {}) ⇒ GetAdsActivityLog200Response
Ad account change / audit log (Meta)
Account-level audit log from Meta's /act_X/activities: who changed what and when (creates, edits, status flips, budget changes...) with Meta's translated event names and the structured before/after in extra_data. Rows are returned verbatim. Meta has no server-side per-object filter on this edge, so objectId filters the returned page client-side (combine with paging to walk history for one campaign/ad set/ad). Meta only.
2082 2083 2084 2085 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2082 def get_ads_activity_log(account_id, ad_account_id, opts = {}) data, _status_code, _headers = get_ads_activity_log_with_http_info(account_id, ad_account_id, opts) data end |
#get_ads_activity_log_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(GetAdsActivityLog200Response, Integer, Hash)>
Ad account change / audit log (Meta) Account-level audit log from Meta's `/act_X/activities`: who changed what and when (creates, edits, status flips, budget changes...) with Meta's translated event names and the structured before/after in `extra_data`. Rows are returned verbatim. Meta has no server-side per-object filter on this edge, so `objectId` filters the returned page client-side (combine with paging to walk history for one campaign/ad set/ad). Meta only.
2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2098 def get_ads_activity_log_with_http_info(account_id, ad_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_ads_activity_log ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.get_ads_activity_log" end # verify the required parameter 'ad_account_id' is set if @api_client.config.client_side_validation && ad_account_id.nil? fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdsApi.get_ads_activity_log" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 200 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.get_ads_activity_log, must be smaller than or equal to 200.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.get_ads_activity_log, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/ads/activity' # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'adAccountId'] = ad_account_id query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? query_params[:'until'] = opts[:'_until'] if !opts[:'_until'].nil? query_params[:'objectId'] = opts[:'object_id'] if !opts[:'object_id'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetAdsActivityLog200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_ads_activity_log", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_ads_activity_log\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_campaign_analytics(campaign_id, opts = {}) ⇒ GetCampaignAnalytics200Response
Get campaign analytics
Returns performance analytics for a whole campaign in one call: summary metrics, a daily timeline over the requested date range (summed across the campaign's ads), and optional demographic breakdowns. Breakdowns are fetched live from Meta at the campaign level (one call per dimension, no per-ad fan-out), so an agency dashboard gets campaign-level age/gender/etc. without summing thousands of per-ad reads. campaignId is the platform campaign id; pass platform when a campaign id could be ambiguous across platforms. If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max.
2174 2175 2176 2177 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2174 def get_campaign_analytics(campaign_id, opts = {}) data, _status_code, _headers = get_campaign_analytics_with_http_info(campaign_id, opts) data end |
#get_campaign_analytics_with_http_info(campaign_id, opts = {}) ⇒ Array<(GetCampaignAnalytics200Response, Integer, Hash)>
Get campaign analytics Returns performance analytics for a whole campaign in one call: summary metrics, a daily timeline over the requested date range (summed across the campaign's ads), and optional demographic breakdowns. Breakdowns are fetched live from Meta at the campaign level (one call per dimension, no per-ad fan-out), so an agency dashboard gets campaign-level age/gender/etc. without summing thousands of per-ad reads. `campaignId` is the platform campaign id; pass `platform` when a campaign id could be ambiguous across platforms. If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max.
2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2188 def get_campaign_analytics_with_http_info(campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_campaign_analytics ...' end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling AdsApi.get_campaign_analytics" end # resource path local_var_path = '/v1/ads/campaigns/{campaignId}/analytics'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil? query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil? query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil? query_params[:'breakdowns'] = opts[:'breakdowns'] if !opts[:'breakdowns'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetCampaignAnalytics200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_campaign_analytics", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_campaign_analytics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_conversion_destination(account_id, destination_id, ad_account_id, opts = {}) ⇒ GetConversionDestination200Response
Get a conversion destination
LinkedIn-only today. Returns the full destination record for one conversion rule. The adAccountId query parameter is required because LinkedIn rules are scoped to a sponsored ad account.
2247 2248 2249 2250 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2247 def get_conversion_destination(account_id, destination_id, ad_account_id, opts = {}) data, _status_code, _headers = get_conversion_destination_with_http_info(account_id, destination_id, ad_account_id, opts) data end |
#get_conversion_destination_with_http_info(account_id, destination_id, ad_account_id, opts = {}) ⇒ Array<(GetConversionDestination200Response, Integer, Hash)>
Get a conversion destination LinkedIn-only today. Returns the full destination record for one conversion rule. The `adAccountId` query parameter is required because LinkedIn rules are scoped to a sponsored ad account.
2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2259 def get_conversion_destination_with_http_info(account_id, destination_id, ad_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_conversion_destination ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.get_conversion_destination" end # verify the required parameter 'destination_id' is set if @api_client.config.client_side_validation && destination_id.nil? fail ArgumentError, "Missing the required parameter 'destination_id' when calling AdsApi.get_conversion_destination" end # verify the required parameter 'ad_account_id' is set if @api_client.config.client_side_validation && ad_account_id.nil? fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdsApi.get_conversion_destination" end # resource path local_var_path = '/v1/accounts/{accountId}/conversion-destinations/{destinationId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'destinationId' + '}', CGI.escape(destination_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'adAccountId'] = ad_account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetConversionDestination200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_conversion_destination", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_conversion_destination\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_conversion_metrics(account_id, destination_id, ad_account_id, start_date, opts = {}) ⇒ GetConversionMetrics200Response
Get attribution metrics
LinkedIn-only today. Returns conversion-attribution metrics (externalWebsiteConversions, externalWebsitePostClickConversions, externalWebsitePostViewConversions, conversionValueInLocalCurrency, qualifiedLeads, costInLocalCurrency) bucketed by date. Date-range constraints (passed through from LinkedIn): - granularity=DAILY is retained for ~6 months only - granularity=ALL with a range > 6 months auto-rounds to month boundaries - granularity=MONTHLY/YEARLY retains 24 months Throttle: LinkedIn caps adAnalytics at 45M metric values per 5-minute window across the calling token. Single-rule queries are well within that limit; surfaces as 429 if hit.
2326 2327 2328 2329 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2326 def get_conversion_metrics(account_id, destination_id, ad_account_id, start_date, opts = {}) data, _status_code, _headers = get_conversion_metrics_with_http_info(account_id, destination_id, ad_account_id, start_date, opts) data end |
#get_conversion_metrics_with_http_info(account_id, destination_id, ad_account_id, start_date, opts = {}) ⇒ Array<(GetConversionMetrics200Response, Integer, Hash)>
Get attribution metrics LinkedIn-only today. Returns conversion-attribution metrics (`externalWebsiteConversions`, `externalWebsitePostClickConversions`, `externalWebsitePostViewConversions`, `conversionValueInLocalCurrency`, `qualifiedLeads`, `costInLocalCurrency`) bucketed by date. Date-range constraints (passed through from LinkedIn): - `granularity=DAILY` is retained for ~6 months only - `granularity=ALL` with a range > 6 months auto-rounds to month boundaries - `granularity=MONTHLY`/`YEARLY` retains 24 months Throttle: LinkedIn caps adAnalytics at 45M metric values per 5-minute window across the calling token. Single-rule queries are well within that limit; surfaces as 429 if hit.
2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2341 def get_conversion_metrics_with_http_info(account_id, destination_id, ad_account_id, start_date, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_conversion_metrics ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.get_conversion_metrics" end # verify the required parameter 'destination_id' is set if @api_client.config.client_side_validation && destination_id.nil? fail ArgumentError, "Missing the required parameter 'destination_id' when calling AdsApi.get_conversion_metrics" end # verify the required parameter 'ad_account_id' is set if @api_client.config.client_side_validation && ad_account_id.nil? fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdsApi.get_conversion_metrics" end # verify the required parameter 'start_date' is set if @api_client.config.client_side_validation && start_date.nil? fail ArgumentError, "Missing the required parameter 'start_date' when calling AdsApi.get_conversion_metrics" end pattern = Regexp.new(/^\\d{4}-\\d{2}-\\d{2}$/) if @api_client.config.client_side_validation && start_date !~ pattern fail ArgumentError, "invalid value for 'start_date' when calling AdsApi.get_conversion_metrics, must conform to the pattern #{pattern}." end pattern = Regexp.new(/^\\d{4}-\\d{2}-\\d{2}$/) if @api_client.config.client_side_validation && !opts[:'end_date'].nil? && opts[:'end_date'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"end_date\"]' when calling AdsApi.get_conversion_metrics, must conform to the pattern #{pattern}." end allowable_values = ["ALL", "DAILY", "MONTHLY", "YEARLY"] if @api_client.config.client_side_validation && opts[:'granularity'] && !allowable_values.include?(opts[:'granularity']) fail ArgumentError, "invalid value for \"granularity\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/accounts/{accountId}/conversion-destinations/{destinationId}/metrics'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'destinationId' + '}', CGI.escape(destination_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'adAccountId'] = ad_account_id query_params[:'startDate'] = start_date query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? query_params[:'granularity'] = opts[:'granularity'] if !opts[:'granularity'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetConversionMetrics200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_conversion_metrics", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_conversion_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_conversions_quality(account_id, destination_id, opts = {}) ⇒ GetConversionsQuality200Response
Get Event Match Quality Reads Meta Event Match Quality (EMQ) and pixel↔CAPI event coverage for a pixel/dataset, live from Meta's Dataset Quality API. Web events only (a Meta limitation). Meta-only; other platforms return 405. Requires the Ads add-on.
2425 2426 2427 2428 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2425 def get_conversions_quality(account_id, destination_id, opts = {}) data, _status_code, _headers = get_conversions_quality_with_http_info(account_id, destination_id, opts) data end |
#get_conversions_quality_with_http_info(account_id, destination_id, opts = {}) ⇒ Array<(GetConversionsQuality200Response, Integer, Hash)>
Get Event Match Quality Reads Meta Event Match Quality (EMQ) and pixel↔CAPI event coverage for a pixel/dataset, live from Meta's Dataset Quality API. Web events only (a Meta limitation). Meta-only; other platforms return 405. Requires the Ads add-on.
2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2436 def get_conversions_quality_with_http_info(account_id, destination_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_conversions_quality ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.get_conversions_quality" end # verify the required parameter 'destination_id' is set if @api_client.config.client_side_validation && destination_id.nil? fail ArgumentError, "Missing the required parameter 'destination_id' when calling AdsApi.get_conversions_quality" end # resource path local_var_path = '/v1/ads/conversions/quality' # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'destinationId'] = destination_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetConversionsQuality200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_conversions_quality", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_conversions_quality\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_dsa_defaults(account_id, ad_account_id, opts = {}) ⇒ UpdateAdAccount200Response
Get ad account DSA defaults
Returns the default DSA beneficiary and payor currently set on a Meta ad account, whether they were set via PATCH /v1/ads/accounts or in Meta Ads Manager. Fields are omitted when no default is configured. Meta accounts only.
2496 2497 2498 2499 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2496 def get_dsa_defaults(account_id, ad_account_id, opts = {}) data, _status_code, _headers = get_dsa_defaults_with_http_info(account_id, ad_account_id, opts) data end |
#get_dsa_defaults_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(UpdateAdAccount200Response, Integer, Hash)>
Get ad account DSA defaults Returns the default DSA beneficiary and payor currently set on a Meta ad account, whether they were set via `PATCH /v1/ads/accounts` or in Meta Ads Manager. Fields are omitted when no default is configured. Meta accounts only.
2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2507 def get_dsa_defaults_with_http_info(account_id, ad_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_dsa_defaults ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.get_dsa_defaults" end # verify the required parameter 'ad_account_id' is set if @api_client.config.client_side_validation && ad_account_id.nil? fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdsApi.get_dsa_defaults" end # resource path local_var_path = '/v1/ads/dsa-defaults' # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'adAccountId'] = ad_account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'UpdateAdAccount200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_dsa_defaults", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_dsa_defaults\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_dsa_recommendations(account_id, ad_account_id, opts = {}) ⇒ GetDsaRecommendations200Response
List DSA beneficiary/payor suggestions
Returns Meta's suggested beneficiary/payor names for an ad account, derived by Meta from the account's recent activity. Useful for prefilling dsaBeneficiary/dsaPayor inputs, or the defaults sent to PATCH /v1/ads/accounts, in your own UI. Meta returns a single flat list. Entries are not labeled as beneficiary or payor, and since these are legal disclosures Zernio never applies them automatically: let your user pick the right entity. The list may be empty for accounts with little activity. Meta accounts only.
2567 2568 2569 2570 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2567 def get_dsa_recommendations(account_id, ad_account_id, opts = {}) data, _status_code, _headers = get_dsa_recommendations_with_http_info(account_id, ad_account_id, opts) data end |
#get_dsa_recommendations_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(GetDsaRecommendations200Response, Integer, Hash)>
List DSA beneficiary/payor suggestions Returns Meta's suggested beneficiary/payor names for an ad account, derived by Meta from the account's recent activity. Useful for prefilling `dsaBeneficiary`/`dsaPayor` inputs, or the defaults sent to `PATCH /v1/ads/accounts`, in your own UI. Meta returns a single flat list. Entries are not labeled as beneficiary or payor, and since these are legal disclosures Zernio never applies them automatically: let your user pick the right entity. The list may be empty for accounts with little activity. Meta accounts only.
2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2578 def get_dsa_recommendations_with_http_info(account_id, ad_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_dsa_recommendations ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.get_dsa_recommendations" end # verify the required parameter 'ad_account_id' is set if @api_client.config.client_side_validation && ad_account_id.nil? fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdsApi.get_dsa_recommendations" end # resource path local_var_path = '/v1/ads/dsa-recommendations' # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'adAccountId'] = ad_account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetDsaRecommendations200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_dsa_recommendations", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_dsa_recommendations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_lead_form(form_id, account_id, opts = {}) ⇒ GetLeadForm200Response
Get a lead form
2637 2638 2639 2640 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2637 def get_lead_form(form_id, account_id, opts = {}) data, _status_code, _headers = get_lead_form_with_http_info(form_id, account_id, opts) data end |
#get_lead_form_with_http_info(form_id, account_id, opts = {}) ⇒ Array<(GetLeadForm200Response, Integer, Hash)>
Get a lead form
2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2647 def get_lead_form_with_http_info(form_id, account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_lead_form ...' end # verify the required parameter 'form_id' is set if @api_client.config.client_side_validation && form_id.nil? fail ArgumentError, "Missing the required parameter 'form_id' when calling AdsApi.get_lead_form" end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.get_lead_form" end # resource path local_var_path = '/v1/ads/lead-forms/{formId}'.sub('{' + 'formId' + '}', CGI.escape(form_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetLeadForm200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_lead_form", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_lead_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_linked_in_bid_pricing(get_linked_in_bid_pricing_request, opts = {}) ⇒ GetLinkedInBidPricing200Response
Suggested bid and budget bounds (LinkedIn)
LinkedIn-only. Returns the suggested bid and bid limits for a targeting spec, plus the daily-budget bounds LinkedIn will accept. Use it before creating a campaign to pick a bid inside the allowed range and warn the user if their daily budget is below the minimum. Wraps LinkedIn's adBudgetPricing finder. Non-LinkedIn accounts return available: false so clients can hide the pricing UI without treating it as a failure.
2705 2706 2707 2708 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2705 def get_linked_in_bid_pricing(get_linked_in_bid_pricing_request, opts = {}) data, _status_code, _headers = get_linked_in_bid_pricing_with_http_info(get_linked_in_bid_pricing_request, opts) data end |
#get_linked_in_bid_pricing_with_http_info(get_linked_in_bid_pricing_request, opts = {}) ⇒ Array<(GetLinkedInBidPricing200Response, Integer, Hash)>
Suggested bid and budget bounds (LinkedIn) LinkedIn-only. Returns the suggested bid and bid limits for a targeting spec, plus the daily-budget bounds LinkedIn will accept. Use it before creating a campaign to pick a bid inside the allowed range and warn the user if their daily budget is below the minimum. Wraps LinkedIn's `adBudgetPricing` finder. Non-LinkedIn accounts return `available: false` so clients can hide the pricing UI without treating it as a failure.
2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2715 def get_linked_in_bid_pricing_with_http_info(get_linked_in_bid_pricing_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_linked_in_bid_pricing ...' end # verify the required parameter 'get_linked_in_bid_pricing_request' is set if @api_client.config.client_side_validation && get_linked_in_bid_pricing_request.nil? fail ArgumentError, "Missing the required parameter 'get_linked_in_bid_pricing_request' when calling AdsApi.get_linked_in_bid_pricing" end # resource path local_var_path = '/v1/ads/targeting/bid-pricing' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(get_linked_in_bid_pricing_request) # return_type return_type = opts[:debug_return_type] || 'GetLinkedInBidPricing200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_linked_in_bid_pricing", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_linked_in_bid_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_linked_in_supply_forecast(get_linked_in_supply_forecast_request, opts = {}) ⇒ GetLinkedInSupplyForecast200Response
Impressions, clicks and spend forecast (LinkedIn)
LinkedIn-only. Forecasted impressions, clicks, spend and ~20 other metrics for a targeting spec over a time range. Wraps LinkedIn's adSupplyForecasts finder. Each returned series carries a metricType (IMPRESSION, CLICK, SPENDING, MAX_POTENTIAL_BUDGET, COST_PER_MILLION_IMPRESSIONS, ...) and a granularity (DAILY, SEVEN_DAY, THIRTY_DAY, CUSTOM). LinkedIn caps the daily spending forecast at 1.2x the daily budget and returns 0 once the total budget is exhausted. Non-LinkedIn accounts return available: false.
2773 2774 2775 2776 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2773 def get_linked_in_supply_forecast(get_linked_in_supply_forecast_request, opts = {}) data, _status_code, _headers = get_linked_in_supply_forecast_with_http_info(get_linked_in_supply_forecast_request, opts) data end |
#get_linked_in_supply_forecast_with_http_info(get_linked_in_supply_forecast_request, opts = {}) ⇒ Array<(GetLinkedInSupplyForecast200Response, Integer, Hash)>
Impressions, clicks and spend forecast (LinkedIn) LinkedIn-only. Forecasted impressions, clicks, spend and ~20 other metrics for a targeting spec over a time range. Wraps LinkedIn's `adSupplyForecasts` finder. Each returned series carries a `metricType` (IMPRESSION, CLICK, SPENDING, MAX_POTENTIAL_BUDGET, COST_PER_MILLION_IMPRESSIONS, ...) and a `granularity` (DAILY, SEVEN_DAY, THIRTY_DAY, CUSTOM). LinkedIn caps the daily spending forecast at 1.2x the daily budget and returns 0 once the total budget is exhausted. Non-LinkedIn accounts return `available: false`.
2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2783 def get_linked_in_supply_forecast_with_http_info(get_linked_in_supply_forecast_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_linked_in_supply_forecast ...' end # verify the required parameter 'get_linked_in_supply_forecast_request' is set if @api_client.config.client_side_validation && get_linked_in_supply_forecast_request.nil? fail ArgumentError, "Missing the required parameter 'get_linked_in_supply_forecast_request' when calling AdsApi.get_linked_in_supply_forecast" end # resource path local_var_path = '/v1/ads/targeting/supply-forecast' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(get_linked_in_supply_forecast_request) # return_type return_type = opts[:debug_return_type] || 'GetLinkedInSupplyForecast200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_linked_in_supply_forecast", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_linked_in_supply_forecast\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_rf_prediction(prediction_id, account_id, ad_account_id, opts = {}) ⇒ CreateRfPrediction201Response
Read a Reach & Frequency prediction (Meta)
2842 2843 2844 2845 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2842 def get_rf_prediction(prediction_id, account_id, ad_account_id, opts = {}) data, _status_code, _headers = get_rf_prediction_with_http_info(prediction_id, account_id, ad_account_id, opts) data end |
#get_rf_prediction_with_http_info(prediction_id, account_id, ad_account_id, opts = {}) ⇒ Array<(CreateRfPrediction201Response, Integer, Hash)>
Read a Reach & Frequency prediction (Meta)
2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2853 def get_rf_prediction_with_http_info(prediction_id, account_id, ad_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.get_rf_prediction ...' end # verify the required parameter 'prediction_id' is set if @api_client.config.client_side_validation && prediction_id.nil? fail ArgumentError, "Missing the required parameter 'prediction_id' when calling AdsApi.get_rf_prediction" end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.get_rf_prediction" end # verify the required parameter 'ad_account_id' is set if @api_client.config.client_side_validation && ad_account_id.nil? fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdsApi.get_rf_prediction" end # resource path local_var_path = '/v1/ads/rf-predictions/{predictionId}'.sub('{' + 'predictionId' + '}', CGI.escape(prediction_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'adAccountId'] = ad_account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CreateRfPrediction201Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.get_rf_prediction", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#get_rf_prediction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_ad_accounts(account_id, opts = {}) ⇒ ListAdAccounts200Response
List ad accounts
Returns the platform ad accounts available for the given social account (e.g. Meta ad accounts, TikTok advertiser IDs, Google Ads customer IDs). For TikTok agencies: enumerates every advertiser under every Business Center the token can read (paginated server-side), then chunks the lookup against TikTok's /advertiser/info/ endpoint (which has a per-call cap of ≤100 IDs). Solo advertisers without a BC fall back to the OAuth-time advertiser_ids list. Cached for 1h on the SocialAccount; lazy-refreshed on first call after expiry.
2918 2919 2920 2921 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2918 def list_ad_accounts(account_id, opts = {}) data, _status_code, _headers = list_ad_accounts_with_http_info(account_id, opts) data end |
#list_ad_accounts_with_http_info(account_id, opts = {}) ⇒ Array<(ListAdAccounts200Response, Integer, Hash)>
List ad accounts Returns the platform ad accounts available for the given social account (e.g. Meta ad accounts, TikTok advertiser IDs, Google Ads customer IDs). For TikTok agencies: enumerates every advertiser under every Business Center the token can read (paginated server-side), then chunks the lookup against TikTok's `/advertiser/info/` endpoint (which has a per-call cap of ≤100 IDs). Solo advertisers without a BC fall back to the OAuth-time `advertiser_ids` list. Cached for 1h on the SocialAccount; lazy-refreshed on first call after expiry.
2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2930 def list_ad_accounts_with_http_info(account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.list_ad_accounts ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.list_ad_accounts" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_ad_accounts, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_ad_accounts, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/ads/accounts' # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'adAccountId'] = opts[:'ad_account_id'] if !opts[:'ad_account_id'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListAdAccounts200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.list_ad_accounts", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#list_ad_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_ad_catalog_product_sets(catalog_id, account_id, opts = {}) ⇒ ListAdCatalogProductSets200Response
List a catalog's product sets
Lists a Meta product catalog's product sets — the unit a catalog ad promotes. Pass the chosen set as promotedObject.productSetId on POST /v1/ads/create with goal: catalog_sales.
2995 2996 2997 2998 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 2995 def list_ad_catalog_product_sets(catalog_id, account_id, opts = {}) data, _status_code, _headers = list_ad_catalog_product_sets_with_http_info(catalog_id, account_id, opts) data end |
#list_ad_catalog_product_sets_with_http_info(catalog_id, account_id, opts = {}) ⇒ Array<(ListAdCatalogProductSets200Response, Integer, Hash)>
List a catalog's product sets Lists a Meta product catalog's product sets — the unit a catalog ad promotes. Pass the chosen set as `promotedObject.productSetId` on POST /v1/ads/create with `goal: catalog_sales`.
3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3006 def list_ad_catalog_product_sets_with_http_info(catalog_id, account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.list_ad_catalog_product_sets ...' end # verify the required parameter 'catalog_id' is set if @api_client.config.client_side_validation && catalog_id.nil? fail ArgumentError, "Missing the required parameter 'catalog_id' when calling AdsApi.list_ad_catalog_product_sets" end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.list_ad_catalog_product_sets" end # resource path local_var_path = '/v1/ads/catalogs/{catalogId}/product-sets'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListAdCatalogProductSets200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.list_ad_catalog_product_sets", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#list_ad_catalog_product_sets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_ad_catalogs(account_id, ad_account_id, opts = {}) ⇒ ListAdCatalogs200Response
List Meta product catalogs
Lists the Meta product catalogs reachable from an ad account (owned + agency-shared catalogs of the ad account's business), for Advantage+ catalog ads (goal: catalog_sales on POST /v1/ads/create — e.g. vehicle inventory catalogs). Read-only; uses scopes customers already granted (no reconnect needed). Catalog contents (items, feeds) are managed in Meta Commerce Manager, not through this API.
3065 3066 3067 3068 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3065 def list_ad_catalogs(account_id, ad_account_id, opts = {}) data, _status_code, _headers = list_ad_catalogs_with_http_info(account_id, ad_account_id, opts) data end |
#list_ad_catalogs_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(ListAdCatalogs200Response, Integer, Hash)>
List Meta product catalogs Lists the Meta product catalogs reachable from an ad account (owned + agency-shared catalogs of the ad account's business), for Advantage+ catalog ads (`goal: catalog_sales` on POST /v1/ads/create — e.g. vehicle inventory catalogs). Read-only; uses scopes customers already granted (no reconnect needed). Catalog contents (items, feeds) are managed in Meta Commerce Manager, not through this API.
3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3076 def list_ad_catalogs_with_http_info(account_id, ad_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.list_ad_catalogs ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.list_ad_catalogs" end # verify the required parameter 'ad_account_id' is set if @api_client.config.client_side_validation && ad_account_id.nil? fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdsApi.list_ad_catalogs" end # resource path local_var_path = '/v1/ads/catalogs' # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'adAccountId'] = ad_account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListAdCatalogs200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.list_ad_catalogs", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#list_ad_catalogs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_ad_creatives(account_id, ad_account_id, opts = {}) ⇒ ListAdCreatives200Response
Creative library (Meta)
Lists the ad account's creative library (Meta's /act_X/adcreatives), rows returned verbatim. The default projection covers id, name, status, object type, thumbnail, object_story_spec / asset_feed_spec and url_tags; fields is a raw-passthrough override. Any creative id here is reusable on the create endpoints via existingCreativeId. Meta only.
3139 3140 3141 3142 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3139 def list_ad_creatives(account_id, ad_account_id, opts = {}) data, _status_code, _headers = list_ad_creatives_with_http_info(account_id, ad_account_id, opts) data end |
#list_ad_creatives_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(ListAdCreatives200Response, Integer, Hash)>
Creative library (Meta) Lists the ad account's creative library (Meta's `/act_X/adcreatives`), rows returned verbatim. The default projection covers id, name, status, object type, thumbnail, object_story_spec / asset_feed_spec and url_tags; `fields` is a raw-passthrough override. Any creative id here is reusable on the create endpoints via `existingCreativeId`. Meta only.
3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3153 def list_ad_creatives_with_http_info(account_id, ad_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.list_ad_creatives ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.list_ad_creatives" end # verify the required parameter 'ad_account_id' is set if @api_client.config.client_side_validation && ad_account_id.nil? fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdsApi.list_ad_creatives" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_ad_creatives, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_ad_creatives, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/ads/creatives' # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'adAccountId'] = ad_account_id query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListAdCreatives200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.list_ad_creatives", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#list_ad_creatives\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_ad_images(account_id, ad_account_id, opts = {}) ⇒ ListAdImages200Response
Ad image library (Meta)
Lists the ad account's image library (Meta's /act_X/adimages), rows returned verbatim. The default projection covers hash, url, name, dimensions and status; fields is a raw-passthrough override. Any hash here is reusable wherever Meta accepts image_hash (e.g. imageHash on POST /v1/ads/creatives). Meta only.
3227 3228 3229 3230 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3227 def list_ad_images(account_id, ad_account_id, opts = {}) data, _status_code, _headers = list_ad_images_with_http_info(account_id, ad_account_id, opts) data end |
#list_ad_images_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(ListAdImages200Response, Integer, Hash)>
Ad image library (Meta) Lists the ad account's image library (Meta's `/act_X/adimages`), rows returned verbatim. The default projection covers hash, url, name, dimensions and status; `fields` is a raw-passthrough override. Any `hash` here is reusable wherever Meta accepts `image_hash` (e.g. `imageHash` on POST /v1/ads/creatives). Meta only.
3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3241 def list_ad_images_with_http_info(account_id, ad_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.list_ad_images ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.list_ad_images" end # verify the required parameter 'ad_account_id' is set if @api_client.config.client_side_validation && ad_account_id.nil? fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdsApi.list_ad_images" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_ad_images, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_ad_images, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/ads/images' # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'adAccountId'] = ad_account_id query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListAdImages200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.list_ad_images", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#list_ad_images\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_ad_labels(account_id, ad_account_id, opts = {}) ⇒ ListAdLabels200Response
Ad labels (Meta)
Lists the ad account's organizational labels (Meta's /act_X/adlabels), rows returned verbatim (id, name, created/updated time). Meta only.
3314 3315 3316 3317 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3314 def list_ad_labels(account_id, ad_account_id, opts = {}) data, _status_code, _headers = list_ad_labels_with_http_info(account_id, ad_account_id, opts) data end |
#list_ad_labels_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(ListAdLabels200Response, Integer, Hash)>
Ad labels (Meta) Lists the ad account's organizational labels (Meta's `/act_X/adlabels`), rows returned verbatim (id, name, created/updated time). Meta only.
3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3327 def list_ad_labels_with_http_info(account_id, ad_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.list_ad_labels ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.list_ad_labels" end # verify the required parameter 'ad_account_id' is set if @api_client.config.client_side_validation && ad_account_id.nil? fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdsApi.list_ad_labels" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_ad_labels, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_ad_labels, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/ads/labels' # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'adAccountId'] = ad_account_id query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListAdLabels200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.list_ad_labels", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#list_ad_labels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_ad_studies(account_id, ad_account_id, opts = {}) ⇒ ListAdStudies200Response
A/B tests and lift studies (Meta)
Lists the ad account's A/B tests and lift studies (Meta's /act_X/ad_studies), rows returned verbatim. The default projection covers id, name, type, timing and cells with split percentages; fields is a raw-passthrough override. Meta only.
3400 3401 3402 3403 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3400 def list_ad_studies(account_id, ad_account_id, opts = {}) data, _status_code, _headers = list_ad_studies_with_http_info(account_id, ad_account_id, opts) data end |
#list_ad_studies_with_http_info(account_id, ad_account_id, opts = {}) ⇒ Array<(ListAdStudies200Response, Integer, Hash)>
A/B tests and lift studies (Meta) Lists the ad account's A/B tests and lift studies (Meta's `/act_X/ad_studies`), rows returned verbatim. The default projection covers id, name, type, timing and cells with split percentages; `fields` is a raw-passthrough override. Meta only.
3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3414 def list_ad_studies_with_http_info(account_id, ad_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.list_ad_studies ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.list_ad_studies" end # verify the required parameter 'ad_account_id' is set if @api_client.config.client_side_validation && ad_account_id.nil? fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdsApi.list_ad_studies" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_ad_studies, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_ad_studies, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/ads/studies' # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'adAccountId'] = ad_account_id query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListAdStudies200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.list_ad_studies", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#list_ad_studies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_ads(opts = {}) ⇒ ListAds200Response
List ads
Returns a paginated list of ads with metrics computed over an optional date range. Use source=all to include externally-synced ads from platform ad managers. If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max. To find the Zernio ad behind a comment you see in Meta Business Manager, filter by platformAdId (the Meta ad ID), effectiveObjectStoryId (Facebook), or effectiveInstagramMediaId (Instagram) — those are the post/media the ad's engagement lives on, and are also returned on each ad's creative object. Then call GET /v1/ads/adId/comments with the returned ad id.
3497 3498 3499 3500 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3497 def list_ads(opts = {}) data, _status_code, _headers = list_ads_with_http_info(opts) data end |
#list_ads_business_centers(account_id, opts = {}) ⇒ ListAdsBusinessCenters200Response
List TikTok Business Centers
Returns the TikTok Business Centers (BCs) the connected tiktokads account can read. Each BC reports its advertiser count so callers can build agency-style pickers without re-walking /v1/ads/accounts per BC. TikTok-only. Solo advertisers (non-agency tokens) return an empty array.
3603 3604 3605 3606 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3603 def list_ads_business_centers(account_id, opts = {}) data, _status_code, _headers = list_ads_business_centers_with_http_info(account_id, opts) data end |
#list_ads_business_centers_with_http_info(account_id, opts = {}) ⇒ Array<(ListAdsBusinessCenters200Response, Integer, Hash)>
List TikTok Business Centers Returns the TikTok Business Centers (BCs) the connected `tiktokads` account can read. Each BC reports its advertiser count so callers can build agency-style pickers without re-walking `/v1/ads/accounts` per BC. TikTok-only. Solo advertisers (non-agency tokens) return an empty array.
3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3613 def list_ads_business_centers_with_http_info(account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.list_ads_business_centers ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.list_ads_business_centers" end # resource path local_var_path = '/v1/ads/business-centers' # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListAdsBusinessCenters200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.list_ads_business_centers", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#list_ads_business_centers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_ads_with_http_info(opts = {}) ⇒ Array<(ListAds200Response, Integer, Hash)>
List ads Returns a paginated list of ads with metrics computed over an optional date range. Use source=all to include externally-synced ads from platform ad managers. If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max. To find the Zernio ad behind a comment you see in Meta Business Manager, filter by platformAdId (the Meta ad ID), effectiveObjectStoryId (Facebook), or effectiveInstagramMediaId (Instagram) — those are the post/media the ad's engagement lives on, and are also returned on each ad's `creative` object. Then call GET /v1/ads/adId/comments with the returned ad id.
3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3520 def list_ads_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.list_ads ...' end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AdsApi.list_ads, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_ads, must be smaller than or equal to 500.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_ads, must be greater than or equal to 1.' end allowable_values = ["zernio", "all"] if @api_client.config.client_side_validation && opts[:'source'] && !allowable_values.include?(opts[:'source']) fail ArgumentError, "invalid value for \"source\", must be one of #{allowable_values}" end allowable_values = ["facebook", "instagram", "tiktok", "linkedin", "pinterest", "google", "twitter"] if @api_client.config.client_side_validation && opts[:'platform'] && !allowable_values.include?(opts[:'platform']) fail ArgumentError, "invalid value for \"platform\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/ads' # query parameters query_params = opts[:query_params] || {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil? query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil? query_params[:'adAccountId'] = opts[:'ad_account_id'] if !opts[:'ad_account_id'].nil? query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil? query_params[:'campaignId'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil? query_params[:'platformAdId'] = opts[:'platform_ad_id'] if !opts[:'platform_ad_id'].nil? query_params[:'effectiveObjectStoryId'] = opts[:'effective_object_story_id'] if !opts[:'effective_object_story_id'].nil? query_params[:'effectiveInstagramMediaId'] = opts[:'effective_instagram_media_id'] if !opts[:'effective_instagram_media_id'].nil? query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil? query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListAds200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.list_ads", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#list_ads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_conversion_associations(account_id, destination_id, ad_account_id, opts = {}) ⇒ ListConversionAssociations200Response
List associated campaigns LinkedIn-only today. Returns the campaigns currently associated with this conversion rule. Note that auto-association on rule creation runs once at create time; campaigns created after the rule still need explicit association.
3669 3670 3671 3672 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3669 def list_conversion_associations(account_id, destination_id, ad_account_id, opts = {}) data, _status_code, _headers = list_conversion_associations_with_http_info(account_id, destination_id, ad_account_id, opts) data end |
#list_conversion_associations_with_http_info(account_id, destination_id, ad_account_id, opts = {}) ⇒ Array<(ListConversionAssociations200Response, Integer, Hash)>
List associated campaigns LinkedIn-only today. Returns the campaigns currently associated with this conversion rule. Note that auto-association on rule creation runs once at create time; campaigns created after the rule still need explicit association.
3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3681 def list_conversion_associations_with_http_info(account_id, destination_id, ad_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.list_conversion_associations ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.list_conversion_associations" end # verify the required parameter 'destination_id' is set if @api_client.config.client_side_validation && destination_id.nil? fail ArgumentError, "Missing the required parameter 'destination_id' when calling AdsApi.list_conversion_associations" end # verify the required parameter 'ad_account_id' is set if @api_client.config.client_side_validation && ad_account_id.nil? fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdsApi.list_conversion_associations" end # resource path local_var_path = '/v1/accounts/{accountId}/conversion-destinations/{destinationId}/associations'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'destinationId' + '}', CGI.escape(destination_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'adAccountId'] = ad_account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListConversionAssociations200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.list_conversion_associations", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#list_conversion_associations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_conversion_destinations(account_id, opts = {}) ⇒ ListConversionDestinations200Response
List conversion destinations
Returns the list of pixels (Meta), conversion actions (Google), or conversion rules (LinkedIn) accessible to the connected ads account. Use the returned id as destinationId when posting to POST /v1/ads/conversions. For Google and LinkedIn, each destination's type reflects the conversion type (PURCHASE, LEAD, SIGN_UP, etc.) — the event type is locked to the destination. For Meta, type is absent: pixels accept any event name per request. For LinkedIn, destinations are returned across every sponsored ad account the connected token can access; the adAccountId field on each destination identifies the parent ad account and is required for subsequent CRUD calls (update, delete, associations, metrics).
3743 3744 3745 3746 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3743 def list_conversion_destinations(account_id, opts = {}) data, _status_code, _headers = list_conversion_destinations_with_http_info(account_id, opts) data end |
#list_conversion_destinations_with_http_info(account_id, opts = {}) ⇒ Array<(ListConversionDestinations200Response, Integer, Hash)>
List conversion destinations Returns the list of pixels (Meta), conversion actions (Google), or conversion rules (LinkedIn) accessible to the connected ads account. Use the returned `id` as `destinationId` when posting to `POST /v1/ads/conversions`. For Google and LinkedIn, each destination's `type` reflects the conversion type (PURCHASE, LEAD, SIGN_UP, etc.) — the event type is locked to the destination. For Meta, `type` is absent: pixels accept any event name per request. For LinkedIn, destinations are returned across every sponsored ad account the connected token can access; the `adAccountId` field on each destination identifies the parent ad account and is required for subsequent CRUD calls (update, delete, associations, metrics).
3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3753 def list_conversion_destinations_with_http_info(account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.list_conversion_destinations ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.list_conversion_destinations" end # resource path local_var_path = '/v1/accounts/{accountId}/conversion-destinations'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListConversionDestinations200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.list_conversion_destinations", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#list_conversion_destinations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_form_leads(form_id, account_id, opts = {}) ⇒ ListFormLeads200Response
List leads for a single form Returns leads for one form. Serves persisted leads (ingested via the leadgen webhook) when available, falling back to a live Graph read.
3810 3811 3812 3813 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3810 def list_form_leads(form_id, account_id, opts = {}) data, _status_code, _headers = list_form_leads_with_http_info(form_id, account_id, opts) data end |
#list_form_leads_with_http_info(form_id, account_id, opts = {}) ⇒ Array<(ListFormLeads200Response, Integer, Hash)>
List leads for a single form Returns leads for one form. Serves persisted leads (ingested via the leadgen webhook) when available, falling back to a live Graph read.
3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3824 def list_form_leads_with_http_info(form_id, account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.list_form_leads ...' end # verify the required parameter 'form_id' is set if @api_client.config.client_side_validation && form_id.nil? fail ArgumentError, "Missing the required parameter 'form_id' when calling AdsApi.list_form_leads" end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.list_form_leads" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_form_leads, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_form_leads, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/ads/lead-forms/{formId}/leads'.sub('{' + 'formId' + '}', CGI.escape(form_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListFormLeads200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.list_form_leads", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#list_form_leads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_high_demand_periods(account_id, opts = {}) ⇒ ListHighDemandPeriods200Response
High demand periods / budget schedules (Meta)
Scheduled budget increases (Meta's budget-scheduling API). The Graph edge lives on the campaign and ad-set nodes only, so exactly one of campaignId / adSetId (platform ids) is required. Rows returned verbatim (budget_value, budget_value_type, time window, recurrence). Meta only.
3897 3898 3899 3900 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3897 def list_high_demand_periods(account_id, opts = {}) data, _status_code, _headers = list_high_demand_periods_with_http_info(account_id, opts) data end |
#list_high_demand_periods_with_http_info(account_id, opts = {}) ⇒ Array<(ListHighDemandPeriods200Response, Integer, Hash)>
High demand periods / budget schedules (Meta) Scheduled budget increases (Meta's budget-scheduling API). The Graph edge lives on the campaign and ad-set nodes only, so exactly one of `campaignId` / `adSetId` (platform ids) is required. Rows returned verbatim (budget_value, budget_value_type, time window, recurrence). Meta only.
3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3911 def list_high_demand_periods_with_http_info(account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.list_high_demand_periods ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.list_high_demand_periods" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_high_demand_periods, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_high_demand_periods, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/ads/high-demand-periods' # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'campaignId'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil? query_params[:'adSetId'] = opts[:'ad_set_id'] if !opts[:'ad_set_id'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListHighDemandPeriods200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.list_high_demand_periods", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#list_high_demand_periods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_lead_forms(account_id, opts = {}) ⇒ ListLeadForms200Response
List lead forms Lists the Lead Gen forms owned by the connected Facebook Page. Requires the Ads add-on.
3979 3980 3981 3982 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3979 def list_lead_forms(account_id, opts = {}) data, _status_code, _headers = list_lead_forms_with_http_info(account_id, opts) data end |
#list_lead_forms_with_http_info(account_id, opts = {}) ⇒ Array<(ListLeadForms200Response, Integer, Hash)>
List lead forms Lists the Lead Gen forms owned by the connected Facebook Page. Requires the Ads add-on.
3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 3991 def list_lead_forms_with_http_info(account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.list_lead_forms ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.list_lead_forms" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_lead_forms, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_lead_forms, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/ads/lead-forms' # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListLeadForms200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.list_lead_forms", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#list_lead_forms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_leads(opts = {}) ⇒ ListLeads200Response
List submitted leads
Returns persisted Meta Lead Gen leads for your team, newest-first, with keyset pagination on cursor. Leads are ingested in real time from the leadgen webhook. Requires the Ads add-on.
4059 4060 4061 4062 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4059 def list_leads(opts = {}) data, _status_code, _headers = list_leads_with_http_info(opts) data end |
#list_leads_with_http_info(opts = {}) ⇒ Array<(ListLeads200Response, Integer, Hash)>
List submitted leads Returns persisted Meta Lead Gen leads for your team, newest-first, with keyset pagination on `cursor`. Leads are ingested in real time from the `leadgen` webhook. Requires the Ads add-on.
4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4073 def list_leads_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.list_leads ...' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_leads, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_leads, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/ads/leads' # query parameters query_params = opts[:query_params] || {} query_params[:'formId'] = opts[:'form_id'] if !opts[:'form_id'].nil? query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListLeads200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.list_leads", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#list_leads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_whats_app_conversions(account_id, opts = {}) ⇒ ListWhatsAppConversions200Response
List conversion events
Returns the most recent conversion events sent through POST /v1/whatsapp/conversions for the given WhatsApp account. Sourced from delivery logs (Axiom late dataset), so the visible window is bounded by log retention (about 30 days). Useful for rendering a "recent activity" panel on the conversions setup tab without standing up a parallel persistence layer. Per-event payload mirrors the structured log we write on every successful send: eventName, conversationId, eventsReceived, eventsFailed, traceId, durationMs, and the wall-clock timestamp.
4136 4137 4138 4139 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4136 def list_whats_app_conversions(account_id, opts = {}) data, _status_code, _headers = list_whats_app_conversions_with_http_info(account_id, opts) data end |
#list_whats_app_conversions_with_http_info(account_id, opts = {}) ⇒ Array<(ListWhatsAppConversions200Response, Integer, Hash)>
List conversion events Returns the most recent conversion events sent through `POST /v1/whatsapp/conversions` for the given WhatsApp account. Sourced from delivery logs (Axiom `late` dataset), so the visible window is bounded by log retention (about 30 days). Useful for rendering a "recent activity" panel on the conversions setup tab without standing up a parallel persistence layer. Per-event payload mirrors the structured log we write on every successful send: `eventName`, `conversationId`, `eventsReceived`, `eventsFailed`, `traceId`, `durationMs`, and the wall-clock `timestamp`.
4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4147 def list_whats_app_conversions_with_http_info(account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.list_whats_app_conversions ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.list_whats_app_conversions" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 200 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_whats_app_conversions, must be smaller than or equal to 200.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.list_whats_app_conversions, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/whatsapp/conversions' # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListWhatsAppConversions200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.list_whats_app_conversions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#list_whats_app_conversions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#query_ad_insights(account_id, object_id, opts = {}) ⇒ QueryAdInsights200Response
Flexible live insights query (Meta)
Live, flexible insights query against Meta's Graph API. Unlike GET /v1/ads/adId/analytics (fixed metric set, cached), this forwards caller-chosen fields, breakdowns and filtering to any Meta insights node and returns Meta's rows verbatim. objectId selects the node: an ad account, campaign, ad set or ad platform id. level sets row granularity independently of the node. Semantic validation is Meta's: an unknown field or invalid breakdown combination returns a 400 carrying Meta's message. For long ranges or agency-scale accounts prefer the async variant (POST /v1/ads/insights/reports). Meta only.
4225 4226 4227 4228 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4225 def query_ad_insights(account_id, object_id, opts = {}) data, _status_code, _headers = query_ad_insights_with_http_info(account_id, object_id, opts) data end |
#query_ad_insights_with_http_info(account_id, object_id, opts = {}) ⇒ Array<(QueryAdInsights200Response, Integer, Hash)>
Flexible live insights query (Meta) Live, flexible insights query against Meta's Graph API. Unlike GET /v1/ads/adId/analytics (fixed metric set, cached), this forwards caller-chosen `fields`, `breakdowns` and `filtering` to any Meta insights node and returns Meta's rows verbatim. `objectId` selects the node: an ad account, campaign, ad set or ad platform id. `level` sets row granularity independently of the node. Semantic validation is Meta's: an unknown field or invalid breakdown combination returns a 400 carrying Meta's message. For long ranges or agency-scale accounts prefer the async variant (POST /v1/ads/insights/reports). Meta only.
4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4250 def query_ad_insights_with_http_info(account_id, object_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.query_ad_insights ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.query_ad_insights" end # verify the required parameter 'object_id' is set if @api_client.config.client_side_validation && object_id.nil? fail ArgumentError, "Missing the required parameter 'object_id' when calling AdsApi.query_ad_insights" end allowable_values = ["ad", "adset", "campaign", "account"] if @api_client.config.client_side_validation && opts[:'level'] && !allowable_values.include?(opts[:'level']) fail ArgumentError, "invalid value for \"level\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.query_ad_insights, must be smaller than or equal to 500.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.query_ad_insights, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/ads/insights' # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'objectId'] = object_id query_params[:'level'] = opts[:'level'] if !opts[:'level'].nil? query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil? query_params[:'breakdowns'] = opts[:'breakdowns'] if !opts[:'breakdowns'].nil? query_params[:'actionBreakdowns'] = opts[:'action_breakdowns'] if !opts[:'action_breakdowns'].nil? query_params[:'actionAttributionWindows'] = opts[:'action_attribution_windows'] if !opts[:'action_attribution_windows'].nil? query_params[:'actionReportTime'] = opts[:'action_report_time'] if !opts[:'action_report_time'].nil? query_params[:'useUnifiedAttributionSetting'] = opts[:'use_unified_attribution_setting'] if !opts[:'use_unified_attribution_setting'].nil? query_params[:'filtering'] = opts[:'filtering'] if !opts[:'filtering'].nil? query_params[:'datePreset'] = opts[:'date_preset'] if !opts[:'date_preset'].nil? query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil? query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil? query_params[:'timeIncrement'] = opts[:'time_increment'] if !opts[:'time_increment'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'QueryAdInsights200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.query_ad_insights", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#query_ad_insights\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#remove_conversion_associations(account_id, destination_id, ad_account_id, campaign_ids, opts = {}) ⇒ RemoveConversionAssociations200Response
Remove associated campaigns
Remove one or more campaign associations from this conversion rule. Pass adAccountId and campaignIds as query parameters (campaignIds is comma-separated). The route also accepts a JSON body with the same fields for clients that prefer DELETE-with-body, but the documented surface is query-only because some SDK code generators (e.g. Python) collapse query + body parameters with the same name into a single kwarg.
4338 4339 4340 4341 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4338 def remove_conversion_associations(account_id, destination_id, ad_account_id, campaign_ids, opts = {}) data, _status_code, _headers = remove_conversion_associations_with_http_info(account_id, destination_id, ad_account_id, campaign_ids, opts) data end |
#remove_conversion_associations_with_http_info(account_id, destination_id, ad_account_id, campaign_ids, opts = {}) ⇒ Array<(RemoveConversionAssociations200Response, Integer, Hash)>
Remove associated campaigns Remove one or more campaign associations from this conversion rule. Pass `adAccountId` and `campaignIds` as query parameters (`campaignIds` is comma-separated). The route also accepts a JSON body with the same fields for clients that prefer DELETE-with-body, but the documented surface is query-only because some SDK code generators (e.g. Python) collapse query + body parameters with the same name into a single kwarg.
4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4351 def remove_conversion_associations_with_http_info(account_id, destination_id, ad_account_id, campaign_ids, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.remove_conversion_associations ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.remove_conversion_associations" end # verify the required parameter 'destination_id' is set if @api_client.config.client_side_validation && destination_id.nil? fail ArgumentError, "Missing the required parameter 'destination_id' when calling AdsApi.remove_conversion_associations" end # verify the required parameter 'ad_account_id' is set if @api_client.config.client_side_validation && ad_account_id.nil? fail ArgumentError, "Missing the required parameter 'ad_account_id' when calling AdsApi.remove_conversion_associations" end # verify the required parameter 'campaign_ids' is set if @api_client.config.client_side_validation && campaign_ids.nil? fail ArgumentError, "Missing the required parameter 'campaign_ids' when calling AdsApi.remove_conversion_associations" end # resource path local_var_path = '/v1/accounts/{accountId}/conversion-destinations/{destinationId}/associations'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'destinationId' + '}', CGI.escape(destination_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'adAccountId'] = ad_account_id query_params[:'campaignIds'] = campaign_ids # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'RemoveConversionAssociations200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.remove_conversion_associations", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#remove_conversion_associations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#reserve_rf_prediction(prediction_id, reserve_rf_prediction_request, opts = {}) ⇒ ReserveRfPrediction201Response
Reserve a Reach & Frequency prediction (Meta)
Locks the quoted price + inventory until the returned expiresAt and mints a NEW prediction id — pass that RESERVED id (not the original) as rfPredictionId on POST /v1/ads/create. Release an unused reservation via DELETE. Meta only.
4419 4420 4421 4422 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4419 def reserve_rf_prediction(prediction_id, reserve_rf_prediction_request, opts = {}) data, _status_code, _headers = reserve_rf_prediction_with_http_info(prediction_id, reserve_rf_prediction_request, opts) data end |
#reserve_rf_prediction_with_http_info(prediction_id, reserve_rf_prediction_request, opts = {}) ⇒ Array<(ReserveRfPrediction201Response, Integer, Hash)>
Reserve a Reach & Frequency prediction (Meta) Locks the quoted price + inventory until the returned `expiresAt` and mints a NEW prediction id — pass that RESERVED id (not the original) as `rfPredictionId` on POST /v1/ads/create. Release an unused reservation via DELETE. Meta only.
4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4430 def reserve_rf_prediction_with_http_info(prediction_id, reserve_rf_prediction_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.reserve_rf_prediction ...' end # verify the required parameter 'prediction_id' is set if @api_client.config.client_side_validation && prediction_id.nil? fail ArgumentError, "Missing the required parameter 'prediction_id' when calling AdsApi.reserve_rf_prediction" end # verify the required parameter 'reserve_rf_prediction_request' is set if @api_client.config.client_side_validation && reserve_rf_prediction_request.nil? fail ArgumentError, "Missing the required parameter 'reserve_rf_prediction_request' when calling AdsApi.reserve_rf_prediction" end # resource path local_var_path = '/v1/ads/rf-predictions/{predictionId}/reserve'.sub('{' + 'predictionId' + '}', CGI.escape(prediction_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(reserve_rf_prediction_request) # return_type return_type = opts[:debug_return_type] || 'ReserveRfPrediction201Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.reserve_rf_prediction", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#reserve_rf_prediction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#search_ad_interests(q, account_id, opts = {}) ⇒ SearchAdInterests200Response
Search targeting interests
Deprecated alias for GET /v1/ads/targeting/search?dimension=interest. Kept for backward compatibility, it returns the legacy { interests: [...] } shape rather than the normalized { results: [...] }. New integrations should use GET /v1/ads/targeting/search with dimension=interest.
4493 4494 4495 4496 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4493 def search_ad_interests(q, account_id, opts = {}) data, _status_code, _headers = search_ad_interests_with_http_info(q, account_id, opts) data end |
#search_ad_interests_with_http_info(q, account_id, opts = {}) ⇒ Array<(SearchAdInterests200Response, Integer, Hash)>
Search targeting interests Deprecated alias for `GET /v1/ads/targeting/search?dimension=interest`. Kept for backward compatibility, it returns the legacy `{ interests: [...] }` shape rather than the normalized `{ results: [...] }`. New integrations should use `GET /v1/ads/targeting/search` with `dimension=interest`.
4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4504 def search_ad_interests_with_http_info(q, account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.search_ad_interests ...' end # verify the required parameter 'q' is set if @api_client.config.client_side_validation && q.nil? fail ArgumentError, "Missing the required parameter 'q' when calling AdsApi.search_ad_interests" end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.search_ad_interests" end # resource path local_var_path = '/v1/ads/interests' # query parameters query_params = opts[:query_params] || {} query_params[:'q'] = q query_params[:'accountId'] = account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SearchAdInterests200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.search_ad_interests", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#search_ad_interests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#search_ad_targeting(account_id, q, opts = {}) ⇒ SearchAdTargeting200Response
Search targeting options
Resolve a human-readable query into the platform's opaque targeting ids used in the TargetingSpec (countries/regions/cities/zips/metros geo keys, and interests/behaviors entity ids) on POST /v1/ads/create, POST /v1/ads/targeting/reach-estimate, and saved_targeting audiences. The dimension param selects what is searched, geo (locations, further scoped by geoType), interest, behavior, or income. Availability of each dimension varies by platform (e.g. behaviours are Meta/TikTok only). Results are normalized across platforms into a single shape, so the same client code consumes Meta, TikTok, LinkedIn, X, Pinterest, and Google results. TikTok geo searches return every matching level in one list (type is country, region, city, district, or metro for DMA areas) — geoType is not applied. Results are scoped to the advertiser's targetable markets, and every id is usable in regions/cities/metros keys on POST /v1/ads/create. For geo queries, q should contain only the locality name (e.g. \"Amsterdam\", not \"Amsterdam, NL\"). Use countryCode to disambiguate.
4568 4569 4570 4571 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4568 def search_ad_targeting(account_id, q, opts = {}) data, _status_code, _headers = search_ad_targeting_with_http_info(account_id, q, opts) data end |
#search_ad_targeting_with_http_info(account_id, q, opts = {}) ⇒ Array<(SearchAdTargeting200Response, Integer, Hash)>
Search targeting options Resolve a human-readable query into the platform's opaque targeting ids used in the `TargetingSpec` (`countries`/`regions`/`cities`/`zips`/`metros` geo keys, and `interests`/`behaviors` entity ids) on `POST /v1/ads/create`, `POST /v1/ads/targeting/reach-estimate`, and `saved_targeting` audiences. The `dimension` param selects what is searched, `geo` (locations, further scoped by `geoType`), `interest`, `behavior`, or `income`. Availability of each dimension varies by platform (e.g. behaviours are Meta/TikTok only). Results are normalized across platforms into a single shape, so the same client code consumes Meta, TikTok, LinkedIn, X, Pinterest, and Google results. TikTok geo searches return every matching level in one list (`type` is `country`, `region`, `city`, `district`, or `metro` for DMA areas) — `geoType` is not applied. Results are scoped to the advertiser's targetable markets, and every id is usable in `regions`/`cities`/`metros` keys on `POST /v1/ads/create`. For geo queries, `q` should contain only the locality name (e.g. `"Amsterdam"`, not `"Amsterdam, NL"`). Use `countryCode` to disambiguate.
4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4583 def search_ad_targeting_with_http_info(account_id, q, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.search_ad_targeting ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.search_ad_targeting" end # verify the required parameter 'q' is set if @api_client.config.client_side_validation && q.nil? fail ArgumentError, "Missing the required parameter 'q' when calling AdsApi.search_ad_targeting" end allowable_values = ["geo", "interest", "behavior", "income"] if @api_client.config.client_side_validation && opts[:'dimension'] && !allowable_values.include?(opts[:'dimension']) fail ArgumentError, "invalid value for \"dimension\", must be one of #{allowable_values}" end allowable_values = ["country", "region", "city", "zip", "metro"] if @api_client.config.client_side_validation && opts[:'geo_type'] && !allowable_values.include?(opts[:'geo_type']) fail ArgumentError, "invalid value for \"geo_type\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'country_code'].nil? && opts[:'country_code'].to_s.length > 2 fail ArgumentError, 'invalid value for "opts[:"country_code"]" when calling AdsApi.search_ad_targeting, the character length must be smaller than or equal to 2.' end if @api_client.config.client_side_validation && !opts[:'country_code'].nil? && opts[:'country_code'].to_s.length < 2 fail ArgumentError, 'invalid value for "opts[:"country_code"]" when calling AdsApi.search_ad_targeting, the character length must be greater than or equal to 2.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.search_ad_targeting, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AdsApi.search_ad_targeting, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/ads/targeting/search' # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id query_params[:'q'] = q query_params[:'dimension'] = opts[:'dimension'] if !opts[:'dimension'].nil? query_params[:'geoType'] = opts[:'geo_type'] if !opts[:'geo_type'].nil? query_params[:'countryCode'] = opts[:'country_code'] if !opts[:'country_code'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SearchAdTargeting200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.search_ad_targeting", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#search_ad_targeting\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#send_conversions(send_conversions_request, opts = {}) ⇒ SendConversions200Response
Send conversion events
Relay one or more conversion events to the target ad platform's native Conversions API. Platform is inferred from the provided accountId. Requires the Ads add-on. Supported platforms: - Meta (metaads) via Graph API - Google Ads (googleads) via Data Manager API ingestEvents - LinkedIn (linkedinads) via /rest/conversionEvents - TikTok (tiktokads) via the Offline Events API /offline/batch/ — OFFLINE conversions only destinationId semantics differ per platform: - Meta: pixel (dataset) ID, e.g. 123456789012345 - Google: conversion action resource name, e.g. customers/1234567890/conversionActions/987654321 - LinkedIn: conversion rule ID or URN, e.g. 104012 or urn:lla:llaPartnerConversion:104012 - TikTok: Offline Event Set ID, e.g. 7057103914977558530 TikTok notes: this path sends OFFLINE conversions (in-store / CRM / call-center), not web-pixel events. Each event must carry an email or phone (TikTok requires at least one). The connected TikTok ads account must have granted the Offline Events permission; older grants must reconnect. Callers can list valid destinations via GET /v1/accounts/{accountId}/conversion-destinations. All PII (email, phone, names, external IDs) is hashed with SHA-256 server-side per each platform's normalization spec, including Google's Gmail-specific dot/plus-suffix stripping. Send plaintext. LinkedIn externalIds are passed through as plaintext per LinkedIn's spec; only emails and phones are hashed. For LinkedIn, the connected account must have been authorized after the Conversions API rollout (i.e. the OAuth grant must include rw_conversions). Older accounts must reconnect. Batching is handled automatically. Meta caps at 1000 events per request and rejects the entire batch if any event is malformed. Google caps at 2000. LinkedIn caps at 5000 and is also all-or-nothing per chunk. Dedup: pass a stable eventId on every event. Meta and LinkedIn use it to dedupe against browser-side pixel/Insight Tag events; Google maps it to transactionId. Per-platform eventName semantics: - Meta: free-form. Standard names (Purchase, Lead, ...) match Meta's built-in events; custom strings are accepted. - Google: ignored. The conversion action's category determines the event type. Send the standard name closest to your action for documentation, but the platform will not branch on it. - LinkedIn: ignored. The conversion rule's type (LEAD, PURCHASE, etc.) is locked to the destination at rule-creation time. Send the standard name for documentation; LinkedIn does not branch on it.
4670 4671 4672 4673 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4670 def send_conversions(send_conversions_request, opts = {}) data, _status_code, _headers = send_conversions_with_http_info(send_conversions_request, opts) data end |
#send_conversions_with_http_info(send_conversions_request, opts = {}) ⇒ Array<(SendConversions200Response, Integer, Hash)>
Send conversion events Relay one or more conversion events to the target ad platform's native Conversions API. Platform is inferred from the provided `accountId`. Requires the Ads add-on. Supported platforms: - Meta (`metaads`) via Graph API - Google Ads (`googleads`) via Data Manager API `ingestEvents` - LinkedIn (`linkedinads`) via `/rest/conversionEvents` - TikTok (`tiktokads`) via the Offline Events API `/offline/batch/` — OFFLINE conversions only `destinationId` semantics differ per platform: - Meta: pixel (dataset) ID, e.g. `123456789012345` - Google: conversion action resource name, e.g. `customers/1234567890/conversionActions/987654321` - LinkedIn: conversion rule ID or URN, e.g. `104012` or `urn:lla:llaPartnerConversion:104012` - TikTok: Offline Event Set ID, e.g. `7057103914977558530` TikTok notes: this path sends OFFLINE conversions (in-store / CRM / call-center), not web-pixel events. Each event must carry an email or phone (TikTok requires at least one). The connected TikTok ads account must have granted the Offline Events permission; older grants must reconnect. Callers can list valid destinations via `GET /v1/accounts/accountId/conversion-destinations`. All PII (email, phone, names, external IDs) is hashed with SHA-256 server-side per each platform's normalization spec, including Google's Gmail-specific dot/plus-suffix stripping. Send plaintext. LinkedIn `externalIds` are passed through as plaintext per LinkedIn's spec; only emails and phones are hashed. For LinkedIn, the connected account must have been authorized after the Conversions API rollout (i.e. the OAuth grant must include `rw_conversions`). Older accounts must reconnect. Batching is handled automatically. Meta caps at 1000 events per request and rejects the entire batch if any event is malformed. Google caps at 2000. LinkedIn caps at 5000 and is also all-or-nothing per chunk. Dedup: pass a stable `eventId` on every event. Meta and LinkedIn use it to dedupe against browser-side pixel/Insight Tag events; Google maps it to `transactionId`. Per-platform `eventName` semantics: - Meta: free-form. Standard names (Purchase, Lead, ...) match Meta's built-in events; custom strings are accepted. - Google: ignored. The conversion action's category determines the event type. Send the standard name closest to your action for documentation, but the platform will not branch on it. - LinkedIn: ignored. The conversion rule's `type` (LEAD, PURCHASE, etc.) is locked to the destination at rule-creation time. Send the standard name for documentation; LinkedIn does not branch on it.
4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4680 def send_conversions_with_http_info(send_conversions_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.send_conversions ...' end # verify the required parameter 'send_conversions_request' is set if @api_client.config.client_side_validation && send_conversions_request.nil? fail ArgumentError, "Missing the required parameter 'send_conversions_request' when calling AdsApi.send_conversions" end # resource path local_var_path = '/v1/ads/conversions' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(send_conversions_request) # return_type return_type = opts[:debug_return_type] || 'SendConversions200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.send_conversions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#send_conversions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#send_whats_app_conversion(send_whats_app_conversion_request, opts = {}) ⇒ SendWhatsAppConversion200Response
Send WhatsApp conversion event
Forward a WhatsApp Business Messaging conversion event (LeadSubmitted, Purchase, AddToCart, InitiateCheckout, ViewContent) to Meta's Conversions API with action_source = business_messaging and messaging_channel = whatsapp. The endpoint looks up the originating CTWA click ID (ctwa_clid) captured on the first inbound message of the conversation and replays it on every event so Meta can attribute the conversion back to the Click-to-WhatsApp ad that drove the chat. Configuration prerequisite on the WhatsApp account metadata: - metaCapiDatasetId: the Meta dataset ID linked to the WABA. Provision one with POST /v1/whatsapp/dataset. The WABA ID (already set automatically at connect time) is forwarded as user_data.whatsapp_business_account_id, which is the per-channel attribution identifier Meta requires for WhatsApp events. No Facebook Page ID is needed (that field is the Messenger-branch identifier). Identify the conversation by either conversationId (preferred) or phoneE164 (digits only, no +). At least one is required. If the conversation has no captured ctwa_clid, the request returns 422 because there is nothing to attribute. Token and dataset coupling: the WhatsApp account's accessToken must have access to the configured metaCapiDatasetId. By default a WABA's system-user token is scoped to the WABA's own Business Manager and cannot post to a pixel owned by a different Business; Meta returns code 100 in that case. Either share the dataset with the WhatsApp app's Business in BM, or use a dataset already in the same Business as the WABA.
4738 4739 4740 4741 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4738 def send_whats_app_conversion(send_whats_app_conversion_request, opts = {}) data, _status_code, _headers = send_whats_app_conversion_with_http_info(send_whats_app_conversion_request, opts) data end |
#send_whats_app_conversion_with_http_info(send_whats_app_conversion_request, opts = {}) ⇒ Array<(SendWhatsAppConversion200Response, Integer, Hash)>
Send WhatsApp conversion event Forward a WhatsApp Business Messaging conversion event (`LeadSubmitted`, `Purchase`, `AddToCart`, `InitiateCheckout`, `ViewContent`) to Meta's Conversions API with `action_source = business_messaging` and `messaging_channel = whatsapp`. The endpoint looks up the originating CTWA click ID (`ctwa_clid`) captured on the first inbound message of the conversation and replays it on every event so Meta can attribute the conversion back to the Click-to-WhatsApp ad that drove the chat. Configuration prerequisite on the WhatsApp account metadata: - `metaCapiDatasetId`: the Meta dataset ID linked to the WABA. Provision one with `POST /v1/whatsapp/dataset`. The WABA ID (already set automatically at connect time) is forwarded as `user_data.whatsapp_business_account_id`, which is the per-channel attribution identifier Meta requires for WhatsApp events. No Facebook Page ID is needed (that field is the Messenger-branch identifier). Identify the conversation by either `conversationId` (preferred) or `phoneE164` (digits only, no `+`). At least one is required. If the conversation has no captured `ctwa_clid`, the request returns 422 because there is nothing to attribute. Token and dataset coupling: the WhatsApp account's accessToken must have access to the configured `metaCapiDatasetId`. By default a WABA's system-user token is scoped to the WABA's own Business Manager and cannot post to a pixel owned by a different Business; Meta returns code 100 in that case. Either share the dataset with the WhatsApp app's Business in BM, or use a dataset already in the same Business as the WABA.
4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4748 def send_whats_app_conversion_with_http_info(send_whats_app_conversion_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.send_whats_app_conversion ...' end # verify the required parameter 'send_whats_app_conversion_request' is set if @api_client.config.client_side_validation && send_whats_app_conversion_request.nil? fail ArgumentError, "Missing the required parameter 'send_whats_app_conversion_request' when calling AdsApi.send_whats_app_conversion" end # resource path local_var_path = '/v1/whatsapp/conversions' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(send_whats_app_conversion_request) # return_type return_type = opts[:debug_return_type] || 'SendWhatsAppConversion200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.send_whats_app_conversion", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#send_whats_app_conversion\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_ad(ad_id, update_ad_request, opts = {}) ⇒ UpdateAd200Response
Update ad
Patch one or more fields on an ad. Status, budget, targeting, and creative changes are propagated to the platform. Per-platform support: - Meta (Facebook + Instagram): all fields supported. - TikTok: status, budget, targeting (via /v2/adgroup/update/), and creative (via /v2/ad/update/ patch-style — headline is ignored, body becomes ad_text). - Pinterest / X / LinkedIn / Google: status + budget only. Sending targeting or creative returns 501 with code unsupported_platform_operation.
4807 4808 4809 4810 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4807 def update_ad(ad_id, update_ad_request, opts = {}) data, _status_code, _headers = update_ad_with_http_info(ad_id, update_ad_request, opts) data end |
#update_ad_account(update_ad_account_request, opts = {}) ⇒ UpdateAdAccount200Response
Update ad account settings
Sets the default DSA beneficiary and payor on a Meta ad account (EU DSA, Article 26). Set them once and every EU-targeted call to /v1/ads/create, /v1/ads/boost and /v1/ads/ctwa on that ad account can omit dsaBeneficiary/dsaPayor: Meta applies the defaults automatically. The values are written to the ad account on Meta, the same setting Ads Manager edits. Nothing is stored in Zernio, and defaults already set in Ads Manager work identically. Zernio never guesses these values for you. Beneficiary and payor are legal disclosures shown to EU users, so you must provide the entity names explicitly. Use GET /v1/ads/dsa-recommendations to offer suggestions in your UI. If defaultDsaPayor is omitted, the beneficiary is also set as the payor, which covers the common case where the same entity benefits from and pays for the ads. Read the current values back with GET /v1/ads/dsa-defaults. Currently supported for Meta accounts only; other platforms return 400.
4880 4881 4882 4883 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4880 def update_ad_account(update_ad_account_request, opts = {}) data, _status_code, _headers = update_ad_account_with_http_info(update_ad_account_request, opts) data end |
#update_ad_account_with_http_info(update_ad_account_request, opts = {}) ⇒ Array<(UpdateAdAccount200Response, Integer, Hash)>
Update ad account settings Sets the default DSA beneficiary and payor on a Meta ad account (EU DSA, Article 26). Set them once and every EU-targeted call to `/v1/ads/create`, `/v1/ads/boost` and `/v1/ads/ctwa` on that ad account can omit `dsaBeneficiary`/`dsaPayor`: Meta applies the defaults automatically. The values are written to the ad account on Meta, the same setting Ads Manager edits. Nothing is stored in Zernio, and defaults already set in Ads Manager work identically. Zernio never guesses these values for you. Beneficiary and payor are legal disclosures shown to EU users, so you must provide the entity names explicitly. Use `GET /v1/ads/dsa-recommendations` to offer suggestions in your UI. If `defaultDsaPayor` is omitted, the beneficiary is also set as the payor, which covers the common case where the same entity benefits from and pays for the ads. Read the current values back with `GET /v1/ads/dsa-defaults`. Currently supported for Meta accounts only; other platforms return 400.
4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4890 def update_ad_account_with_http_info(update_ad_account_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.update_ad_account ...' end # verify the required parameter 'update_ad_account_request' is set if @api_client.config.client_side_validation && update_ad_account_request.nil? fail ArgumentError, "Missing the required parameter 'update_ad_account_request' when calling AdsApi.update_ad_account" end # resource path local_var_path = '/v1/ads/accounts' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(update_ad_account_request) # return_type return_type = opts[:debug_return_type] || 'UpdateAdAccount200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.update_ad_account", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#update_ad_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_ad_creative(creative_id, update_ad_creative_request, opts = {}) ⇒ UpdateAdCreative200Response
Rename a creative (Meta)
Renames a creative. Creatives are immutable on Meta beyond name — for content changes create a new creative (POST /v1/ads/creatives) and swap it onto the ad (PUT /v1/ads/adId with creative). Meta only.
4949 4950 4951 4952 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4949 def update_ad_creative(creative_id, update_ad_creative_request, opts = {}) data, _status_code, _headers = update_ad_creative_with_http_info(creative_id, update_ad_creative_request, opts) data end |
#update_ad_creative_with_http_info(creative_id, update_ad_creative_request, opts = {}) ⇒ Array<(UpdateAdCreative200Response, Integer, Hash)>
Rename a creative (Meta) Renames a creative. Creatives are immutable on Meta beyond `name` — for content changes create a new creative (POST /v1/ads/creatives) and swap it onto the ad (PUT /v1/ads/adId with `creative`). Meta only.
4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4960 def update_ad_creative_with_http_info(creative_id, update_ad_creative_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.update_ad_creative ...' end # verify the required parameter 'creative_id' is set if @api_client.config.client_side_validation && creative_id.nil? fail ArgumentError, "Missing the required parameter 'creative_id' when calling AdsApi.update_ad_creative" end # verify the required parameter 'update_ad_creative_request' is set if @api_client.config.client_side_validation && update_ad_creative_request.nil? fail ArgumentError, "Missing the required parameter 'update_ad_creative_request' when calling AdsApi.update_ad_creative" end # resource path local_var_path = '/v1/ads/creatives/{creativeId}'.sub('{' + 'creativeId' + '}', CGI.escape(creative_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(update_ad_creative_request) # return_type return_type = opts[:debug_return_type] || 'UpdateAdCreative200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.update_ad_creative", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#update_ad_creative\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_ad_status(ad_id, update_ad_status_request, opts = {}) ⇒ UpdateAdStatus200Response
Pause or resume a single ad
Ad-scoped pause/resume — touches ONLY this ad, never its parent ad set or campaign (so sibling ads keep running). Thin wrapper over the status field of PUT /v1/ads/adId, for callers that want a URL symmetric to /v1/ads/campaigns/campaignId/status and /v1/ads/ad-sets/adSetId/status. {adId} accepts the same identifier dialects as GET/PUT /v1/ads/adId (Zernio hex _id, Meta numeric platformAdId, or the creative's effective story/media IDs). platform is inferred from the ad, so it's not required in the body. Ads in terminal statuses (rejected, completed, cancelled) and no-op flips (already in the target state) are skipped.
5023 5024 5025 5026 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 5023 def update_ad_status(ad_id, update_ad_status_request, opts = {}) data, _status_code, _headers = update_ad_status_with_http_info(ad_id, update_ad_status_request, opts) data end |
#update_ad_status_with_http_info(ad_id, update_ad_status_request, opts = {}) ⇒ Array<(UpdateAdStatus200Response, Integer, Hash)>
Pause or resume a single ad Ad-scoped pause/resume — touches ONLY this ad, never its parent ad set or campaign (so sibling ads keep running). Thin wrapper over the `status` field of PUT /v1/ads/adId, for callers that want a URL symmetric to /v1/ads/campaigns/campaignId/status and /v1/ads/ad-sets/adSetId/status. `adId` accepts the same identifier dialects as GET/PUT /v1/ads/adId (Zernio hex `_id`, Meta numeric `platformAdId`, or the creative's effective story/media IDs). `platform` is inferred from the ad, so it's not required in the body. Ads in terminal statuses (rejected, completed, cancelled) and no-op flips (already in the target state) are skipped.
5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 5034 def update_ad_status_with_http_info(ad_id, update_ad_status_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.update_ad_status ...' end # verify the required parameter 'ad_id' is set if @api_client.config.client_side_validation && ad_id.nil? fail ArgumentError, "Missing the required parameter 'ad_id' when calling AdsApi.update_ad_status" end # verify the required parameter 'update_ad_status_request' is set if @api_client.config.client_side_validation && update_ad_status_request.nil? fail ArgumentError, "Missing the required parameter 'update_ad_status_request' when calling AdsApi.update_ad_status" end # resource path local_var_path = '/v1/ads/{adId}/status'.sub('{' + 'adId' + '}', CGI.escape(ad_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(update_ad_status_request) # return_type return_type = opts[:debug_return_type] || 'UpdateAdStatus200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.update_ad_status", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#update_ad_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_ad_tracking_tags(ad_id, update_ad_tracking_tags_request, opts = {}) ⇒ nil
Set ad tracking tags
Unified update. Send only the fields for the ad's platform: - Meta: urlTags (array of key,value). Meta creatives are immutable, so this rebuilds the creative and repoints the ad. By DEFAULT we PRESERVE the existing creative verbatim (re-post its object_story_spec + the new url_tags, reusing the image), so you send urlTags ALONE — no need to read back headline/body/CTA. creative (headline, body, callToAction, linkUrl, imageUrl) is OPTIONAL and only needed to rebuild explicitly, or for SHARE / page-post / dark / asset_feed creatives whose object_story_spec Meta strips (those return 422 asking for creative). - Google: trackingUrlTemplate and/or finalUrlSuffix (full template strings; account quota applies). - LinkedIn: dynamicValueParameters and/or customValueParameters (campaign-level Dynamic UTM).
5097 5098 5099 5100 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 5097 def (ad_id, , opts = {}) (ad_id, , opts) nil end |
#update_ad_tracking_tags_with_http_info(ad_id, update_ad_tracking_tags_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Set ad tracking tags Unified update. Send only the fields for the ad's platform: - Meta: `urlTags` (array of key,value). Meta creatives are immutable, so this rebuilds the creative and repoints the ad. By DEFAULT we PRESERVE the existing creative verbatim (re-post its object_story_spec + the new url_tags, reusing the image), so you send `urlTags` ALONE — no need to read back headline/body/CTA. `creative` (headline, body, callToAction, linkUrl, imageUrl) is OPTIONAL and only needed to rebuild explicitly, or for SHARE / page-post / dark / asset_feed creatives whose object_story_spec Meta strips (those return 422 asking for `creative`). - Google: `trackingUrlTemplate` and/or `finalUrlSuffix` (full template strings; account quota applies). - LinkedIn: `dynamicValueParameters` and/or `customValueParameters` (campaign-level Dynamic UTM).
5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 5108 def (ad_id, , opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.update_ad_tracking_tags ...' end # verify the required parameter 'ad_id' is set if @api_client.config.client_side_validation && ad_id.nil? fail ArgumentError, "Missing the required parameter 'ad_id' when calling AdsApi.update_ad_tracking_tags" end # verify the required parameter 'update_ad_tracking_tags_request' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'update_ad_tracking_tags_request' when calling AdsApi.update_ad_tracking_tags" end # resource path local_var_path = '/v1/ads/{adId}/tracking-tags'.sub('{' + 'adId' + '}', CGI.escape(ad_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body() # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.update_ad_tracking_tags", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#update_ad_tracking_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_ad_with_http_info(ad_id, update_ad_request, opts = {}) ⇒ Array<(UpdateAd200Response, Integer, Hash)>
Update ad Patch one or more fields on an ad. Status, budget, targeting, and creative changes are propagated to the platform. Per-platform support: - Meta (Facebook + Instagram): all fields supported. - TikTok: status, budget, targeting (via `/v2/adgroup/update/`), and creative (via `/v2/ad/update/` patch-style — `headline` is ignored, `body` becomes `ad_text`). - Pinterest / X / LinkedIn / Google: status + budget only. Sending `targeting` or `creative` returns 501 with code `unsupported_platform_operation`.
4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 4818 def update_ad_with_http_info(ad_id, update_ad_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.update_ad ...' end # verify the required parameter 'ad_id' is set if @api_client.config.client_side_validation && ad_id.nil? fail ArgumentError, "Missing the required parameter 'ad_id' when calling AdsApi.update_ad" end # verify the required parameter 'update_ad_request' is set if @api_client.config.client_side_validation && update_ad_request.nil? fail ArgumentError, "Missing the required parameter 'update_ad_request' when calling AdsApi.update_ad" end # resource path local_var_path = '/v1/ads/{adId}'.sub('{' + 'adId' + '}', CGI.escape(ad_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(update_ad_request) # return_type return_type = opts[:debug_return_type] || 'UpdateAd200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.update_ad", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#update_ad\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_conversion_destination(account_id, destination_id, update_conversion_destination_request, opts = {}) ⇒ GetConversionDestination200Response
Update a conversion destination
Partial-update a conversion rule. LinkedIn-only today. Whitelisted fields: name, enabled, attribution windows, valueType, value, attributionType. The rule's type and parent ad account are intentionally not exposed for update — recreate the rule if those need to change.
5172 5173 5174 5175 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 5172 def update_conversion_destination(account_id, destination_id, update_conversion_destination_request, opts = {}) data, _status_code, _headers = update_conversion_destination_with_http_info(account_id, destination_id, update_conversion_destination_request, opts) data end |
#update_conversion_destination_with_http_info(account_id, destination_id, update_conversion_destination_request, opts = {}) ⇒ Array<(GetConversionDestination200Response, Integer, Hash)>
Update a conversion destination Partial-update a conversion rule. LinkedIn-only today. Whitelisted fields: `name`, `enabled`, attribution windows, `valueType`, `value`, `attributionType`. The rule's `type` and parent ad account are intentionally not exposed for update — recreate the rule if those need to change.
5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 5184 def update_conversion_destination_with_http_info(account_id, destination_id, update_conversion_destination_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.update_conversion_destination ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling AdsApi.update_conversion_destination" end # verify the required parameter 'destination_id' is set if @api_client.config.client_side_validation && destination_id.nil? fail ArgumentError, "Missing the required parameter 'destination_id' when calling AdsApi.update_conversion_destination" end # verify the required parameter 'update_conversion_destination_request' is set if @api_client.config.client_side_validation && update_conversion_destination_request.nil? fail ArgumentError, "Missing the required parameter 'update_conversion_destination_request' when calling AdsApi.update_conversion_destination" end # resource path local_var_path = '/v1/accounts/{accountId}/conversion-destinations/{destinationId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'destinationId' + '}', CGI.escape(destination_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(update_conversion_destination_request) # return_type return_type = opts[:debug_return_type] || 'GetConversionDestination200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.update_conversion_destination", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#update_conversion_destination\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#upload_ad_image(upload_ad_image_request, opts = {}) ⇒ UploadAdImage201Response
Upload an ad image from base64 (Meta)
Uploads raw image bytes to the Meta ad account's image library — for callers whose creatives aren't hosted at a public URL. Returns the image hash (Meta's identifier for the asset) and the Meta-hosted url, which can be used directly as imageUrl on the create endpoints. Max 30 MB decoded. Meta only.
5250 5251 5252 5253 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 5250 def upload_ad_image(upload_ad_image_request, opts = {}) data, _status_code, _headers = upload_ad_image_with_http_info(upload_ad_image_request, opts) data end |
#upload_ad_image_with_http_info(upload_ad_image_request, opts = {}) ⇒ Array<(UploadAdImage201Response, Integer, Hash)>
Upload an ad image from base64 (Meta) Uploads raw image bytes to the Meta ad account's image library — for callers whose creatives aren't hosted at a public URL. Returns the image `hash` (Meta's identifier for the asset) and the Meta-hosted `url`, which can be used directly as `imageUrl` on the create endpoints. Max 30 MB decoded. Meta only.
5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 |
# File 'lib/zernio-sdk/api/ads_api.rb', line 5260 def upload_ad_image_with_http_info(upload_ad_image_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AdsApi.upload_ad_image ...' end # verify the required parameter 'upload_ad_image_request' is set if @api_client.config.client_side_validation && upload_ad_image_request.nil? fail ArgumentError, "Missing the required parameter 'upload_ad_image_request' when calling AdsApi.upload_ad_image" end # resource path local_var_path = '/v1/ads/images' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(upload_ad_image_request) # return_type return_type = opts[:debug_return_type] || 'UploadAdImage201Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"AdsApi.upload_ad_image", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AdsApi#upload_ad_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |