# Workflow HTTP request body parsing error

**URL:** <https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223>\
**Category:** SHF Discussion and Questions\
**Tags:** identity-security-cloud, workflows\
**Created:** [November 19, 2024, 4:25pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223 "2024-11-19T16:25:48Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidtrn](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/davidtrn/32/19752_2.png) [@davidtrn](https://developer.sailpoint.com/discuss/u/davidtrn)\
**Post date:** [November 19, 2024, 4:25pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223/1 "2024-11-19T16:25:48Z")

</div>

Hello all,

I am trying to use a workflow where :

- I call the ICS’ API to get all Access review items of a campaign certification
- Call another workflow through API with as input the response from the request above

This does work when I use the “Choose Variable” setting to select the $.hTTPRequest.body but it doesn’t when I use the “Enter Value” setting with the double brackets : {{$.hTTPRequest.body}}.

I have the following error : “Unable to parse input as JSON, please ensure it is syntactically correct. (type: Error Parsing Input, retryable: false): invalid character ‘m’ looking for beginning of value”

This works ok :

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/8/e/8ee33be4ad134308527534d7e396da2ab94b36c4.png)

This doesnt :

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/4/6/46d34fb5dee61983f0fd4402b09b095cc640437b.png)

I need to use the value option because I want to add additional information on the body such as :

```auto
{
"additionalData":"thisdata",
"body":" {{$.hTTPRequest.body}}"
}

```

Is there a particular way to proceed with this ?

Thanks all

---

<div class="post-metadata">

