Activate a Campaign

Hello everybody,

I’m using the following call to activate a campaign:

POST https://.api.identitynow.com/beta/campaigns/df107dbc2d30431ebbd6268b10e3a142/activate

the call is made with role ORG_ADMIN
the header Content-Length=0 because there’s no body.
the header Host=.api.identitynow.com
the campaign has type SEARCH and a list of identities.

The error I receive is [{‘detailCode’: ‘400.1 Bad request content’, ‘trackingId’: ‘4fe3de6274d74a489f551ace791294e3’, ‘messages’:
[{‘locale’: ‘en-US’, ‘localeOrigin’: ‘DEFAULT’, ‘text’: ‘The request was syntactically correct but its content is semantically invalid.’}], ‘causes’: }]

The call sometimes works and sometimes not.

Giuseppe

According to the specification, the campaign you wish to activate must be “STAGED” before you can activate it. Also, although this is not yet documented, the campaign must not be past its deadline. Does the campaign in question meet both criteria?

Hello Colin,

After creating the campaign with success, I try to activate the campaign. The deadline is set to two weeks later.

Regards.
Giuseppe

Have you verified the campaign is “STAGED” before you try to activate it? Some campaigns can take a while to generate and get into a “STAGED” status.

Hello Colin,

Before trying to activate a campaign I wait for 5 seconds.
I don’t know how to check the ‘STAGED’ status of a campaign, is there an API for that?.

Yea, not all campaigns will be ready in 5 seconds. On the UI, a staged campaign will appear as “Preview Ready”.

To check the status via API, use the list campaigns endpoint. You can use the query params to filter by status and name of the campaign. An example response for a staged campaign would be as follows:

[
{
"id": "2c918086719eec070171a7e3355a360a",
"name": "Manager Review",
"description": "A review of everyone's access by their manager.",
"deadline": "2020-12-25T06:00:00.123Z",
"type": "MANAGER",
"status": "STAGED",
"emailNotificationEnabled": false,
"autoRevokeAllowed": false,
"recommendationsEnabled": false
}
]

Hello Colin,

thank you for your suggestions.