Unable to parse input as JSON in Create-Campaign API

Hi,

I have been trying to use the below JSON as payload to create a certification campaign using workflow. I am getting the error "Unable to parse input as JSON. It is because of the json path returning an array within accessConstraints. Please help me with this issue. I have even tried {{$.hTTPRequest1.body[*].id.JSON()}}

{
    "name": "CI Change Campaign",
    "description": "SNOW specific access item needs to be reviewed by the manager",
    "deadline": null,
    "type": "SEARCH",
    "emailNotificationEnabled": true,
    "autoRevokeAllowed": false,
    "recommendationsEnabled": false,
    "correlatedStatus": "CORRELATED",
    "filter": null,
    "sunsetCommentsRequired": false,
    "sourceOwnerCampaignInfo": null,
    "searchCampaignInfo": {
      "type": "IDENTITY",
      "description": "Certification campaign SNOW (AD Based) access items",
      "reviewer": {
        "type": "IDENTITY",
        "id": "{{$.getIdentity.managerRef.id}}"
      },
      "identityIds": [
        "{{$.getIdentity.id}}"
      ],
      "accessConstraints": [
        {
          "type": "ENTITLEMENT",
          "ids": {{$.hTTPRequest1.body[*].id}},
          "operator": "SELECTED"
        }
      ]
    },
    "roleCompositionCampaignInfo": null,
    "machineAccountCampaignInfo": null,
    "mandatoryCommentRequirement": "ALL_DECISIONS"
  }

@ansh0307 can you attach the workflow json and send so that we can verify?

