One Drive API cannot work

Sean (Longfei) Zhang 20 Reputation points
2025-03-26T09:29:04.7133333+00:00

I Using Microsoft Graph to Register a File Handler from link:

https://learn.microsoft.com/en-us/onedrive/developer/file-handlers/register-manually?view=odsp-graph-online

API: https://graph.microsoft.com/v1.0/applications/{objectId}/addIns

but it return StatusCode: 405, ReasonPhrase: 'Method Not Allowed'.

also, I have use register manually, the also cannot show menu

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 46,376 Reputation points
    2025-03-27T09:17:36.9466667+00:00

    Hi @Sean (Longfei) Zhang

    I was able to reproduce the issue locally. Note that this is a PUT request and not a POST request.

    User's image

    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 additional answer

Sort by: Most helpful
  1. Saranya Madhu-MSFT 2,375 Reputation points Microsoft External Staff
    2025-03-27T03:24:46.1133333+00:00

    Hi Sean (Longfei) Zhang,

    Thanks for reaching out to Microsoft!

    As per Microsoft Graph, a 405 error generally occurs when the HTTP method used in the request isn't allowed on the resource.

    To resolve this issue, ensure the HTTP method is correct, the correct version of the API (v1.0 in this case) is used, and the application has the necessary permissions.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further 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.