I have a SharePoint 2013 on-premises installed on one of our organisation server (Windows Server 2012 R2 with IIS 8.5). We have enabled the REST search API so that we can query to sharepoint and search data. REST API is at: http://ift.tt/1Bibgey_api/search/query?querytext='finance'
The above SharePoint instance is setup with organisation AD authentication. So the REST API needs authentication to do a query. When I open the above URL in browser, I am getting the results in XML format, which is perfectly fine.
Now, while I am developing the solution, I have tried querying the search API url from javascript code (AJAX). This gives me 401, unauthorised errors in console view in chrome. I am logged in to the SharePoint with my AD logins but I am sure AJAX requests will not get sessions from browser and makes distinct request to the server.
So, I am looking for some solution with PHP where I can pass the credentials to the REST API url and it can authenticate the requests and gives me the data.
I just want to add more information on the use case (project) I am building. I am building is with Confluence Wiki, I am creating a page in wiki where I can do an iframe with PHP app, which can show data from SharePoint.
Please let me know if more information is needed from my side. Thanks!

0 commentaires:
Enregistrer un commentaire