1

I am using Office 365 and I need to build an app (Sharepoint-hosted) that gets list items from another server. What is the best way to do it?

2
  • 1
    from an on premises sharepoint server? Commented Nov 5, 2015 at 14:42
  • Yes it is on premises.
    – abc
    Commented Nov 5, 2015 at 14:47

1 Answer 1

1

Sharepoint on premises and sharepoint online both expose functionality through REST Services, from your sharepoint add in you can call using standard $.ajax calls to these services.

https://msdn.microsoft.com/en-us/library/office/dn292552.aspx

You still need to read about how to authenticate before calling the services.

2
  • is it possible to use url to the list like this : var siteUrl = "w2k12sp02:2222"; var clientContext = new SP.ClientContext(siteUrl); var oList = clientContext.get_web().get_lists().getByTitle("GP-List").getItems("");
    – abc
    Commented Nov 5, 2015 at 15:25
  • 1
    JSOM doesn't have a way to provide credentials and there are also issues of cross domain requests. REST is the right option here.
    – Prakash
    Commented Nov 5, 2015 at 18:18

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.