I using Code :
- node-sp-auth &
- request-promise
- var url = 'https://myproject.sharepoint.com/personal/name';
- var username = "[email protected]";
- var password = "********";
- spauth.getAuth(url, {
- username:username,
- password:password
- })
- .then(function(options){
- // Access Token will be available on the options.headers variable
- var listTitler="OPProductionTrackingOnline";
- console.log(listTitle)
- var headers = options.headers;
- headers['Accept'] = 'application/json;odata=verbose';
- // Pull the SharePoint list items
- requestprom.get({
- url: url+"/_api/web/lists/getbytitle('"+listTitler+"')",
- headers: headers,
- json: true
- }).then(function(listresponse){
- var items = listresponse.d.Title;
- var responseJSON = [];
- console.log(JSON.stringify(listresponse))
- // response.end(JSON.stringify(listresponse));
- });
Sachin SinghPosted Jan 12, 2021, 9:24 AM