1 Like
{
    "id": "5b4ed2fc-4cf5-4558-ac7d-d3e40e988aac",
    "name": "Mover_Team Change: SNOW_WF",
    "description": "This workflow triggers when there is a change in Indicator attribute and triggers a certification to with Manager review for SNOW application AD based entitlements",
    "created": "2025-06-29T23:21:10.830071778Z",
    "modified": "2025-06-30T06:35:31.690630789Z",
    "modifiedBy": {
        "type": "IDENTITY",
        "id": "080829331112551d2b8ff884443",
        "name": "55223"
    },
    "definition": {
        "start": "Verify Data Type",
        "steps": {
            "Define Variable": {
                "actionId": "sp:define-variable",
                "attributes": {
                    "id": "sp:define-variable",
                    "variables": [
                        {
                            "description": "",
                            "name": "Deadline Date",
                            "transforms": [
                                {
                                    "id": "sp:transform:addTime:time",
                                    "input": {
                                        "length": 30,
                                        "unit": "days"
                                    }
                                }
                            ],
                            "variableA.$": "$.now()"
                        }
                    ]
                },
                "displayName": "Deadline Date",
                "nextStep": "Send Email",
                "type": "Mutation"
            },
            "End Step - Success": {
                "actionId": "sp:operator-success",
                "displayName": "",
                "type": "success"
            },
            "Get Identity": {
                "actionId": "sp:get-identity",
                "attributes": {
                    "id.$": "$.trigger.identity.id"
                },
                "displayName": "",
                "nextStep": "HTTP Request 1",
                "type": "action",
                "versionNumber": 2
            },
            "HTTP Request 1": {
                "actionId": "sp:http",
                "attributes": {
                    "authenticationType": "OAuth",
                    "jsonRequestBody": {
                        "includeNested": true,
                        "indices": [
                            "identities"
                        ],
                        "query": {
                            "innerHit": {
                                "query": "(source.name:\\\"ActiveDirectory\\\") AND (displayName: /APP13623/)",
                                "type": "access"
                            },
                            "query": "attributes.uid:\"{{$.getIdentity.attributes.uid}}\""
                        },
                        "queryType": "SAILPOINT",
                        "queryVersion": "5.2"
                    },
                    "method": "post",
                    "oAuthClientId": "5ad8404bqqwwwr4113d5a62cca429e1a",
                    "oAuthClientSecret": "$.secrets.63f39fdb-b025-482d-a937-9ac450277fb1",
                    "oAuthCredentialLocation": "oAuthInBody",
                    "oAuthTokenUrl": "https://test.api.identitynow.com/oauth/token",
                    "requestContentType": "json",
                    "url": "https://test.api.identitynow.com/v2024/search"
                },
                "displayName": "Get SNOW (AD Based) Entitlements",
                "nextStep": "Define Variable",
                "type": "action",
                "versionNumber": 2
            },
            "HTTP Request 2": {
                "actionId": "sp:http",
                "attributes": {
                    "authenticationType": "OAuth",
                    "jsonRequestBody": {
                        "autoRevokeAllowed": false,
                        "correlatedStatus": "CORRELATED",
                        "deadline": "{{$.defineVariable.deadlineDate}}",
                        "description": "SNOW specific access item needs to be reviewed by the manager",
                        "emailNotificationEnabled": true,
                        "filter": null,
                        "machineAccountCampaignInfo": null,
                        "mandatoryCommentRequirement": "ALL_DECISIONS",
                        "name": "Indicator Change Campaign for {{$.getIdentity.displayName}}",
                        "recommendationsEnabled": false,
                        "roleCompositionCampaignInfo": null,
                        "searchCampaignInfo": {
                            "accessConstraints": [
                                {
                                    "ids": "{{$.hTTPRequest1.body[*].id.JSON()}}",
                                    "operator": "SELECTED",
                                    "type": "ENTITLEMENT"
                                }
                            ],
                            "description": "Certification campaign SNOW (AD Based) access items",
                            "identityIds": [
                                "{{$.getIdentity.id}}"
                            ],
                            "reviewer": {
                                "id": "{{$.getIdentity.managerRef.id}}",
                                "type": "IDENTITY"
                            },
                            "type": "IDENTITY"
                        },
                        "sourceOwnerCampaignInfo": null,
                        "sunsetCommentsRequired": false,
                        "type": "SEARCH"
                    },
                    "method": "post",
                    "oAuthClientId": "5ad8404b8575489833r4d52a3d5a62cca429e1a",
                    "oAuthClientSecret": "$.secrets.e4390121-b8af-4a8e-9a29-6555bb7c455d",
                    "oAuthCredentialLocation": "oAuthInBody",
                    "oAuthTokenUrl": "https://test.api.identitynow.com/oauth/token",
                    "requestContentType": "json",
                    "url": "https://test.api.identitynow.com/v2024/campaigns"
                },
                "displayName": "Create Campaign",
                "nextStep": "Wait",
                "type": "action",
                "versionNumber": 2
            },
            "HTTP Request 3": {
                "actionId": "sp:http",
                "attributes": {
                    "authenticationType": "OAuth",
                    "jsonRequestBody.$": "",
                    "method": "post",
                    "oAuthClientId": "5ad8404b792357hrdws45a62cca429e1a",
                    "oAuthClientSecret": "$.secrets.e4390121-b8af-4a8e-9a29-6555bb7c455d",
                    "oAuthCredentialLocation": "oAuthInBody",
                    "oAuthTokenUrl": "https://test.api.identitynow.com/oauth/token",
                    "requestContentType": null,
                    "url": "https://test.api.identitynow.com/v2024/campaigns/{{$.hTTPRequest2.body.id}}/activate",
                    "urlParams": {}
                },
                "displayName": "Activate Campaign",
                "nextStep": "End Step - Success",
                "type": "action",
                "versionNumber": 2
            },
            "Send Email": {
                "actionId": "sp:send-email",
                "attributes": {
                    "body": "<div>\n<div>{</div>\n<div>&nbsp; \"name\": \"Indicator Change Campaign for {{$.getIdentity.displayName}}\",</div>\n<div>&nbsp; \"description\": \"SNOW specific access item needs to be reviewed by the manager\",</div>\n<div>&nbsp; \"deadline\": \"{{$.defineVariable.deadlineDate}}\",</div>\n<div>&nbsp; \"type\": \"SEARCH\",</div>\n<div>&nbsp; \"emailNotificationEnabled\": true,</div>\n<div>&nbsp; \"autoRevokeAllowed\": false,</div>\n<div>&nbsp; \"recommendationsEnabled\": false,</div>\n<div>&nbsp; \"correlatedStatus\": \"CORRELATED\",</div>\n<div>&nbsp; \"filter\": null,</div>\n<div>&nbsp; \"sunsetCommentsRequired\": false,</div>\n<div>&nbsp; \"sourceOwnerCampaignInfo\": null,</div>\n<div>&nbsp; \"searchCampaignInfo\": {</div>\n<div>&nbsp; &nbsp; \"type\": \"IDENTITY\",</div>\n<div>&nbsp; &nbsp; \"description\": \"Certification campaign SNOW (AD Based) access items\",</div>\n<div>&nbsp; &nbsp; \"reviewer\": {</div>\n<div>&nbsp; &nbsp; &nbsp; \"type\": \"IDENTITY\",</div>\n<div>&nbsp; &nbsp; &nbsp; \"id\": \"{{$.getIdentity.managerRef.id}}\"</div>\n<div>&nbsp; &nbsp; },</div>\n<div>&nbsp; &nbsp; \"identityIds\": [</div>\n<div>&nbsp; &nbsp; &nbsp; \"{{$.getIdentity.id}}\"</div>\n<div>&nbsp; &nbsp; ],</div>\n<div>&nbsp; &nbsp; \"accessConstraints\": [</div>\n<div>&nbsp; &nbsp; &nbsp; {</div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; \"type\": \"ENTITLEMENT\",</div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; \"ids\": \"{{$.hTTPRequest1.body[*].id.JSON()}}\",</div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; \"operator\": \"SELECTED\"</div>\n<div>&nbsp; &nbsp; &nbsp; }</div>\n<div>&nbsp; &nbsp; ]</div>\n<div>&nbsp; },</div>\n<div>&nbsp; \"roleCompositionCampaignInfo\": null,</div>\n<div>&nbsp; \"machineAccountCampaignInfo\": null,</div>\n<div>&nbsp; \"mandatoryCommentRequirement\": \"ALL_DECISIONS\"</div>\n<div>}</div>\n</div>",
                    "context": {},
                    "from.$": "$.getIdentity.displayName",
                    "recipientEmailList": [
                        "[email protected]"
                    ],
                    "replyTo.$": "$.getIdentity.displayName",
                    "subject": "TEXT"
                },
                "displayName": "",
                "nextStep": "HTTP Request 2",
                "type": "action",
                "versionNumber": 2
            },
            "Verify Data Type": {
                "actionId": "sp:compare-unary",
                "choiceList": [
                    {
                        "comparator": "IsPresent",
                        "nextStep": "Get Identity",
                        "variableA.$": "$.trigger.changes[?(@.attribute == \"Indicator\")]"
                    }
                ],
                "defaultStep": "End Step - Success",
                "displayName": "",
                "type": "choice"
            },
            "Wait": {
                "actionId": "sp:sleep",
                "attributes": {
                    "duration": "1m",
                    "type": "waitFor"
                },
                "displayName": "",
                "nextStep": "HTTP Request 3",
                "type": "action",
                "versionNumber": 1
            }
        }
    },
    "enabled": false,
    "executionCount": 0,
    "failureCount": 0,
    "creator": {
        "type": "IDENTITY",
        "id": "080829631324223fdd2b8ff884443",
        "name": "55223"
    },
    "owner": {
        "type": "IDENTITY",
        "id": "08082923134511dd2b8ff884443",
        "name": "55223"
    },
    "trigger": {
        "type": "EVENT",
        "attributes": {
            "filter.$": "$.changes[?(@.attribute == \"Indicator\")]",
            "id": "idn:identity-attributes-changed"
        }
    }
}

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