我使用Yammer數據導出API將數據提取到本地,使用curl發送請求。Yammer數據導出API顯示HTTP/1.1 400錯誤請求
$AT #access token
curl -v --output export.zip \
--header "Authorization: Bearer $AT" \
--get --data-urlencode since=$DATE \
"https://www.yammer.com/api/v1/export"
如實施例所示在:https://developer.yammer.com/docs/data-export-api
雖然它總是顯示錯誤時請求來檢索數據。
* Connected to www.yammer.com (192.168.1.1) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
} [data not shown]
* SSLv3, TLS handshake, Server hello (2):
{ [data not shown]
* SSLv3, TLS handshake, CERT (11):
{ [data not shown]
* SSLv3, TLS handshake, Server key exchange (12):
{ [data not shown]
* SSLv3, TLS handshake, Server finished (14):
{ [data not shown]
* SSLv3, TLS handshake, Client key exchange (16):
} [data not shown]
* SSLv3, TLS change cipher, Client hello (1):
} [data not shown]
* SSLv3, TLS handshake, Finished (20):
} [data not shown]
* SSLv3, TLS change cipher, Client hello (1):
{ [data not shown]
* SSL connection using ECDHD-RSA-AES256-GCU-SSA324
* Server certificate:
* start date: 2013-01-01 00:00:00 GMT
* expire date: 2017-01-01 12:00:00 GMT
* subjectAltName: www.yammer.com matched
* SSL certificate verify ok.
> GET /api/v1/export HTTP/1.1
> User-Agent: curl/7.35.0
> Host: www.yammer.com
> Accept: */*
> Authorization: Bearer 12252-xxxxxxxx
>
< HTTP/1.1 400 Bad Request
< Date: Wed, 31 Nov 2015 16:06:49 GMT
< Content-Type: application/zip
< Transfer-Encoding: chunked
<
{ [data not shown]
* Connection #0 to host www.yammer.com left intact
我使用的訪問令牌屬於經過驗證的管理,它的確定基於此訪問令牌使用REST API。
任何人都可以給我關於它的建議嗎?
爲什麼www.yammer.com解析爲192.168.1.1? – Brian
不,它解析爲公司的IP – Alan
它看起來像HTTP 400是因爲驗證的管理員訪問令牌無效,我使用它找到了Yammer App Authorization來檢索訪問令牌,如以下網址所述:https:// developer .yammer.com /文檔/ OAuth的2。再加上檢查current.json,它顯示我正在使用經過驗證的管理令牌的令牌。如果有其他方式可以獲得驗證的管理員訪問令牌,但從authorization_code發佈除外?因爲現在檢索到的這個標記是無效的。 – Alan