Cong Pham

Cong Pham

  • NA
  • 12
  • 571

Node js Unable to connect Pointshare Please help me !!

Jan 12 2021 9:21 AM
I using Code :
  1. node-sp-auth  &   
  2. request-promise  
  3.    
  4.    
  5.   
  6. var url = 'https://myproject.sharepoint.com/personal/name';   
  7. var username = "[email protected]";   
  8. var password = "********";   
  9.   
  10. spauth.getAuth(url, {   
  11.     username:username,   
  12.     password:password    
  13. })    
  14. .then(function(options){   
  15.  // Access Token will be available on the options.headers variable  
  16.  var listTitler="OPProductionTrackingOnline";  
  17.  console.log(listTitle)  
  18.  var headers = options.headers;   
  19.  headers['Accept'] = 'application/json;odata=verbose';   
  20.  // Pull the SharePoint list items    
  21.  requestprom.get({   
  22.  url: url+"/_api/web/lists/getbytitle('"+listTitler+"')",   
  23.  headers: headers,   
  24.  json: true   
  25.  }).then(function(listresponse){   
  26.  var items = listresponse.d.Title;   
  27.  var responseJSON = [];   
  28.    
  29.  console.log(JSON.stringify(listresponse))  
  30.  //  response.end(JSON.stringify(listresponse));    
  31.  });

Answers (1)