# HTTP Workflow status code

**URL:** <https://developer.sailpoint.com/discuss/t/http-workflow-status-code/5497>\
**Category:** SHF Discussion and Questions\
**Tags:** workflows\
**Created:** [August 23, 2022, 9:24am UTC](https://developer.sailpoint.com/discuss/t/http-workflow-status-code/5497 "2022-08-23T09:24:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manju22](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Manju22](https://developer.sailpoint.com/discuss/u/Manju22)\
**Post date:** [August 23, 2022, 9:24am UTC](https://developer.sailpoint.com/discuss/t/http-workflow-status-code/5497/1 "2022-08-23T09:24:10Z")

</div>

Hi,  
I created a workflow with “HTTP request” action and compare strings operator after that to look for HTTP status code .

Though our API response returns 202 as a status code, the workflow does not consider that as a true condition and it goes to a false condition. ($.hTTPRequest.statusCode = 202). When I change the compare strings to ($.hTTPRequest.body = Accepted), it works.

I believe there is some issue with hTTPRequest.statusCode and you can see the values of the response in the below screenshot.

“result”:{“body”:“Accepted”,“headers”:null,“responseTime”:“0.033403 seconds”,“statusCode”:202} (Why is 202 not in double quotation marks?)

I have included the header Accept:application/json

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/1/115d272819cb3df3194be2a610bfd378b93fd106.png)  
 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/e/eac0a95facc020448cecb07a34732e00654025c1.png)

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [August 23, 2022, 1:59pm UTC](https://developer.sailpoint.com/discuss/t/http-workflow-status-code/5497/2 "2022-08-23T13:59:31Z")

</div>

The `statusCode` is an integer per the [HTTP RFC](https://www.rfc-editor.org/rfc/rfc2616#section-6.1.1). Rather than use **Compare Strings** , try using **Compare Numbers** to check the value of the `statusCode`.

---

<div class="post-metadata">

**Author:** ![Manju22](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Manju22](https://developer.sailpoint.com/discuss/u/Manju22)\
**Post date:** [August 23, 2022, 2:57pm UTC](https://developer.sailpoint.com/discuss/t/http-workflow-status-code/5497/3 "2022-08-23T14:57:44Z")

</div>

I tested using compare numbers as well. Same issue.

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/3/31b58ea15a19566cfe32d8623668ddbce2fd96c6.png)

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/0/0fd4d517a2d7a6dbdfddd16892f98daabbb09a31.png)

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [August 23, 2022, 4:09pm UTC](https://developer.sailpoint.com/discuss/t/http-workflow-status-code/5497/4 "2022-08-23T16:09:49Z")

</div>

I have verified that this is a bug. The value you provide in **Value 2** gets converted to a string in the script, which will result in a **False** value every time because you can’t compare a number with a string. I have opened a bug ticket for engineering to resolve this. In the meantime, you can fix this issue by downloading the workflow script and manually updating **Value 2** to be the integer representation of 202.

For example, here is a snippet of my workflow script where **Value 2** is saved as a string.

```json
{
	"name": "Test Comparison 2",
	"description": "",
	"modified": "2022-08-23T16:05:27.522649778Z",
	"definition": {
		"start": "HTTP Request",
		"steps": {
			"Compare Numbers": {
				"choiceList": [
					{
						"comparator": "NumericEquals",
						"nextStep": "success",
						"variableA.$": "$.hTTPRequest.statusCode",
						"variableB": "200"
					}
				],
				"defaultStep": "failure",
				"type": "choice"
			},

```

To fix this, modify \*_VariableB_ to be an integer and upload your script.

```json
{
	"name": "Test Comparison 2",
	"description": "",
	"modified": "2022-08-23T16:05:27.522649778Z",
	"definition": {
		"start": "HTTP Request",
		"steps": {
			"Compare Numbers": {
				"choiceList": [
					{
						"comparator": "NumericEquals",
						"nextStep": "success",
						"variableA.$": "$.hTTPRequest.statusCode",
						"variableB": 200
					}
				],
				"defaultStep": "failure",
				"type": "choice"
			},

```

---

<div class="post-metadata">

**Author:** ![Manju22](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Manju22](https://developer.sailpoint.com/discuss/u/Manju22)\
**Post date:** [August 23, 2022, 4:39pm UTC](https://developer.sailpoint.com/discuss/t/http-workflow-status-code/5497/5 "2022-08-23T16:39:42Z")

</div>

@colin_mckibben Thanks for quick response.

Can you inform us when the bug is fixed?

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [September 30, 2022, 1:31pm UTC](https://developer.sailpoint.com/discuss/t/http-workflow-status-code/5497/6 "2022-09-30T13:31:14Z")

</div>

This bug should now be fixed. Please let us know if you encounter any more issues with 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:** [July 19, 2023, 2:23pm UTC](https://developer.sailpoint.com/discuss/t/http-workflow-status-code/5497/7 "2023-07-19T14:23:28Z")

</div>

Closed on July 19, 2023, 2:23pm UTC


