Invalid request when trying to invite using graph api

Nithin Anand 0 Reputation points
2023-09-21T04:23:45.7466667+00:00

Hi

Need help debugging an api request. I'm making a post call to share a drive item but getting an invalid request error

url = "https://graph.microsoft.com/v1.0/users/f10dae52-c9e0-48f7-96fa-a3ae55c129fa/drive/items/01VTH4TKZN2OBTDYxxxxxxxxxxNBJCYQI/invite"
payload={  "recipients": [    {      "email": "******@xyz.onmicrosoft.com"    }  ],  "message": "Here's the file that we're collaborating on.",  "requireSignIn": True,  "sendInvitation": True,  "roles": [ "write" ]}

response


{'error': {'code': 'invalidRequest', 'message': 'Invalid request', 'innerError': {'date': '2023-09-21T04:16:38', 'request-id': '9e8b7396-684f-4e92-b7fc-6c37ffb5f0bb', 'client-request-id': '9e8b7396-684f-4e92-b7fc-6c37ffb5f0bb'}}}
Microsoft Security | Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 46,406 Reputation points
    2023-09-21T07:00:09.48+00:00

    Hi @Nithin Anand

    In this case, the first letter of the boolean true/false cannot be capitalized.

    7

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    1 person found this answer helpful.

Your answer

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