Skip to main content

Create advertising campaign

Creates a campaign in the selected advertising account

Function CreateAdvertisingCampaign(Val AccountID, Val Name, Val Parameters = "") Export

ParameterCLI optionTypeRequiredDescription
AccountID--cabinetString, NumberAdvertising account ID
Name--titleStringCampaign name
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();

AccountID = "1607951446";
Name = "New campaign";

Result = OPI_VK.CreateAdvertisingCampaign(AccountID, Name, Parameters);
    # JSON data can also be passed as a path to a .json file

oint vk CreateAdvertisingCampaign \
--cabinet "1607951446" \
--title "New campaign" \
--auth "{'access_token':'***','owner_id':'-218861756','app_id':'51694790','group_id':'218861756'}"
Result
{
"response": [
{
"id": 1030702431,
"error_code": 602,
"error_desc": "Some part of the request has not been completed"
}
]
}