0

I am using Microsoft.SharePointOnline.CSOM. Authentication works fine and I can get the following api to work fine.

https://company.sharepoint.com/sites/{site}/_api/lists

This gives me results and that shows my integration/authentication works fine.

Now I have a list in this site. To query the list I have tried below;

https://company.sharepoint.com/sites/{site}/_api/lists(guid'{guid}')/items

https://company.sharepoint.com/sites/{site}/_api/lists/getbytitle('{list-name}')/items

In both cases it returns 404. But the list exists and list name does NOT have any spaces (so no encoding is needed). The GUID is also confirmed to be accurate.

  1. Does it take some time to reflect the changes for the newly created list to appear in api results?

  2. Are their any configurations that needs to be done to the list (like allow to be queried via api)?

user2058413
  • 691
  • 3
  • 10
  • 28
  • If we want to fetch items from list we use "https://conseto.sharepoint.com/sites/siteName/_api/web/lists/GetByTitle('ListName')/items" - but if you still didn't see the result. Can you please provide more details ? – Chand Jogani Aug 19 '21 at 10:05

1 Answers1

0

You missed web in the url.

It shuoud be /_api/web/lists/getbytitle('{list-name}')

Michael Han
  • 3,475
  • 1
  • 6
  • 8
  • still the same, as i have mentioned the url https://company.sharepoint.com/sites/{site}/_api/lists works and in this response I get a list of information. I see some meta data of type "type": "SP.List" etc.. But the list I have created is not in this data. So seems like I may have to configure something at Sharepoint end? (May be like give a permission or something to the list so it can be queried from REST ? ) – user2058413 Aug 19 '21 at 08:56