Create Campaign Using HTTP Request Workflow Failing

Hello, I’m trying to use “HTTP Request Action” in workflows to create a campaign using https://tenantname.api.identitynow.com/v3/campaigns

However, it fails with “Error request Failed”. Did anyone run into same issue ?

I’m able to create the same campaign using Postman with no issues. I have confirmed that client secret, URL etc correctly provided by calling a different IDN API successful

Here is the body my POST method

{
  "name": "Simple Test",
  "description": "Simple Test",
  "deadline": "2024-02-26T10:00:01.456Z",
  "type": "SEARCH",
  "searchCampaignInfo": {
    "type": "ACCESS",
    "query": "source.id:632desc4ace2d0f4ea29ed2bc3a61d1d6b0",
    "identityIds" : [
		"2c91345278c95ceb0172c993a5fa4fba"
	],
    "reviewer": {
      "type": "IDENTITY",
      "id": "2c91808472a4sdwscf72c3f7ace34291",
      "name": "Test User"
    }
  }
}

Hi @vijaylca can u check the scope of your client ID and Secret.

Hi Vijay,

Could you please provide the JSON portion of the HTTP request? Additionally, please verify the scope of the Personal Access Token (PAT) as well.

Check “idn:campaign:manage” or “sp:scopes:all” these scope is enabled.

Hey, if you check executions for the workflow and download the CSV file containing the logs, do you get more info regarding the error message? If so, what does it say?

If not, are you blocking any geographical locations? HTTP Traffic from your tenant to IdentityNow API’s might be in a different country than you are in right now. I have had this issue before, where API traffic has required us to open up our tenant to being accessable from Germany (cus traffic was going to Frankfurt).

I don’t think it’s a scope issue because same clientID and secret was used to create the same campaign using Postman with no issues

Here JSON Portion of HTTP request

{
“name”: “Simple Test”,
“description”: “Simple Test”,
“deadline”: “2024-02-26T10:00:01.456Z”,
“type”: “SEARCH”,
“searchCampaignInfo”: {
“type”: “ACCESS”,
“query”: “source.id:632desc4ace2d0f4ea29ed2bc3a61d1d6b0”,
“identityIds” : [
“2c91345278c95ceb0172c993a5fa4fba”
],
“reviewer”: {
“type”: “IDENTITY”,
“id”: “2c91808472a4sdwscf72c3f7ace34291”,
“name”: “Test User”
}
}
}

Seeing below in execution logs

WorkflowExecutionFailed,“2024-02-20T03:22:07.229056427Z”,“{”“error”“:”“actionStep(HTTP Request) Err: task failed: activity error (type: sp:external:http:v2, scheduledEventID: 5, startedEventID: 6, identity: 69c571f6-69c2-4917-bc36-6a7cfacd473f): request failed (type: HTTP Response Returned a Client Error, retryable: false): request failed: 400 - 400 Bad Request - {"“detailCode"”:"”**400.0 Bad request syntax**“”,"“trackingId"”:"“d6e5ed873d3e4fb0b1e29b396693ce41"”,"“messages"”:[{"“locale"”:"“und"”,"“localeOrigin"”:"“REQUEST"”,"“text"”:"“The request could not be parsed."”},{"“locale"”:"“en-US"”,"“localeOrigin"”:"“DEFAULT"”,"“text"”:"“The request could not be parsed."”}],"“causes"”:}“”}"

Alright, then it does not seem to be the issue I talked about above, as that would throw a 403 (or 500) error.

When executing the workflow, what does the output show when escaped? (In the input/output window of the workflow test)

Found the issue. We can’t use API key generated using “Global security credentials”

It must be PAT for Create campaign API when using HTTP request in workflows

Previously I was using API key generated using “Global security credentials” . Those API keys were working using Postman but failing when used through workflows.

When I used newly created PAT ClientID, then it was successful

Thank you everyone who helped me narrow down the issue and resolve it.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.