1

I have a REST request pointing to a list in which I am getting the items. I am using the the _spPageContextInfo.webAbsoluteUrl +'/_api/' then tagging the path on the end. This list is in the same collection in which I am able to get items from other list with no problems. The list name is "2019 Annual Cooking Class 2". The original name was "2019 Annual Cooking Class_2". I changed it because the underscore was causing issues. I am thinking it is a permissions issue but I can’t figure it out.

This is what the full URL looks like.

_spPageContextInfo.webAbsoluteUrl +'/_api/web/lists/getByTitle('2019 Annual Cooking Class 2')/items

Update I have full control of the side and when I do the query without the /items on the end I get a 200 response and the list object. The error also happens when I try ?$expand=items.

1
  • Are you able to access this list using browser through site contents? Commented Jan 12, 2019 at 7:05

1 Answer 1

2

I think there is syntax error because of incorrect use of '. Try using your URL in below URL format:

_spPageContextInfo.webAbsoluteUrl +'/_api/web/lists/getByTitle("Display Name of List" )/items';

In your case:

_spPageContextInfo.webAbsoluteUrl +'/_api/web/lists/getByTitle("2019 Annual Cooking Class 2")/items';

This list should be in same SharePoint site where you are using this REST call.

Update: If this is not working for you try adding simple select clause like given below:

_spPageContextInfo.webAbsoluteUrl +'/_api/web/lists/getByTitle("2019 Annual Cooking Class 2")/items?$select=Title,ID';
4
  • Have you tried this? Commented Jan 12, 2019 at 13:29
  • I updated my question with more details. There might be more going on. I will give this a try and really hope it works. Commented Jan 12, 2019 at 17:35
  • Adding the select at the end worked like a charm. THANK YOU SOOOOO MUCH. You are a life saver. Commented Jan 12, 2019 at 23:50
  • I ran into an issue like this before and it turned out to be because the list had a butt load of columns. I didn’t think this list has that many column to cause that issue so it didn’t cross my mind. Do you this may have been the issue. Commented Jan 12, 2019 at 23:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.