Create AccessPackageAssignmentRequest graph API gives error

Akash Thorat 135 Reputation points
2024-08-07T07:17:18.32+00:00

I am trying to create accessPackageAssignmentRequest using graph API from postman where I am getting the bellow error :
{ "error": { "code": "ArgumentNullException", "message": "Value cannot be null.\r\nParameter name: Grant", "innerError": { "date": "2024-07-31T07:24:59", "request-id": "88565eeb-9de2-48ac-bccf-d54809306aee", "client-request-id": "88565eeb-9de2-48ac-bccf-d54809306aee" } } }.
And in postman I am getting this below error in image after providing justification and hitting the API.
Also I have given org.ReadWriteAll permission in the API permissions.
Is there any way that I can get the solution for this.Screenshot (353)

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
23,651 questions
{count} vote

Accepted answer
  1. Navya 16,380 Reputation points Microsoft External Staff
    2024-08-07T15:00:12.5+00:00

    Hi @Akash Thorat

    Thank you for posting this in Microsoft Q&A.

    I understand that you are trying to Create AccessPackageAssignmentRequest graph API gives error "ArgumentNullException", "message": "Value cannot be null.\r\nParameter name: Grant".

    I have tested in my environment and successfully created AccessPackageAssignmentRequest in graph explorer.

    Request a package and provide a justification query (e. g:4) from this document Create accessPackageAssignmentRequest .Please let us know if you would like to run additional examples.

    1. In Graph Explorer, select "POST" from the Method dropdown.
    2. In the "Request URL" field, enter the following URL:
    https://graph.microsoft.com/v1.0/identityGovernance/entitlementManagement/assignmentRequests
    
    
    

    3.In the "Headers" section, add a "Content-type" header with the value "application/json".

    4.In the "Request body" section, enter the following JSON payload:

    
    {
        "requestType": "UserAdd",
        "accessPackageAssignment": {
            "accessPackageId": "43797452-3ab6-411c-a833-c5aedb0530d9"
        },
        "justification": "Need access to New Hire access package"
    }
    

    User's image

    Hope this helps. Do let us know if you any further queries.

    Thanks,

    Navya.

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. James Seddon 11 Reputation points
    2024-12-04T17:13:17.3433333+00:00

    Are you using an OAUTH application flow? "userAdd" isn't available to application OAUTH flow requests, I'm stuck in the same position.

    The reason it worked for Navya above is they are authenticated in Graph Explorer as themselves, so effectively using the User OAUTH flow, which allows the request.

    If you change this to "adminAdd" it will work, but I suspect you are trying to do what I am and trying to raise an access package request on behalf of the user and have approvals on that request.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.