Package com.vk.api.sdk.actions
Class Ads
- java.lang.Object
-
- com.vk.api.sdk.client.AbstractAction
-
- com.vk.api.sdk.actions.Ads
-
public class Ads extends AbstractAction
List of Ads methods
-
-
Constructor Summary
Constructors Constructor Description Ads(VkApiClient client)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AdsAddOfficeUsersQueryaddOfficeUsers(UserActor actor, int accountId, UserSpecificationCutted data)Adds managers and/or supervisors to advertising account.AdsCheckLinkQuerycheckLink(UserActor actor, int accountId, CheckLinkLinkType linkType, java.lang.String linkUrl)Allows to check the ad link.AdsCreateAdsQuerycreateAds(UserActor actor, int accountId, java.lang.String data)Creates ads.AdsCreateCampaignsQuerycreateCampaigns(UserActor actor, int accountId, java.lang.String data)Creates advertising campaigns.AdsCreateClientsQuerycreateClients(UserActor actor, int accountId, java.lang.String data)Creates clients of an advertising agency.AdsCreateTargetGroupQuerycreateTargetGroup(UserActor actor, int accountId, java.lang.String name, int lifetime)Creates a group to re-target ads for users who visited advertiser's site (viewed information about the product, registered, etc.).AdsDeleteAdsQuerydeleteAds(UserActor actor, int accountId, java.lang.String ids)Archives ads.AdsDeleteCampaignsQuerydeleteCampaigns(UserActor actor, int accountId, java.lang.String ids)Archives advertising campaigns.AdsDeleteClientsQuerydeleteClients(UserActor actor, int accountId, java.lang.String ids)Archives clients of an advertising agency.AdsDeleteTargetGroupQuerydeleteTargetGroup(UserActor actor, int accountId, int targetGroupId)Deletes a retarget group.AdsGetAccountsQuerygetAccounts(UserActor actor)Returns a list of advertising accounts.AdsGetAdsQuerygetAds(UserActor actor, int accountId)Returns number of ads.AdsGetAdsLayoutQuerygetAdsLayout(UserActor actor, int accountId)Returns descriptions of ad layouts.AdsGetAdsTargetingQuerygetAdsTargeting(UserActor actor, int accountId)Returns ad targeting parameters.AdsGetBudgetQuerygetBudget(UserActor actor, int accountId)Returns current budget of the advertising account.AdsGetCampaignsQuerygetCampaigns(UserActor actor, int accountId)Returns a list of campaigns in an advertising account.AdsGetCategoriesQuerygetCategories(UserActor actor)Returns a list of possible ad categories.AdsGetClientsQuerygetClients(UserActor actor, int accountId)Returns a list of advertising agency's clients.AdsGetDemographicsQuerygetDemographics(UserActor actor, int accountId, GetDemographicsIdsType idsType, java.lang.String ids, GetDemographicsPeriod period, java.lang.String dateFrom, java.lang.String dateTo)Returns demographics for ads or campaigns.AdsGetFloodStatsQuerygetFloodStats(UserActor actor, int accountId)Returns information about current state of a counter — number of remaining runs of methods and time to the next counter nulling in seconds.AdsGetLookalikeRequestsQuerygetLookalikeRequests(UserActor actor, int accountId)AdsGetMusiciansQuerygetMusicians(UserActor actor, java.lang.String artistName)AdsGetMusiciansByIdsQuerygetMusiciansByIds(UserActor actor, java.lang.Integer... ids)AdsGetMusiciansByIdsQuerygetMusiciansByIds(UserActor actor, java.util.List<java.lang.Integer> ids)AdsGetOfficeUsersQuerygetOfficeUsers(UserActor actor, int accountId)Returns a list of managers and supervisors of advertising account.AdsGetPostsReachQuerygetPostsReach(UserActor actor, int accountId, GetPostsReachIdsType idsType, java.lang.String ids)Returns detailed statistics of promoted posts reach from campaigns and ads.AdsGetRejectionReasonQuerygetRejectionReason(UserActor actor, int accountId, int adId)Returns a reason of ad rejection for pre-moderation.AdsGetStatisticsQuerygetStatistics(UserActor actor, int accountId, GetStatisticsIdsType idsType, java.lang.String ids, GetStatisticsPeriod period, java.lang.String dateFrom, java.lang.String dateTo)Returns statistics of performance indicators for ads, campaigns, clients or the whole account.AdsGetSuggestionsQuerygetSuggestions(UserActor actor, GetSuggestionsSection section)Returns a set of auto-suggestions for various targeting parameters.AdsGetSuggestionsQueryWithRegionsgetSuggestionsRegions(UserActor actor, GetSuggestionsSection section)Returns a set of auto-suggestions for various targeting parameters.AdsGetSuggestionsQueryWithSchoolsgetSuggestionsSchools(UserActor actor, GetSuggestionsSection section)Returns a set of auto-suggestions for various targeting parameters.AdsGetSuggestionsQueryWithCitiesgetSuggestionsWithCities(UserActor actor, GetSuggestionsSection section, java.lang.String cities)Returns a set of auto-suggestions for various targeting parameters.AdsGetTargetGroupsQuerygetTargetGroups(UserActor actor, int accountId)Returns a list of target groups.AdsGetTargetingStatsQuerygetTargetingStats(UserActor actor, int accountId, java.lang.String linkUrl)Returns the size of targeting audience, and also recommended values for CPC and CPM.AdsGetUploadURLQuerygetUploadURL(UserActor actor, int adFormat)Returns URL to upload an ad photo to.AdsGetVideoUploadURLQuerygetVideoUploadURL(UserActor actor)Returns URL to upload an ad video to.AdsImportTargetContactsQueryimportTargetContacts(UserActor actor, int accountId, int targetGroupId, java.lang.String contacts)Imports a list of advertiser's contacts to count VK registered users against the target group.AdsRemoveOfficeUsersQueryremoveOfficeUsers(UserActor actor, int accountId, java.lang.String ids)Removes managers and/or supervisors from advertising account.AdsUpdateAdsQueryupdateAds(UserActor actor, int accountId, java.lang.String data)Edits ads.AdsUpdateCampaignsQueryupdateCampaigns(UserActor actor, int accountId, java.lang.String data)Edits advertising campaigns.AdsUpdateClientsQueryupdateClients(UserActor actor, int accountId, java.lang.String data)Edits clients of an advertising agency.AdsUpdateOfficeUsersQueryupdateOfficeUsers(UserActor actor, int accountId, UserSpecification data)Adds managers and/or supervisors to advertising account.AdsUpdateTargetGroupQueryupdateTargetGroup(UserActor actor, int accountId, int targetGroupId, java.lang.String name, int lifetime)Edits a retarget group.-
Methods inherited from class com.vk.api.sdk.client.AbstractAction
getClient
-
-
-
-
Constructor Detail
-
Ads
public Ads(VkApiClient client)
Constructor- Parameters:
client- vk api client
-
-
Method Detail
-
addOfficeUsers
public AdsAddOfficeUsersQuery addOfficeUsers(UserActor actor, int accountId, UserSpecificationCutted data)
Adds managers and/or supervisors to advertising account.- Parameters:
actor- vk actoraccountId- Advertising account ID.data- Serialized JSON array of objects that describe added managers. Description of 'user_specification' objects see below.- Returns:
- query
-
checkLink
public AdsCheckLinkQuery checkLink(UserActor actor, int accountId, CheckLinkLinkType linkType, java.lang.String linkUrl)
Allows to check the ad link.- Parameters:
actor- vk actoraccountId- Advertising account ID.linkType- Object type: *'community' — community,, *'post' — community post,, *'application' — VK application,, *'video' — video,, *'site' — external site.linkUrl- Object URL.- Returns:
- query
-
createAds
public AdsCreateAdsQuery createAds(UserActor actor, int accountId, java.lang.String data)
Creates ads.- Parameters:
actor- vk actoraccountId- Advertising account ID.data- Serialized JSON array of objects that describe created ads. Description of 'ad_specification' objects see below.- Returns:
- query
-
createCampaigns
public AdsCreateCampaignsQuery createCampaigns(UserActor actor, int accountId, java.lang.String data)
Creates advertising campaigns.- Parameters:
actor- vk actoraccountId- Advertising account ID.data- Serialized JSON array of objects that describe created campaigns. Description of 'campaign_specification' objects see below.- Returns:
- query
-
createClients
public AdsCreateClientsQuery createClients(UserActor actor, int accountId, java.lang.String data)
Creates clients of an advertising agency.- Parameters:
actor- vk actoraccountId- Advertising account ID.data- Serialized JSON array of objects that describe created campaigns. Description of 'client_specification' objects see below.- Returns:
- query
-
createTargetGroup
public AdsCreateTargetGroupQuery createTargetGroup(UserActor actor, int accountId, java.lang.String name, int lifetime)
Creates a group to re-target ads for users who visited advertiser's site (viewed information about the product, registered, etc.).- Parameters:
actor- vk actoraccountId- Advertising account ID.name- Name of the target group — a string up to 64 characters long.lifetime- 'For groups with auditory created with pixel code only.', , Number of days after that users will be automatically removed from the group.- Returns:
- query
-
deleteAds
public AdsDeleteAdsQuery deleteAds(UserActor actor, int accountId, java.lang.String ids)
Archives ads.- Parameters:
actor- vk actoraccountId- Advertising account ID.ids- Serialized JSON array with ad IDs.- Returns:
- query
-
deleteCampaigns
public AdsDeleteCampaignsQuery deleteCampaigns(UserActor actor, int accountId, java.lang.String ids)
Archives advertising campaigns.- Parameters:
actor- vk actoraccountId- Advertising account ID.ids- Serialized JSON array with IDs of deleted campaigns.- Returns:
- query
-
deleteClients
public AdsDeleteClientsQuery deleteClients(UserActor actor, int accountId, java.lang.String ids)
Archives clients of an advertising agency.- Parameters:
actor- vk actoraccountId- Advertising account ID.ids- Serialized JSON array with IDs of deleted clients.- Returns:
- query
-
deleteTargetGroup
public AdsDeleteTargetGroupQuery deleteTargetGroup(UserActor actor, int accountId, int targetGroupId)
Deletes a retarget group.- Parameters:
actor- vk actoraccountId- Advertising account ID.targetGroupId- Group ID.- Returns:
- query
-
getAccounts
public AdsGetAccountsQuery getAccounts(UserActor actor)
Returns a list of advertising accounts.- Parameters:
actor- vk actor- Returns:
- query
-
getAds
public AdsGetAdsQuery getAds(UserActor actor, int accountId)
Returns number of ads.- Parameters:
actor- vk actoraccountId- Advertising account ID.- Returns:
- query
-
getAdsLayout
public AdsGetAdsLayoutQuery getAdsLayout(UserActor actor, int accountId)
Returns descriptions of ad layouts.- Parameters:
actor- vk actoraccountId- Advertising account ID.- Returns:
- query
-
getAdsTargeting
public AdsGetAdsTargetingQuery getAdsTargeting(UserActor actor, int accountId)
Returns ad targeting parameters.- Parameters:
actor- vk actoraccountId- Advertising account ID.- Returns:
- query
-
getBudget
public AdsGetBudgetQuery getBudget(UserActor actor, int accountId)
Returns current budget of the advertising account.- Parameters:
actor- vk actoraccountId- Advertising account ID.- Returns:
- query
-
getCampaigns
public AdsGetCampaignsQuery getCampaigns(UserActor actor, int accountId)
Returns a list of campaigns in an advertising account.- Parameters:
actor- vk actoraccountId- Advertising account ID.- Returns:
- query
-
getCategories
public AdsGetCategoriesQuery getCategories(UserActor actor)
Returns a list of possible ad categories.- Parameters:
actor- vk actor- Returns:
- query
-
getClients
public AdsGetClientsQuery getClients(UserActor actor, int accountId)
Returns a list of advertising agency's clients.- Parameters:
actor- vk actoraccountId- Advertising account ID.- Returns:
- query
-
getDemographics
public AdsGetDemographicsQuery getDemographics(UserActor actor, int accountId, GetDemographicsIdsType idsType, java.lang.String ids, GetDemographicsPeriod period, java.lang.String dateFrom, java.lang.String dateTo)
Returns demographics for ads or campaigns.- Parameters:
actor- vk actoraccountId- Advertising account ID.idsType- Type of requested objects listed in 'ids' parameter: *ad — ads,, *campaign — campaigns.ids- IDs requested ads or campaigns, separated with a comma, depending on the value set in 'ids_type'. Maximum 2000 objects.period- Data grouping by dates: *day — statistics by days,, *month — statistics by months,, *overall — overall statistics. 'date_from' and 'date_to' parameters set temporary limits.dateFrom- Date to show statistics from. For different value of 'period' different date format is used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — day it was created on,, *month: YYYY-MM, example: 2011-09 — September 2011, **0 — month it was created in,, *overall: 0.dateTo- Date to show statistics to. For different value of 'period' different date format is used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — current day,, *month: YYYY-MM, example: 2011-09 — September 2011, **0 — current month,, *overall: 0.- Returns:
- query
-
getFloodStats
public AdsGetFloodStatsQuery getFloodStats(UserActor actor, int accountId)
Returns information about current state of a counter — number of remaining runs of methods and time to the next counter nulling in seconds.- Parameters:
actor- vk actoraccountId- Advertising account ID.- Returns:
- query
-
getLookalikeRequests
public AdsGetLookalikeRequestsQuery getLookalikeRequests(UserActor actor, int accountId)
- Parameters:
actor- vk actoraccountId-- Returns:
- query
-
getMusicians
public AdsGetMusiciansQuery getMusicians(UserActor actor, java.lang.String artistName)
- Parameters:
actor- vk actorartistName-- Returns:
- query
-
getMusiciansByIds
public AdsGetMusiciansByIdsQuery getMusiciansByIds(UserActor actor, java.lang.Integer... ids)
- Parameters:
actor- vk actorids-- Returns:
- query
-
getMusiciansByIds
public AdsGetMusiciansByIdsQuery getMusiciansByIds(UserActor actor, java.util.List<java.lang.Integer> ids)
- Parameters:
actor- vk actorids-- Returns:
- query
-
getOfficeUsers
public AdsGetOfficeUsersQuery getOfficeUsers(UserActor actor, int accountId)
Returns a list of managers and supervisors of advertising account.- Parameters:
actor- vk actoraccountId- Advertising account ID.- Returns:
- query
-
getPostsReach
public AdsGetPostsReachQuery getPostsReach(UserActor actor, int accountId, GetPostsReachIdsType idsType, java.lang.String ids)
Returns detailed statistics of promoted posts reach from campaigns and ads.- Parameters:
actor- vk actoraccountId- Advertising account ID.idsType- Type of requested objects listed in 'ids' parameter: *ad — ads,, *campaign — campaigns.ids- IDs requested ads or campaigns, separated with a comma, depending on the value set in 'ids_type'. Maximum 100 objects.- Returns:
- query
-
getRejectionReason
public AdsGetRejectionReasonQuery getRejectionReason(UserActor actor, int accountId, int adId)
Returns a reason of ad rejection for pre-moderation.- Parameters:
actor- vk actoraccountId- Advertising account ID.adId- Ad ID.- Returns:
- query
-
getStatistics
public AdsGetStatisticsQuery getStatistics(UserActor actor, int accountId, GetStatisticsIdsType idsType, java.lang.String ids, GetStatisticsPeriod period, java.lang.String dateFrom, java.lang.String dateTo)
Returns statistics of performance indicators for ads, campaigns, clients or the whole account.- Parameters:
actor- vk actoraccountId- Advertising account ID.idsType- Type of requested objects listed in 'ids' parameter: *ad — ads,, *campaign — campaigns,, *client — clients,, *office — account.ids- IDs requested ads, campaigns, clients or account, separated with a comma, depending on the value set in 'ids_type'. Maximum 2000 objects.period- Data grouping by dates: *day — statistics by days,, *month — statistics by months,, *overall — overall statistics. 'date_from' and 'date_to' parameters set temporary limits.dateFrom- Date to show statistics from. For different value of 'period' different date format is used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — day it was created on,, *month: YYYY-MM, example: 2011-09 — September 2011, **0 — month it was created in,, *overall: 0.dateTo- Date to show statistics to. For different value of 'period' different date format is used: *day: YYYY-MM-DD, example: 2011-09-27 — September 27, 2011, **0 — current day,, *month: YYYY-MM, example: 2011-09 — September 2011, **0 — current month,, *overall: 0.- Returns:
- query
-
getSuggestions
public AdsGetSuggestionsQuery getSuggestions(UserActor actor, GetSuggestionsSection section)
Returns a set of auto-suggestions for various targeting parameters.- Parameters:
actor- vk actorsection- Section, suggestions are retrieved in. Available values: *countries — request of a list of countries. If q is not set or blank, a short list of countries is shown. Otherwise, a full list of countries is shown. *regions — requested list of regions. 'country' parameter is required. *cities — requested list of cities. 'country' parameter is required. *districts — requested list of districts. 'cities' parameter is required. *stations — requested list of subway stations. 'cities' parameter is required. *streets — requested list of streets. 'cities' parameter is required. *schools — requested list of educational organizations. 'cities' parameter is required. *interests — requested list of interests. *positions — requested list of positions (professions). *group_types — requested list of group types. *religions — requested list of religious commitments. *browsers — requested list of browsers and mobile devices.- Returns:
- query
-
getSuggestionsRegions
public AdsGetSuggestionsQueryWithRegions getSuggestionsRegions(UserActor actor, GetSuggestionsSection section)
Returns a set of auto-suggestions for various targeting parameters.- Parameters:
actor- vk actorsection- Section, suggestions are retrieved in. Available values: *countries — request of a list of countries. If q is not set or blank, a short list of countries is shown. Otherwise, a full list of countries is shown. *regions — requested list of regions. 'country' parameter is required. *cities — requested list of cities. 'country' parameter is required. *districts — requested list of districts. 'cities' parameter is required. *stations — requested list of subway stations. 'cities' parameter is required. *streets — requested list of streets. 'cities' parameter is required. *schools — requested list of educational organizations. 'cities' parameter is required. *interests — requested list of interests. *positions — requested list of positions (professions). *group_types — requested list of group types. *religions — requested list of religious commitments. *browsers — requested list of browsers and mobile devices.- Returns:
- query
-
getSuggestionsSchools
public AdsGetSuggestionsQueryWithSchools getSuggestionsSchools(UserActor actor, GetSuggestionsSection section)
Returns a set of auto-suggestions for various targeting parameters.- Parameters:
actor- vk actorsection- Section, suggestions are retrieved in. Available values: *countries — request of a list of countries. If q is not set or blank, a short list of countries is shown. Otherwise, a full list of countries is shown. *regions — requested list of regions. 'country' parameter is required. *cities — requested list of cities. 'country' parameter is required. *districts — requested list of districts. 'cities' parameter is required. *stations — requested list of subway stations. 'cities' parameter is required. *streets — requested list of streets. 'cities' parameter is required. *schools — requested list of educational organizations. 'cities' parameter is required. *interests — requested list of interests. *positions — requested list of positions (professions). *group_types — requested list of group types. *religions — requested list of religious commitments. *browsers — requested list of browsers and mobile devices.- Returns:
- query
-
getSuggestionsWithCities
public AdsGetSuggestionsQueryWithCities getSuggestionsWithCities(UserActor actor, GetSuggestionsSection section, java.lang.String cities)
Returns a set of auto-suggestions for various targeting parameters.- Parameters:
actor- vk actorsection- Section, suggestions are retrieved in. Available values: *countries — request of a list of countries. If q is not set or blank, a short list of countries is shown. Otherwise, a full list of countries is shown. *regions — requested list of regions. 'country' parameter is required. *cities — requested list of cities. 'country' parameter is required. *districts — requested list of districts. 'cities' parameter is required. *stations — requested list of subway stations. 'cities' parameter is required. *streets — requested list of streets. 'cities' parameter is required. *schools — requested list of educational organizations. 'cities' parameter is required. *interests — requested list of interests. *positions — requested list of positions (professions). *group_types — requested list of group types. *religions — requested list of religious commitments. *browsers — requested list of browsers and mobile devices.cities- IDs of cities where objects are searched in, separated with a comma.- Returns:
- query
-
getTargetGroups
public AdsGetTargetGroupsQuery getTargetGroups(UserActor actor, int accountId)
Returns a list of target groups.- Parameters:
actor- vk actoraccountId- Advertising account ID.- Returns:
- query
-
getTargetingStats
public AdsGetTargetingStatsQuery getTargetingStats(UserActor actor, int accountId, java.lang.String linkUrl)
Returns the size of targeting audience, and also recommended values for CPC and CPM.- Parameters:
actor- vk actoraccountId- Advertising account ID.linkUrl- URL for the advertised object.- Returns:
- query
-
getUploadURL
public AdsGetUploadURLQuery getUploadURL(UserActor actor, int adFormat)
Returns URL to upload an ad photo to.- Parameters:
actor- vk actoradFormat- Ad format: *1 — image and text,, *2 — big image,, *3 — exclusive format,, *4 — community, square image,, *7 — special app format.- Returns:
- query
-
getVideoUploadURL
public AdsGetVideoUploadURLQuery getVideoUploadURL(UserActor actor)
Returns URL to upload an ad video to.- Parameters:
actor- vk actor- Returns:
- query
-
importTargetContacts
public AdsImportTargetContactsQuery importTargetContacts(UserActor actor, int accountId, int targetGroupId, java.lang.String contacts)
Imports a list of advertiser's contacts to count VK registered users against the target group.- Parameters:
actor- vk actoraccountId- Advertising account ID.targetGroupId- Target group ID.contacts- List of phone numbers, emails or user IDs separated with a comma.- Returns:
- query
-
removeOfficeUsers
public AdsRemoveOfficeUsersQuery removeOfficeUsers(UserActor actor, int accountId, java.lang.String ids)
Removes managers and/or supervisors from advertising account.- Parameters:
actor- vk actoraccountId- Advertising account ID.ids- Serialized JSON array with IDs of deleted managers.- Returns:
- query
-
updateAds
public AdsUpdateAdsQuery updateAds(UserActor actor, int accountId, java.lang.String data)
Edits ads.- Parameters:
actor- vk actoraccountId- Advertising account ID.data- Serialized JSON array of objects that describe changes in ads. Description of 'ad_edit_specification' objects see below.- Returns:
- query
-
updateCampaigns
public AdsUpdateCampaignsQuery updateCampaigns(UserActor actor, int accountId, java.lang.String data)
Edits advertising campaigns.- Parameters:
actor- vk actoraccountId- Advertising account ID.data- Serialized JSON array of objects that describe changes in campaigns. Description of 'campaign_mod' objects see below.- Returns:
- query
-
updateClients
public AdsUpdateClientsQuery updateClients(UserActor actor, int accountId, java.lang.String data)
Edits clients of an advertising agency.- Parameters:
actor- vk actoraccountId- Advertising account ID.data- Serialized JSON array of objects that describe changes in clients. Description of 'client_mod' objects see below.- Returns:
- query
-
updateOfficeUsers
public AdsUpdateOfficeUsersQuery updateOfficeUsers(UserActor actor, int accountId, UserSpecification data)
Adds managers and/or supervisors to advertising account.- Parameters:
actor- vk actoraccountId- Advertising account ID.data- Serialized JSON array of objects that describe added managers. Description of 'user_specification' objects see below.- Returns:
- query
-
updateTargetGroup
public AdsUpdateTargetGroupQuery updateTargetGroup(UserActor actor, int accountId, int targetGroupId, java.lang.String name, int lifetime)
Edits a retarget group.- Parameters:
actor- vk actoraccountId- Advertising account ID.targetGroupId- Group ID.name- New name of the target group — a string up to 64 characters long.lifetime- 'Only for the groups that get audience from sites with user accounting code.', Time in days when users added to a retarget group will be automatically excluded from it. '0' - automatic exclusion is off.- Returns:
- query
-
-