connection error between jira and Sharepoint

Paulina Bravo 5 Reputation points
2024-10-17T08:20:38.3+00:00

Good morning,

 

We are trying to make calls from the JIRA application to Sharepoint, we have obtained the token through two-way authentication or OAuth 2.0 client credential grant flow. But after the call to the Sharepoint repository it returns an Error: Failed to retrieve folder ID: HTTP 401 - {"error_description": "ID3035: The request was not valid or is malformed."}. Is it possible to use that token against the SharePoint API? We attach the call https://xxxx.sharepoint.com/_api/web/GetFolderByServerRelativeUrl('xxx ')

Thanks, Best Regards

Microsoft 365 and Office | SharePoint | Development
{count} votes

2 answers

Sort by: Most helpful
  1. Ling Zhou_MSFT 23,665 Reputation points Microsoft External Staff
    2024-10-22T02:19:40.8666667+00:00

    Hi @Paulina Bravo,

    Sorry for the late reply, it took me a while to discuss and look up the information with my MS Graph colleagues. Your problem is probably caused by insufficient permissions.

    First let's go back to the API Permissions page of the app you registered in AAD.

    User's image

    First, if you choose MS Graph:

    You need to give the appropriate access to site for the apps you have registered. Here lists all Microsoft Graph permissions, you need to add site-related permissions.

    Second, you are using the SharePoint REST API for the request. You should use a request with a graph. The request URL should look like this:

    https://graph.microsoft.com/v1.0/sites/{site-id}/drive/items/{item-id}/children
    

    I'm attaching the API documentation for graph here: Working with SharePoint sites in Microsoft Graph

    Reminder: Document operations on SharePoint document libraries are categorized under Drive

    User's image

    Second, if you want to keep your request URL, then you should select SharePoint and give the relevant SharePoint permissions.

    User's image

    I'm attaching the API documentation for SharePoint Rest API here: Microsoft Graph REST API v1.0 endpoint reference.


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

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Paulina Bravo 5 Reputation points
    2024-10-22T09:11:58.2033333+00:00

    Good morning,

    Ling Zhou,

    Thank you for your collaboration, we will try the new calling method to see what results we get. Also, I would like to tell you that to rule out the permissions issue, we already did a test with the Sharepoint team, where they made us administrators, and we still got the same response.

    We are at your disposal for any news.

    Best regards


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.