Share via


Suspend campaign

 

Suspend a Reach campaign previously activated by a call to Activate campaign.

A campaign can be suspended if its start time has not yet been reached (see Campaign life-cycle for more details). The current state of the campaign can be retrieved using the Get campaign command.

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}/suspend?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 suspended.

Response Status Codes

Code

Description

200

Suspended successfully.

400

Can be caused by one of the following conditions:

  • Invalid parameters.

  • Application is not enabled.

  • Suspend action performed on a non scheduled campaign.

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 : draft.

Example

POST /subscriptions/84211edf-7c40-4c47-b152-a6a7233843b7/resourcegroups/MobileEngagement/providers/Microsoft.MobileEngagement/appcollections/myAppCollection/apps/myApp-android/campaigns/announcements/1/suspend?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": "draft"
}