I have a Office 365 Organizational SharePoint Online Account. I want to Add Few Tasks in one of the list programmatically.
I saw options of using JavaScript API or hitting the REST URL's
https://company.sharepoint.com/sites/ABC/_api/web/lists/getbytitle('Tasks')/items
When I tried to access the lists using the URL above using a REST Client (While I was signed in to SharePoint in the browser), I was able to successfully access the API. I provided following things in the header
Accept, Content Type and X-RequestDigest
Now, I want to access the same programmatically from PHP or JavaScript or in worst case Java.
My Question is how do I authenticate before accessing the API's.
I also tried to authenticate (REST Call using Client - Not logged in the browser) using this URL - https://login.microsoftonline.com/extSTS.srf and passing the XML body with username and password.
But, it returned me with following error
Direct login to WLID is not allowed for this federated namespace
Please guide me on how to Authenticate using Organizational Credentials to access SharePoint REST API.
I cannot use Visual Studio or C# anywhere. ONLY PHP, JavaScript or worst case -- Java.
Thanks in Advance.