**Author:** ![margocbain](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/margocbain/32/17314_2.png) [@margocbain](https://developer.sailpoint.com/discuss/u/margocbain)\
**Post date:** [November 19, 2024, 6:20pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223/2 "2024-11-19T18:20:58Z")

</div>

Hi David,  
You can reference multiple values and add several items to your request body from different steps, or static values. See the below as an example…

```auto
{
       "attributes": {
           "id": "{{$.getIdentity.attributes.identificationNumber}}",
           "name": "{{$.getIdentity.attributes.identificationNumber}}",
           "process": "Leaver",
           "sourceId": "sourceID",
           "ticketNumber": "{{$.trigger.requestNumber}}"
       }
}

```

If you didn’t want to follow the above approach, try using a define variable step ([Operators - SailPoint Identity Services](https://documentation.sailpoint.com/saas/help/workflows/workflow-operators.html#define-variable) ) and concatenating the two values together. From there, you can use the Define Variable step output in your json body.  
Thanks,  
Margo

---

<div class="post-metadata">

**Author:** ![liamkokeeffe](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/liamkokeeffe/32/29279_2.png) [@liamkokeeffe](https://developer.sailpoint.com/discuss/u/liamkokeeffe)\
**Post date:** [November 19, 2024, 6:25pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223/3 "2024-11-19T18:25:38Z")

</div>

Hi David,

Could you send an example of what the body of the API call is? Or what ISC API you are calling to get this data?

When the ‘{{$.hTTPRequest.body}}’ variable evaluates it could be creating an invalid JSON format within the body attribute.

Thanks,

Liam

---

<div class="post-metadata">

**Author:** ![sagar\_kamalakar](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/sagar_kamalakar/32/18893_2.png) [@sagar\_kamalakar](https://developer.sailpoint.com/discuss/u/sagar_kamalakar)\
**Post date:** [November 19, 2024, 6:33pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223/4 "2024-11-19T18:33:14Z")

</div>

Hi David,

Try to pass like below hope it would help

`"body":"{{$.hTTPRequest.body}}"`

---

<div class="post-metadata">

**Author:** ![davidtrn](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/davidtrn/32/19752_2.png) [@davidtrn](https://developer.sailpoint.com/discuss/u/davidtrn)\
**Post date:** [November 20, 2024, 8:03am UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223/5 "2024-11-20T08:03:49Z")

</div>

Hi Liam,

Indeed I do believe that the API response is somehow being parsed incorrectly thus the error that arise.

The API is [list-identity-access-review-items | SailPoint Developer Community](https://developer.sailpoint.com/docs/api/v2024/list-identity-access-review-items)

And the response that I am trying to use is an array of access items like this :

```auto
[
    {
        "id": "2ddf2e54a70b407b8578263a1bd63e35",
        "completed": false,
        "newAccess": true,
        "decision": null,
        "comments": null,
        "accessSummary": {
            "access": {
                "type": "ACCESS_PROFILE",
                "id": "9af81c3f51b3401b84b7651aede84835",
                "name": "DTR - AP 2"
            },
            "entitlement": null,
            "accessProfile": {
                "id": "9af81c3f51b3401b84b7651aede84835",
                "name": "DTR - AP 2",
                "description": null,
                "privileged": false,
                "cloudGoverned": false,
                "endDate": null,
                "owner": {
                    "email": "toto.toto@toto.com",
                    "type": "IDENTITY",
                    "id": "xxxxxx",
                    "name": "toto toto (toto)"
                },
                "entitlements": [
                    {
                        "id": "fe0b90aae88f46459f6e29db6d469eea",
                        "name": "dtr-test-group-2",
                        "description": null,
                        "privileged": false,
                        "owner": null,
                        "attributeName": "groups",
                        "attributeValue": "85644d27-3b37-45a9-b58b-41a2ae78e4c7",
                        "sourceSchemaObjectType": "group",
                        "sourceId": "966376b439494b2f87554e28e414f565",
                        "sourceName": "Azure AD",
                        "sourceType": "Azure Active Directory",
                        "hasPermissions": false,
                        "isPermission": false,
                        "revocable": false,
                        "cloudGoverned": false,
                        "account": {
                            "nativeIdentity": "7d6d8b06-5c9d-4074-b73a-2d1512bf3167",
                            "disabled": false,
                            "locked": false,
                            "type": "ACCOUNT",
                            "activityInsights": null,
                            "description": null,
                            "owner": null,
                            "governanceGroupId": null,
                            "id": "5edcc0f2babd42c59ecf0057d78f1cd3",
                            "name": "bakys.syfufi@toto.net",
                            "created": "2023-03-16T13:35:18.468Z",
                            "modified": "2024-11-13T17:06:32.972Z"
                        },
                        "dataAccess": null,
                        "containsDataAccess": false
                    }
                ],
                "created": "2024-11-13T10:40:19.843Z",
                "modified": "2024-11-13T10:40:31.865Z"
            },
            "role": null
        },
        "identitySummary": {
            "id": "c5776b918da74401b7aaaa94bf4fe30a",
            "name": "Bakys Syfufi",
            "identityId": "8d59ef025a90470e99dd4de8dcf7a1e3",
            "completed": false
        }
    },
    {
        "id": "8d2e0edb29e24ac1a7b8419072b7f304",
        "completed": false,
        "newAccess": true,
        "decision": null,
        "comments": null,
        "accessSummary": {
            "access": {
                "type": "ROLE",
                "id": "a33824613af341f5a0935c611e256950",
                "name": "DTR - Role 1"
            },
            "entitlement": null,
            "accessProfile": null,
            "role": {
                "id": "a33824613af341f5a0935c611e256950",
                "name": "DTR - Role 1",
                "description": "Role containing access profile with privliged entitlement.\nDescription update",
                "privileged": true,
                "owner": {
                    "email": "toto.toto@toto.com",
                    "type": "IDENTITY",
                    "id": "996737d8486a4a0887ac667b9923bed9",
                    "name": "toto toto (toto)"
                },
                "revocable": false,
                "endDate": null,
                "accessProfiles": [
                    {
                        "id": "6a33a77ff8c94d229ab1f1f38f254271",
                        "name": "DTR - AP 1",
                        "description": null,
                        "privileged": true,
                        "cloudGoverned": false,
                        "endDate": null,
                        "owner": {
                            "email": "toto.toto@toto.com",
                            "type": "IDENTITY",
                            "id": "996737d8486a4a0887ac667b9923bed9",
                            "name": "toto toto (toto)"
                        },
                        "entitlements": [
                            {
                                "id": "f3468574e6f840a0a442da9599d15b88",
                                "name": "dtr-test-group",
                                "description": null,
                                "privileged": true,
                                "owner": null,
                                "attributeName": "groups",
                                "attributeValue": "64ef56fa-1919-4ced-9b51-ba376cf27340",
                                "sourceSchemaObjectType": "group",
                                "sourceId": "966376b439494b2f87554e28e414f565",
                                "sourceName": "Azure AD",
                                "sourceType": "Azure Active Directory",
                                "hasPermissions": false,
                                "isPermission": false,
                                "revocable": false,
                                "cloudGoverned": false,
                                "account": {
                                    "nativeIdentity": "4a5931bd-f7e0-4f00-959a-34382a859893",
                                    "disabled": false,
                                    "locked": false,
                                    "type": "ACCOUNT",
                                    "activityInsights": null,
                                    "description": null,
                                    "owner": null,
                                    "governanceGroupId": null,
                                    "id": "e38bfdafdca047f7ab32981f6fea6e41",
                                    "name": "bakys.pyfedo@toto.net",
                                    "created": "2023-03-16T13:35:18.780Z",
                                    "modified": "2024-11-08T17:09:03.495Z"
                                },
                                "dataAccess": null,
                                "containsDataAccess": false
                            }
                        ],
                        "created": "2024-10-30T11:21:17.168Z",
                        "modified": "2024-11-08T16:41:11.571Z"
                    }
                ],
                "entitlements": []
            }
        },
        "identitySummary": {
            "id": "a1bb91eca12c4ff6b1d4a8eb49d4229e",
            "name": "Bakys Pyfedo",
            "identityId": "2c9180888168a7d501816ced361f6b9b",
            "completed": false
        }
    },
{},
{}
]

```

---

<div class="post-metadata">

**Author:** ![davidtrn](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/davidtrn/32/19752_2.png) [@davidtrn](https://developer.sailpoint.com/discuss/u/davidtrn)\
**Post date:** [November 20, 2024, 8:09am UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223/6 "2024-11-20T08:09:33Z")

</div>

Hi Margo,

Thanks for the input.  
I am trying to use the multiple reference method and it does work for “simple”’ items such as string or int but trying to pass an array of items seems to provoke an invalid JSON format somehow.

I pasted my input below

David

---

<div class="post-metadata">

**Author:** ![margocbain](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/margocbain/32/17314_2.png) [@margocbain](https://developer.sailpoint.com/discuss/u/margocbain)\
**Post date:** [November 20, 2024, 3:23pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223/7 "2024-11-20T15:23:52Z")

</div>

Hi David,  
Since you have an array, you should remove the quotes around `{{$.httpRequest.body}}`  
Try this:

```auto
{
"additionalData":"thisdata",
"body":{{$.httpRequest.body[*]}}
}

```

If you get the error ‘Unable to parse input as JSON, please ensure it is syntactically correct. (type: Error Parsing Input, retryable: false): invalid character ‘\n’ in string literal’, try removing the \n from your description on your entitlement.  
Give this a try and let me know if it helps.

---

<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:** [December 12, 2024, 4:05pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223/8 "2024-12-12T16:05:27Z")

</div>

Inline variables that reference objects or arrays are not outputting valid json. They output a string representation of Golang maps and arrays. This is why you can use the “choose variable” to add the object to your request body, but not when using an inline variable. There is a ticket (PLTWRKFLW-1735) in the pre-release phase that will allow inline variables to reference objects and arrays as syntactically correct JSON.

---

<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:** [December 12, 2024, 8:59pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223/9 "2024-12-12T20:59:24Z")

</div>

Workflows now supports using objects and arrays in inline variables! To force objects and arrays to resolve to JSON instead of Golang strings, add a `.JSON()` to the end of your JSONpath. For example, `$.trigger.identity` is an object, and `$.trigger.changes` is an array. Adding `.JSON()` to each will make them print out their JSON representation instead of Golang representation.

```json
{
  "identity": {{$.trigger.identity.JSON()}},
  "changes":{{$.trigger.changes.JSON()}}
}

```

Becomes this:

```json
{
  "changes": [
    {
      "attribute": "department",
      "newValue": "marketing",
      "oldValue": "sales"
    },
    {
      "attribute": "manager",
      "newValue": {
        "id": "ee769173319b41d19ccec6c235423236c",
        "name": "ed.engineer",
        "type": "IDENTITY"
      },
      "oldValue": {
        "id": "ee769173319b41d19ccec6c235423237b",
        "name": "william.wilson",
        "type": "IDENTITY"
      }
    },
    {
      "attribute": "email",
      "newValue": "john.doe@gmail.com",
      "oldValue": "john.doe@hotmail.com"
    }
  ],
  "identity": {
    "id": "ee769173319b41d19ccec6cea52f237b",
    "name": "john.doe",
    "type": "IDENTITY"
  }
}

```

Numbers, strings, and booleans do not need `.JSON()`.

---

<div class="post-metadata">

**Author:** ![originalmths](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/originalmths/32/4128_2.png) [@originalmths](https://developer.sailpoint.com/discuss/u/originalmths)\
**Post date:** [December 12, 2024, 9:59pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223/10 "2024-12-12T21:59:34Z")

</div>

Hi Collin,

This feature is new?  
Do you know if this affects the behavior of workflows? I mean, I have workflows that use “[\*]” with jsonpath to read arrays.

---

<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:** [December 12, 2024, 10:14pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223/11 "2024-12-12T22:14:26Z")

</div>

This will not affect existing workflows since you have to explicitly use the .JSON() function, which wasn’t available until now.

---

<div class="post-metadata">

**Author:** ![originalmths](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/originalmths/32/4128_2.png) [@originalmths](https://developer.sailpoint.com/discuss/u/originalmths)\
**Post date:** [December 12, 2024, 10:24pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223/12 "2024-12-12T22:24:42Z")

</div>

My ETS workflow that use “[\*]” is broken. Yesterday they were working normally, today they are giving an error:

NOTE: There was no change in the configurations.

WorkflowExecutionFailed,“2024-12-12T22:08:11.490802044Z”,“{”“error”“:”“task failed: activity error (type: sp:external:http:v2, scheduledEventID: 41, startedEventID: 42, identity: 1@sp-workflow-worker-stg-us-east-1-cfd7dd48d-tqmdm@): Unable to parse input as JSON, please ensure it is syntactically correct. (type: Error Parsing Input, retryable: false): invalid character ‘7’ after object key:value pair (type: SyntaxError, retryable: true)”“}”

---

<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:** [December 12, 2024, 11:11pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223/13 "2024-12-12T23:11:25Z")

</div>

Please open a support ticket for this. I don’t see how this change would cause this as the behavior of existing workflows should be the same.

---

<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:** [December 13, 2024, 2:25pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223/14 "2024-12-13T14:25:45Z")

</div>

Can you provide more information? What is the exact JSONpath you are using?

---

<div class="post-metadata">

**Author:** ![originalmths](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/originalmths/32/4128_2.png) [@originalmths](https://developer.sailpoint.com/discuss/u/originalmths)\
**Post date:** [December 13, 2024, 2:30pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223/15 "2024-12-13T14:30:01Z")

</div>

I have a workflow that uses ETS Dynamic Approval. I use a Sub Workflow that receives the information that is sent to the ETS. My Sub Workflow has a rule that needs to collect the description of the requested access.

$.trigger.requestedItems[\*].description

This ETS was working normally, and about two days ago it started to give this error that I sent you in the chat. For now this error only persists in Sandbox, the same ETS in production is working normally.

---

<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:** [December 13, 2024, 2:48pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223/16 "2024-12-13T14:48:25Z")

</div>

Please follow [Help - HTTP Requests failing with $getAccounts references due to escape characters appearing](https://developer.sailpoint.com/discuss/t/help-http-requests-failing-with-getaccounts-references-due-to-escape-characters-appearing/93296). Others are noticing strange behaviors as well.

---

<div class="post-metadata">

**Author:** ![davidtrn](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/davidtrn/32/19752_2.png) [@davidtrn](https://developer.sailpoint.com/discuss/u/davidtrn)\
**Post date:** [December 18, 2024, 4:08pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223/17 "2024-12-18T16:08:34Z")

</div>

Thanks Colin, great news 🙂

---

<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:** [February 16, 2025, 4:09pm UTC](https://developer.sailpoint.com/discuss/t/workflow-http-request-body-parsing-error/90223/18 "2025-02-16T16:09:10Z")

</div>

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