user472292
user472292

Reputation: 329

Access External List from SharePoint Add-In using REST

I am using the SharePoint REST API inside an Add-In to access list data. When I query a "normal" list, I get results back. When I try to query an External List, I get a 401 error. I get the same error when I try to access the REST URL in the browser:

http://add-in-6f1ecc432fad91.myaddins.com/sites/development/_api/lists/getbytitle('TestExternalList')/items

When I try to access it outside the app it works fine:

http://sharepoint/sites/development/_api/lists/getbytitle('TestExternalList')/items

I read that you can't access External Content Types from an add-In here:

http://toddbaginski.com/blog/accessing-bcs-external-data-from-an-app-for-sharepoint-2013/

So I tried to package my BCS model as per the site and I get the following error:

The Project Item "TestBDC" cannot be deployed through a Feature in a Sandboxed Solution.

So my question is, is it possible to access an External List through an Add-In?

I am using SharePoint 2016.

Upvotes: 2

Views: 934

Answers (1)

Jason Rivera
Jason Rivera

Reputation: 236

Sounds like it may be a permissions issue. Do you have the BCS scope set in the app permissions?

Here's an article with info on setting up the security https://learn.microsoft.com/en-us/sharepoint/dev/general-development/add-in-scoped-external-content-types-in-sharepoint

Upvotes: 1

Related Questions