Skip to main content

Create advertising post

Creates an advertising post based on a post

Function CreateAd(Val CampaignNumber, Val DailyLimit, Val CategoryNumber, Val PostID, Val AccountID, Val Parameters = "") Export

ParameterCLI optionTypeRequiredDescription
CampaignNumber--campaignString, NumberAdvertising campaign ID
DailyLimit--limitString, NumberDaily limit in rubles
CategoryNumber--categoryString, NumberAdvertising category number
PostID--postString, NumberID of the post used for advertising
AccountID--cabinetString, NumberAdvertising account ID
Parameters--authStructure Of StringAuthorization JSON or path to .json

Returns: Map Of KeyAndValue - serialized JSON response from VK


1C:Enterprise/OneScript code example
    Parameters = GetVKParameters();

CampaignNumber = "1030845310";
DailyLimit = 150;
CategoryNumber = 126;
PostID = "5754";
AccountID = "1607951446";

Result = OPI_VK.CreateAd(CampaignNumber
, DailyLimit
, CategoryNumber
, PostID
, AccountID
, Parameters);
    # JSON data can also be passed as a path to a .json file

oint vk CreateAd \
--campaign 1030846102 \
--limit 150 \
--category 126 \
--post 5790 \
--cabinet "1607951446" \
--auth "{'access_token':'***','owner_id':'-218861756','app_id':'51694790','group_id':'218861756'}"
Result
{
"response": [
{
"id": 0,
"error_code": 603,
"error_desc": "Some ads error occurs: ORD details must be presented."
}
]
}