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": "abc@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 Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,829 questions
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 41,286 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.


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.