SharePoint API Error,ID3035: The request was not valid or is malformed

Skywares Test 1 Reputation point


I am trying to request Sharepoint API.
I get the Access Token then I use the following API to read data, but I always have the following error:
{"error_description":"ID3035: The request was not valid or is malformed."}

GET https://site_url/_api/web/lists
Bearer token

Access token:
grant_type: client_credentials
client_id: xxx
client_secret: xxxxxxx


SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,795 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 33,486 Reputation points Microsoft Vendor

    Hi @Skywares Test
    You can follow the steps to get Access Token

    1. Get a delegated auth token from graph as you normally would (

    2 . Use the refresh_token you got and exchange it for an SPO access token by calling the auth endpoint again:

    POST{<!-- -->{tenantName}}/oauth2/v2.0/token  
    client_id=<APP ID>  
    client_secret=<APP SECRET>  
    refresh_token=<REFRESH TOKEN FROM ABOVE>  
    scope=https://<YOUR TENANT NAME>  

    Finally take the access token and call the SPO API


    You must ensure your app is registered with the correct permissions. In the case above the app must have Sites.Read.All.

    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.