我使用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