class
TwitterAds::Client
- TwitterAds::Client
- Reference
- Object
Included Modules
Defined in:
twitter-ads/api/account_media.crtwitter-ads/api/accounts.cr
twitter-ads/api/authenticated_user_access.cr
twitter-ads/api/campaigns.cr
twitter-ads/api/cards.cr
twitter-ads/api/cards_all.cr
twitter-ads/api/cards_image_app_download.cr
twitter-ads/api/cards_image_conversation.cr
twitter-ads/api/cards_image_direct_message.cr
twitter-ads/api/cards_poll.cr
twitter-ads/api/cards_video_app_download.cr
twitter-ads/api/cards_video_conversation.cr
twitter-ads/api/cards_video_direct_message.cr
twitter-ads/api/cards_video_website.cr
twitter-ads/api/cards_website.cr
twitter-ads/api/custom_audiences.cr
twitter-ads/api/draft_tweets.cr
twitter-ads/api/funding_instruments.cr
twitter-ads/api/line_item_placements.cr
twitter-ads/api/line_items.cr
twitter-ads/api/media_creatives.cr
twitter-ads/api/media_library.cr
twitter-ads/api/preroll_call_to_actions.cr
twitter-ads/api/promotable_users.cr
twitter-ads/api/promoted_accounts.cr
twitter-ads/api/promoted_tweets.cr
twitter-ads/api/scheduled_promoted_tweets.cr
twitter-ads/api/scheduled_tweets.cr
twitter-ads/api/stats.cr
twitter-ads/api/statuses_lookup.cr
twitter-ads/api/targeting_criteria.cr
twitter-ads/api/targeting_criteria_app_store_categories.cr
twitter-ads/api/targeting_criteria_conversations.cr
twitter-ads/api/targeting_criteria_devices.cr
twitter-ads/api/targeting_criteria_events.cr
twitter-ads/api/targeting_criteria_interests.cr
twitter-ads/api/targeting_criteria_languages.cr
twitter-ads/api/targeting_criteria_locations.cr
twitter-ads/api/targeting_criteria_network_operators.cr
twitter-ads/api/targeting_criteria_platform_versions.cr
twitter-ads/api/targeting_criteria_platforms.cr
twitter-ads/api/targeting_criteria_tv_markets.cr
twitter-ads/api/targeting_criteria_tv_shows.cr
twitter-ads/api/tweet_previews.cr
twitter-ads/api/tweets.cr
twitter-ads/api/tweets_lookup.cr
twitter-ads/client.cr
Constant Summary
-
ADS_DEFAULT_DOMAIN =
"https://ads-api.twitter.com" -
ADS_SANDBOX_DOMAIN =
"https://ads-api-sandbox.twitter.com" -
API_DEFAULT_DOMAIN =
"https://api.twitter.com" -
API_DEFAULT_VERSION =
"12"
Constructors
- .from_twurlrc(path = "~/.twurlrc") : Client
- .new(consumer_key : Nil | String, consumer_secret : Nil | String, access_token : Nil | String, access_token_secret : Nil | String, bearer_token : Nil | String = nil, url : String | Nil = nil, logger : Logger | Nil = nil)
Instance Method Summary
- #_stats(account_id : String, entity : String | Api::Stats::Entity, entity_ids : Array(String), start_time : String | Time, end_time : String | Time, metrics : String | Array(String) | Array(Api::Stats::Metric), granularity : String | Api::Stats::Granularity = "HOUR", placement : String | Api::Stats::Placement = "ALL_ON_TWITTER")
- #access_token : String
- #access_token=(v : String) : String
-
#access_token=(v : Nil)
nilassignments are always ignored - #access_token? : String | Nil
- #access_token_secret : String
- #access_token_secret=(v : String) : String
-
#access_token_secret=(v : Nil)
nilassignments are always ignored - #access_token_secret? : String | Nil
- #account_media(account_id : String, count : Int32 = 200, cursor : String = "") : Api::AccountMedia
- #accounts(with_deleted : Bool = false, count : Int32 = 200, cursor : String = "") : Api::Accounts
- #api_suffix : String
- #api_suffix=(v : String) : String
-
#api_suffix=(v : Nil)
nilassignments are always ignored - #api_suffix? : String | Nil
-
#api_version : String
API
-
#api_version=(v : String) : String
API
-
#api_version=(v : Nil)
nilassignments are always ignored -
#api_version? : String | Nil
API
- #authenticated_user_access(account_id : String) : Api::AuthenticatedUserAccess
-
#authorized?
##################################################################### ## Accessor methods
- #bearer_token : String
- #bearer_token=(v : String) : String
-
#bearer_token=(v : Nil)
nilassignments are always ignored - #bearer_token? : String | Nil
- #campaigns(account_id : String, with_deleted : Bool = false, with_draft : Bool = false, count : Int32 = 200, cursor : String = "") : Api::Campaigns
- #cards(account_id : String, count : Int32 = 200, cursor : String = "") : Api::Cards
- #cards_all(account_id : String, card_uris : Array(String)) : Api::CardsAll
- #cards_image_app_download(account_id : String, count : Int32 = 200, cursor : String = "") : Api::CardsImageAppDownload
- #cards_image_conversation(account_id : String, count : Int32 = 200, cursor : String = "") : Api::CardsImageConversation
- #cards_image_direct_message(account_id : String, count : Int32 = 200, cursor : String = "") : Api::CardsImageDirectMessage
- #cards_poll(account_id : String, count : Int32 = 200, cursor : String = "") : Api::CardsPoll
- #cards_video_app_download(account_id : String, count : Int32 = 200, cursor : String = "") : Api::CardsVideoAppDownload
- #cards_video_conversation(account_id : String, count : Int32 = 200, cursor : String = "") : Api::CardsVideoConversation
- #cards_video_direct_message(account_id : String, count : Int32 = 200, cursor : String = "") : Api::CardsVideoDirectMessage
- #cards_video_website(account_id : String, count : Int32 = 200, cursor : String = "") : Api::CardsVideoWebsite
- #cards_website(account_id : String, count : Int32 = 200, cursor : String = "") : Api::CardsWebsite
- #connect_timeout : Float64
- #connect_timeout=(v : Float64) : Float64
-
#connect_timeout=(v : Nil)
nilassignments are always ignored - #connect_timeout? : Float64 | Nil
-
#consumer_key : String
OAuth
-
#consumer_key=(v : String) : String
OAuth
-
#consumer_key=(v : Nil)
nilassignments are always ignored -
#consumer_key? : String | Nil
OAuth
- #consumer_secret : String
- #consumer_secret=(v : String) : String
-
#consumer_secret=(v : Nil)
nilassignments are always ignored - #consumer_secret? : String | Nil
- #custom_audiences(account_id : String, with_deleted : Bool = false, count : Int32 = 200, cursor : String = "") : Api::CustomAudiences
- #dns_timeout : Float64
- #dns_timeout=(v : Float64) : Float64
-
#dns_timeout=(v : Nil)
nilassignments are always ignored - #dns_timeout? : Float64 | Nil
- #draft_tweets(account_id : String, count : Int32 = 200, cursor : String = "") : Api::DraftTweets
- #dryrun : Bool
- #dryrun=(v : Bool) : Bool
-
#dryrun=(v : Nil)
nilassignments are always ignored - #dryrun? : Bool
- #funding_instruments(account_id : String, count : Int32 = 200, cursor : String = "") : Api::FundingInstruments
-
#get(path : String, params = {} of String => String) : Response
See ./api/*.cr ##################################################################### ## HTTP methods
-
#jq : Jq
JQ
-
#jq=(v : Jq) : Jq
JQ
-
#jq=(v : Nil)
nilassignments are always ignored -
#jq? : Jq | Nil
JQ
- #line_item_placements : Api::LineItemPlacements
- #line_items(account_id : String, with_deleted : Bool = false, with_draft : Bool = false, count : Int32 = 200, cursor : String = "") : Api::LineItems
- #logger : Logger
- #logger=(v : Logger) : Logger
-
#logger=(v : Nil)
nilassignments are always ignored - #logger? : Logger | Nil
- #media_creatives(account_id : String, with_deleted : Bool = false, count : Int32 = 200, cursor : String = "") : Api::MediaCreatives
- #media_library(account_id : String, count : Int32 = 200, cursor : String = "") : Api::MediaLibrary
- #oauth2_ads : Bool
- #oauth2_ads=(v : Bool) : Bool
-
#oauth2_ads=(v : Nil)
nilassignments are always ignored - #oauth2_ads? : Bool
- #oauth2_standard : Bool
- #oauth2_standard=(v : Bool) : Bool
-
#oauth2_standard=(v : Nil)
nilassignments are always ignored - #oauth2_standard? : Bool
- #post(path : String, form = {} of String => String) : Response
- #preroll_call_to_actions(account_id : String, count : Int32 = 200, cursor : String = "") : Api::PrerollCallToActions
- #promotable_users(account_id : String, with_deleted : Bool = false, count : Int32 = 200, cursor : String = "") : Api::PromotableUsers
- #promoted_accounts(account_id : String, with_deleted : Bool = false, count : Int32 = 200, cursor : String = "") : Api::PromotedAccounts
- #promoted_tweets(account_id : String, count : Int32 = 200, cursor : String = "") : Api::PromotedTweets
- #read_timeout : Float64
- #read_timeout=(v : Float64) : Float64
-
#read_timeout=(v : Nil)
nilassignments are always ignored - #read_timeout? : Float64 | Nil
- #scheduled_promoted_tweets(account_id : String, with_deleted : Bool = false, count : Int32 = 200, cursor : String = "") : Api::ScheduledPromotedTweets
- #scheduled_tweets(account_id : String, count : Int32 = 200, cursor : String = "") : Api::ScheduledTweets
- #stats(account_id : String, entity : String | Api::Stats::Entity, entity_ids : Array(String), start_time : String | Time, end_time : String | Time, metrics : String | Array(String) | Array(Api::Stats::Metric), granularity : String | Api::Stats::Granularity = "HOUR", placement : String | Api::Stats::Placement = "ALL_ON_TWITTER") : TwitterAds::StatsAccount
-
#statuses_lookup(id : String | Array(String)) : Api::StatusesLookup
This is not "twitter-ads-api" but "twitter-api" that requires ".json" extension.
- #switch_domain : Bool
- #switch_domain=(v : Bool) : Bool
-
#switch_domain=(v : Nil)
nilassignments are always ignored - #switch_domain? : Bool
- #targeting_criteria(account_id : String, line_item_ids : Array(String), with_deleted : Bool = false, count : Int32 = 200, cursor : String = "") : Api::TargetingCriteria
- #targeting_criteria_app_store_categories(q : String | Nil = nil, store : String | Api::TargetingCriteriaAppStoreCategories::Store | Nil = nil) : Api::TargetingCriteriaAppStoreCategories
- #targeting_criteria_conversations(conversation_type : String | Api::TargetingCriteriaConversations::ConversationType | Nil = nil, count : Int32 = 200, cursor : String = "") : Api::TargetingCriteriaConversations
- #targeting_criteria_devices(q : String | Nil = nil, count : Int32 = 200) : Api::TargetingCriteriaDevices
- #targeting_criteria_events(event_types : String | Api::TargetingCriteriaEvents::EventTypes, country_codes : String | Nil = nil, ids : String | Array(String) | Nil = nil, start_time : String | Time | Nil = nil, end_time : String | Time | Nil = nil, count : Int32 = 200, cursor : String = "") : Api::TargetingCriteriaEvents
- #targeting_criteria_interests(q : String | Nil = nil, count : Int32 = 200, cursor : String = "") : Api::TargetingCriteriaInterests
- #targeting_criteria_languages(q : String | Nil = nil, count : Int32 = 200, cursor : String = "") : Api::TargetingCriteriaLanguages
- #targeting_criteria_locations(country_code : String | Nil = nil, location_type : String | Nil = nil, q : String | Nil = nil, count : Int32 = 200, cursor : String = "") : Api::TargetingCriteriaLocations
- #targeting_criteria_network_operators(country_code : String | Nil = nil, q : String | Nil = nil, count : Int32 = 200, cursor : String = "") : Api::TargetingCriteriaNetworkOperators
- #targeting_criteria_platform_versions(q : String | Nil = nil) : Api::TargetingCriteriaPlatformVersions
- #targeting_criteria_platforms(lang : String | Nil = nil, q : String | Nil = nil, count : Int32 = 200) : Api::TargetingCriteriaPlatforms
- #targeting_criteria_tv_markets : Api::TargetingCriteriaTvMarkets
- #targeting_criteria_tv_shows(tv_market_locale : String, q : String | Nil = nil, count : Int32 = 200, cursor : String = "") : Api::TargetingCriteriaTvShows
- #tweet_previews(account_id : String, tweet_type : String | Api::TweetPreviews::TweetType, tweet_ids : Array(Int64)) : Api::TweetPreviews
- #tweets(account_id : String, tweet_type : String | Api::Tweets::TweetType = "PUBLISHED", include_mentions_and_replies : Bool = false, timeline_type : String | Api::Tweets::TimelineType = "NULLCAST", trim_user : Bool = false, tweet_ids : String | Nil = nil, user_id : Int64 | Nil = nil, count : Int32 = 200, cursor : String = "") : Api::Tweets
- #tweets_lookup(id : String | Array(String), expansions : String = "", tweet_fields : String = "", media_fields : String = "", place_fields : String = "", poll_fields : String = "", user_fields : String = "") : Api::TweetsLookup
-
#uri : URI
HTTP
-
#uri=(v : URI) : URI
HTTP
-
#uri=(v : Nil)
nilassignments are always ignored -
#uri? : URI | Nil
HTTP
- #url=(s : String)
- #user_agent : String
- #user_agent=(v : String) : String
-
#user_agent=(v : Nil)
nilassignments are always ignored - #user_agent? : String | Nil
Instance methods inherited from module TwitterAds::Api::Executable
after_executeafter_execute(&callback : Request, HTTP::Client::Response | Nil -> ) after_execute, before_execute
before_execute(&callback : Request -> ) before_execute, execute(req : Request) : Response execute
Constructor Detail
Instance Method Detail
This is not "twitter-ads-api" but "twitter-api" that requires ".json" extension.
So the setting of TwitterAds::Client#api_suffix should be ignored.