SharePoint REST API: Not able to get list through API

Bas Nab 5 Reputation points
2025-03-07T13:16:15.1433333+00:00

I am trying to get a list through the use of the sharepoint API.

If I am logged in I can access the XML response through the following URL: https://{sitenumber}.sharepoint.com/sites/AI/_api/web/lists/GetByTitle('[ListTitle]')

When I use an API call with OAuth enabled I get a 404. So it sais it does not exist.
If I try to list out all the lists within the AI site it displays the default lists, but not the new list I created.

I've tried numerous things like checking whether the list is hidden or find it by the GUID but that does not work.

I also tried to find settings to open up the list for API calls but can't find any such setting.
Getting userdetails through the API delivers my own credentials so OAuth seems to be working.

What am I missing?

Microsoft 365 and Office SharePoint Development
{count} vote

2 answers

Sort by: Most helpful
  1. Xyza Xue_MSFT 30,176 Reputation points Microsoft External Staff
    2025-03-10T06:51:42.8933333+00:00

    Hi @Bas Nab ,

    Thank you for posting in this community. During my testing, even newly created Lists can be retrieved by the SharePoint REST API.

    It seems like you're able to authenticate via OAuth and can access certain SharePoint data, but you're facing an issue where an API call for a specific list returns a 404 error. Here are some troubleshooting steps to help you resolve the issue:

    1. Verify List Permissions

    Ensure that the list you're trying to access is not restricted by permissions. If the list has unique permissions or is hidden from certain users, your API call might be blocked.

    1. Check List Title and API Endpoint

    Double-check the list title in the URL you're using. In SharePoint, the title might not be exactly as you expect (e.g., there might be special characters or trailing spaces). Try using the List GUID instead of the title to see if that resolves the issue. For example, instead of calling /GetByTitle, try using /GetById if you have the list's GUID.


    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.


  2. Xyza Xue_MSFT 30,176 Reputation points Microsoft External Staff
    2025-03-18T09:17:16.25+00:00

    Hi @Bas Nab ,

    I'm glad to hear you've found a way to be able to work at the moment: In another browser, it does work after selected the "lists" option within office 365.

    Currently you can use this method to get it. After my internal and external searches, no users have reported similar related issues at this time, and we regret the inconvenience caused in response to this phenomenon. If you want to figure out the root cause of this phenomenon, the current effective measure is to contact the admin of your organization and request a free support ticket in Microsoft Admin Center.

    The Microsoft escalation engineers there can have a remote session with you and collect logs from the backend to figure out the root cause of the problem.

    For reference:

    Get support - Microsoft 365 admin | Microsoft Learn

    How do I find my Microsoft 365 admin? - Microsoft Support

    And kindly consider accepting the answer if the information provided is helpful. This can assist other community members in resolving similar issues.


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.