Activate campaign

 

Activate a campaign previously created by a call to Create campaign.

Request

Method

Request URI

HTTP version

POST

https://management.azure.com/subscriptions/{subscription-id}/resourcegroups/{resource-group-name}/providers/Microsoft.MobileEngagement/appcollections/{app-collection}/apps/{app-resource-name}/campaigns/{kind}/{id}/activate?api-version=2014-12-01

HTTP/1.1

Authentication

See Authentication.

Request URI Path Parameters

Parameter

Description

kind

Kind of campaign. Valid values are: announcements, polls, dataPushes, and nativePushes.

id

Campaign identifier as returned by a call to Create campaign. You can get a list of campaigns by calling List campaigns.

Query String Parameters

Parameter

Description

api-version

API version, the only supported value is 2014-12-01.

Request Headers

The following table describes required and optional request headers.

Request Header

Description

Authorization

See Authentication.

Accept (optional)

Its recommended to pass */* or application/json to have JSON error responses.

Request Body

None.

Response

A 200 status code is returned when the campaign is activated.

Response Status Codes

Code

Description

200

Activated successfully.

400

Can be caused by one of the following conditions:

  • Invalid parameters.

  • Application is not enabled.

  • Campaign not in draft state.

Check response body for details.

401

Authentication error.

404

Campaign not found.

For information about status codes, see Status and Error Codes.

Response Headers

Content-Type

application/json

Response Body

A JSON object containing the following properties if the request was successful.

Property

Description

id

Campaign identifier.

state

New campaign state : scheduled.

If the campaign startTime is unset or is reached, the campaign then transitions to in-progress state automatically.

Example

POST /subscriptions/84211edf-7c40-4c47-b152-a6a7233843b7/resourcegroups/MobileEngagement/providers/Microsoft.MobileEngagement/appcollections/myAppCollection/apps/myApp-android/campaigns/announcements/1/activate?api-version=2014-12-01 HTTP/1.1
Host: management.azure.com
Accept: */*
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik1uQ19WWmNBVGZNNXBPWWlKSE1iYTlnb0VLWSIsImtpZCI6Ik1uQ19WWmNBVGZNNXBPWWlKSE1iYTlnb0VLWSJ9.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuY29yZS53aW5kb3dzLm5ldC8iL

HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": 1,
  "state": "scheduled"
}