Manage Access-400 Bad request while adding Entitlement using workflow

Hi Experts,
We have a use case to copy access from a identity and provision same access to new joiner.
While I was able to grab Entitlement from Get Access Action in workflow, I get error while adding that same access using Manage Access. Those entitlements are request able as well. Secondly, I tried using POSTMAN: it throws the same error but from the UI I am able to request the same access and get it without approval or any trouble.
The JSON used from postman using POST req using v3 end point of access-request

{
  "requestedFor": "{id of the identity}",
  "requestType": "GRANT_ACCESS",
  "requestedItems": [
    {
      "id": "{id of the entitlement}",
      "type": "ENTITLEMENT",
      "comment": "tEST"
    }
  ]
}

Response is:

{
    "detailCode": "400.0 Bad request syntax",
    "trackingId": "b9d6b081",
    "messages": [
        {
            "locale": "en-US",
            "localeOrigin": "DEFAULT",
            "text": "The request could not be parsed."
        },
        {
            "locale": "und",
            "localeOrigin": "REQUEST",
            "text": "The request could not be parsed."
        }
    ],
    "causes": []
}

Any lead is appreciated.
Thanks!!

1 Like

The error you’re encountering (400.0 Bad request syntax) is due to the incorrect key name in your JSON request body.

Hi @SaidurgaMallela

The requestedFor section should be in an array format even though if its for one identity.

example:
“requestedFor”: [“2c9180847e123456017e123456780001”],

@ujjwol_panditAvant confirmed , it is working after above change by himself.