Create campaigns
Create a campaign object in Business Central.
HTTP request
Replace the URL prefix for Business Central depending on environment following the guideline.
POST {businesscentralPrefix}/companies({id})/campaignsWebCon
Request headers
| Header | Value |
|---|---|
| Authorization | Bearer {token}. Required. |
| Content-Type | application/json |
Request body
In the request body, supply a JSON representation of campaignsWebCon object.
Response
If successful, this method returns 201 Created response code and a campaign object in the response body.
Example
Request
Here is an example of a request.
POST https://{businesscentralPrefix}/companies({id})/campaignsWebCon
Content-type: application/json
{
"description": "Special Campaign",
"startingDate": "2023-11-01",
"endingDate": "2024-04-01",
"statusCode": "5-START"
}
Response
Here is an example of the response.
Note
The response object shown here may be truncated for brevity. All of the properties will be returned from an actual call.
{
"id": "c19590ca-f835-ee11-a0d1-b1782ffd1f46",
"number": "KP0003",
"description": "Special Campaign2",
"startingDate": "2023-11-01",
"endingDate": "2024-04-01",
"statusCode": "5-START",
"activated": false
}
See also
Tips for working with the APIs
campaign
Get campaign
Delete campaign
Update campaign