2017-08-08 47 views
1

我嘗試使用[beta] Microsoft Graph endpoint在SharePoint Online中創建新的list item。目標是從Outlook加載項調用Microsoft Graph,但問題仍然存在於Postman上。Microsoft Graph SharePoint訪問項目(讀/寫)

當我打電話端點按文件我收到以下錯誤信息:

{ 
    "error": { 
     "code": "unauthenticated", 
     "message": "The caller is not authenticated.", 
     "innerError": { 
      "request-id": "bb094f39-71c9-4c7d-9d9b-913cc9622baf", 
      "date": "2017-08-08T11:32:02" 
     } 
    } 
} 

我使用ADAL JS來獲取認證令牌,我和我的tenantID初始化我AuthenticationContext。我的應用程序具有以下權限:offline_access, Sites.Read.All, Sites.ReadWrite.All, User.Read

第二編輯 - 更多細節readItem
我使用https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}/items端點與我想要的網站從/sites{site-id}和名單從/sites/{site-id}/lists{list-id}但這是空的響應我得到:

{ 
    "@odata.context": "https://graph.microsoft.com/...", 
    "value": [] 
} 

如果我嘗試添加/{item-id}我原來的電話訪問特定的項目,我收到這樣的響應:

{ 
    "error": { 
     "code": "itemNotFound", 
     "message": "The specified list was not found", 
     "innerError": { 
      "request-id": "6e7ccae3-3aee-4dbb-ae3e-de61250478e0", 
      "date": "2017-08-09T13:13:33" 
     } 
    } 
} 

這是沒有意義的,因爲我可以檢索有關列表的有效信息,如果我撥打電話,而不/items/..

任何和讚賞:)我會很樂意提供更多的代碼,所有的輸入,這是所有我認爲是相關的,並不想過度擁擠這個職位。

回答

0

可能是因爲https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}/items/1適合我,您實際上沒有該ID的物品。

測試你真的只有https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}/items的ID,每個項目返回它的ID。

+0

感謝您的回覆,但恐怕情況並非如此,因爲我的第二個編輯細節,我稱'/項目與上述結果。我正嘗試使用具有不同權限的新應用程序對新租戶進行重建。 –

+0

那你到底在做什麼? – bresleveloper