How to Use Sharepoint V2.0 API with access token generated without azure portal portal

Ankur Mittal 0 Reputation points
2023-03-21T06:48:19.48+00:00

We want to access sharpoint V2 API using Postman (https://{tenant-name}.sharepoint.com/_api/v2.0/sites).

We don't have access to add application using azure portal. So we are generating access token by method used for V1.0 . Our access token is working for V1 API but giving authentication issue with V2.0 API. Is it possible to use V2.0 API with token generated by given below method.

Step 1: Go to the Register App Add-in page using the URL and create client id and secret id https://one.aon.net/sites/<sitename>/_layouts/15/appregnew.aspx

Step2*:** Grant permission using* https://one.aon.net/sites/<sitename>/_layouts/15/appinv.aspx

Step3*: Generate access token using POST*** https://accounts.accesscontrol.windows.net/TenantId/tokens/OAuth/2

Generated token working fine for V1.0 API. Kindly advice can we access V2.0 API using this token or Azure portal is mandatory here to add application

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,682 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 31,606 Reputation points Microsoft Vendor
    2023-03-22T02:01:30.38+00:00

    Hi @Ankur Mittal

    You can still use the SharePoint app only to access V2.0 API. You can refer to the following steps to get access token

    https://www.inkeysolutions.com/blogs/access-sharepoint-online-data-part-1/

    Then you can use the following api to get the data from SharePoint

    https://www.inkeysolutions.com/blogs/access-sharepoint-online-data-using-postman-part-2/

    Here is the document for more api

    https://learn.microsoft.com/en-us/sharepoint/dev/apis/sharepoint-rest-graph


    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.