Update the Campaign Approval Status of a Campaign

Use this interface to update the campaign approval status of a campaign.

Note: The Responsys Advanced API is generally available for all Responsys customers.

Service URL:

/rest/api/v1.3/approval/campaigns/{campaignName}

Required Path Parameters:

campaignName - Name of the campaign to update.

Request Method:

PUT

Request Header:

Authorization=<AUTH_TOKEN>

Content-Type=application/json

Request Body - Required Properties:

status – The campaign approval status to change. Possible values include: NEEDS_APPROVAL, APPROVED, REJECTED, APPROVAL_NOT_REQUIRED.

Sample Request Body

{
  "approvalStatus": "NEEDS_APPROVAL"
}

Sample Response Body - Success

{
    "approvalStatus": "NEEDS_APPROVAL",
    "campaignName": "Campaign_trigger_program",
    "campaignType": "EMAIL",
    "printableLink": "https://XXXXXX-api.responsys.net/emd/c/campaigndesigner/email/request/printableview?campaignId=1865801",
    "links": [
        {
            "rel": "self",
            "href": "/rest/api/v1.3/approval/campaigns/Campaign_trigger_program",
            "method": "PUT"
        },
        {
            "rel": "getCampaignApprovalStatus",
            "href": "/rest/api/v1.3/approval/campaigns/Campaign_trigger_program",
            "method": "GET"
        },
        {
            "rel": "getAllCampaignsApprovalStatus",
            "href": "/rest/api/v1.3/approval/campaigns",
            "method": "GET"
        }
    ]
}

Sample Responses - Failure

400 Bad Request

Invalid campaign type: The Campaign Approvals API currently only supports EMD Campaigns. If a non EMD campaign is selected, the error response will resemble the following:

{
  "type": "",
  "title": "Invalid Campaign Type",
  "errorCode": "INVALID_CAMPAIGN_TYPE",
  "detail": "This Api is supported only for EMD Campaigns",
  "errorDetails": []
}

Invalid approval state: If an invalid campaign approval state is supplied, the error response will resemble the following:

{
  "type": "",
  "title": "Invalid Campaign Approval State",
  "errorCode": "INVALID_CAMPAIGN_APPROVAL_STATE",
  "detail": "Campaign Approval State [<campaignApprovalSate>] is not valid ",
  "errorDetails": []
}

Request for approval for a campaign in pending approval state: If a campaign approval request has already been sent for a campaign, the error response will resemble the following:

{
  "type": "",
  "title": "Invalid Campaign Approval workflow State",
  "errorCode": "INVALID_CAMPAIGN_APPROVAL_WORKFLOW_STATE",
  "detail": "An approval request for the EMD email campaign {campaignName} has already been created",
  "errorDetails": []
}

401 Unauthorized

Campaign approvals disabled for account: This request will fail if the user does not have the Campaign approvals feature enabled. The error response will resemble the following:

{ 
  "type": "",
  "title": "API disabled for user ",
  "errorCode": "UNAUTHORIZED",
  "detail": "Campaign Approval is not enabled for this account",
  "errorDetails": []
}

404 Not Found

Campaign not found error: If the campaign cannot be found, the error response will resemble the following:

{ 
  "type": "",
  "title": "Campaign not found",
  "errorCode": "CAMPAIGN_NOT_FOUND",
  "detail": "Campaign [<campaignName>] not found",
  "errorDetails": []
}