# Create Campaign Using HTTP Request Workflow Failing

**URL:** <https://developer.sailpoint.com/discuss/t/create-campaign-using-http-request-workflow-failing/31205>\
**Category:** SHF Discussion and Questions\
**Tags:** workflows, identity-security-cloud\
**Created:** [February 20, 2024, 3:24am UTC](https://developer.sailpoint.com/discuss/t/create-campaign-using-http-request-workflow-failing/31205 "2024-02-20T03:24:43Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijaylca](https://avatars.discourse-cdn.com/v4/letter/v/ecccb3/32.png) [@vijaylca](https://developer.sailpoint.com/discuss/u/vijaylca)\
**Post date:** [February 20, 2024, 3:24am UTC](https://developer.sailpoint.com/discuss/t/create-campaign-using-http-request-workflow-failing/31205/1 "2024-02-20T03:24:43Z")

</div>

Hello, I’m trying to use “HTTP Request Action” in workflows to create a campaign using [https://tenantname.api.identitynow.com/v3/campaigns](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

```json
{
  "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"
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![Santhakumar](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/santhakumar/32/17329_2.png) [@Santhakumar](https://developer.sailpoint.com/discuss/u/Santhakumar)\
**Post date:** [February 20, 2024, 6:23am UTC](https://developer.sailpoint.com/discuss/t/create-campaign-using-http-request-workflow-failing/31205/2 "2024-02-20T06:23:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![GOKUL\_ANANTH\_M](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/gokul_ananth_m/32/14416_2.png) [@GOKUL\_ANANTH\_M](https://developer.sailpoint.com/discuss/u/GOKUL_ANANTH_M)\
**Post date:** [February 20, 2024, 7:31am UTC](https://developer.sailpoint.com/discuss/t/create-campaign-using-http-request-workflow-failing/31205/3 "2024-02-20T07:31:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Wegmannorth](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/wegmannorth/32/33587_2.png) [@Wegmannorth](https://developer.sailpoint.com/discuss/u/Wegmannorth)\
**Post date:** [February 20, 2024, 1:58pm UTC](https://developer.sailpoint.com/discuss/t/create-campaign-using-http-request-workflow-failing/31205/4 "2024-02-20T13:58:51Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![vijaylca](https://avatars.discourse-cdn.com/v4/letter/v/ecccb3/32.png) [@vijaylca](https://developer.sailpoint.com/discuss/u/vijaylca)\
**Post date:** [February 20, 2024, 2:27pm UTC](https://developer.sailpoint.com/discuss/t/create-campaign-using-http-request-workflow-failing/31205/5 "2024-02-20T14:27:24Z")

</div>

> [@GOKUL\_ANANTH\_M](#):
>
> 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

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”  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![vijaylca](https://avatars.discourse-cdn.com/v4/letter/v/ecccb3/32.png) [@vijaylca](https://developer.sailpoint.com/discuss/u/vijaylca)\
**Post date:** [February 20, 2024, 2:42pm UTC](https://developer.sailpoint.com/discuss/t/create-campaign-using-http-request-workflow-failing/31205/6 "2024-02-20T14:42:34Z")

</div>

> [@Wegmannorth](#):
>
> ey, 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).

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"”:}“”}"

---

<div class="post-metadata">

**Author:** ![Wegmannorth](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/wegmannorth/32/33587_2.png) [@Wegmannorth](https://developer.sailpoint.com/discuss/u/Wegmannorth)\
**Post date:** [February 20, 2024, 2:46pm UTC](https://developer.sailpoint.com/discuss/t/create-campaign-using-http-request-workflow-failing/31205/7 "2024-02-20T14:46:03Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![vijaylca](https://avatars.discourse-cdn.com/v4/letter/v/ecccb3/32.png) [@vijaylca](https://developer.sailpoint.com/discuss/u/vijaylca)\
**Post date:** [February 20, 2024, 4:36pm UTC](https://developer.sailpoint.com/discuss/t/create-campaign-using-http-request-workflow-failing/31205/8 "2024-02-20T16:36:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [April 20, 2024, 4:36pm UTC](https://developer.sailpoint.com/discuss/t/create-campaign-using-http-request-workflow-failing/31205/9 "2024-04-20T16:36:58Z")

</div>

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