2016-04-29 130 views
0

我下載的例子:上發送按鈕 https://dev.office.com/Getting-Started/office365Apis?platform=option-android#register-app 點擊拋出這個錯誤:Android應用程序,錯誤時嘗試發送電子郵件

RetrofitError: 404 Not Found 
{ 
    "error": { 
    "code": "InvalidAuthenticationToken", 
    "message": "Bearer access token is empty.", 
    "innerError": { 
     "request-id": "951626d4-0168-4b58-a78a-1fdd3bd322f2", 
     "date": "2016-04-29T18:34:05" 
    } 
    } 
} 
+0

我假設你不喜歡那個錯誤,並期望別的東西。錯誤的原因是「承載訪問令牌爲空」。另請看看http://stackoverflow.com/help/how-to-ask。 – totoro

回答

-1

你缺少一個訪問令牌。來自https://msdn.microsoft.com/en-us/office/office365/api/discovery-service-rest-operations

Discovery Service operations

Initial sign in

This brings the client to a web page where the user enters account information. It returns the endpoints needed to continue with Discovery Service. This is used the first time a user tries your application. It tells your application: what cloud the user belongs to where the app can send the user to log in where to go to get a token

你可以繼續在官方網站上閱讀它。

+0

OP詢問的示例是Microsoft Graph。 Microsoft Graph應用程序不使用發現服務,而是直接從AAD獲取令牌。 – GarethJ

0

它看起來像也許你沒有註冊你的應用程序在下載樣本之前。示例中的readme指令應引導您註冊和配置應用程序,此時登錄應該成功,您將獲得不記名令牌。

相關問題