2014-02-07 18 views
0

我已經啓用鏡API爲我在開發者控制檯項目。我授權鏡API和產生在OAuth遊樂場的訪問令牌。建立在操場的請求或發送時手動我總是得到403錯誤。誰能幫忙?獲得403:禁止張貼到我的時間線

wget --header =「Authorization:Bearer access-token」--header =「Content-Type:application/json」--post-data =「{\」text \「:\」Hello world \「 }「https://www.googleapis.com/mirror/v1/timeline --2014-02-07 00:35:00-- https://www.googleapis.com/mirror/v1/timeline 正在解析www.googleapis.com(www.googleapis.com)... 74.125.129.95,2607:f8b0:400e:c04 :: 5f 連接到www.googleapis.com(www.googleapis.com)| 74.125.129.95 |:443 ...連接。 HTTP請求發送的,在等待響應... 403禁止 2014-02-07○時35分00秒403 ERROR:禁止。

回答

1

1)建立在操場

的請求在Glass Playground網站有一個紅色的按鈕和一個名爲底部顯示遊樂場使用信息

如果你點擊那個按鈕,你會看到給遊戲場訪問時間軸的信息。

爲了給遊樂場訪問時間表:

  1. 創建Google APIs project client ID
  2. 添加https://mirror-api-playground.appspot.com到 授權的JavaScript源列表客戶端ID enter image description here
  3. 您的客戶端ID複製到遊樂場,並開始與 你的時間表進行交互。 enter image description here

2)建立請求編程

如果你有403: Forbidden錯誤而發送TimelineItem小號編程,這可能是因爲你不使用你的的clientId的正確值clientSecret

編輯:三個項目從Glass Playground網站(在紅色按鈕下)複製。