2

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.

user472292
  • 1,069
  • 2
  • 22
  • 37

1 Answers1

1

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

Jason Rivera
  • 236
  • 2
  • 8
  • Yes, I have app setup to have full Site Collection permissions (to test). The external content type is not add-in scoped so the article you mention won't help. Also, my external content type isn't oData (it is SQL) so I can't use an add-in scoped one. – user472292 Nov 27 '17 at 18:17