所以我正在尝试使用 Basecamp API。新的位于这里: https://github.com/basecamp/bcx-api
所以我看到有人在这里提出了类似的问题:
New basecamp api tells me there's no basecamp account at this address
我尝试遵循该示例,包括阅读评论,但它对我不起作用。特别是对已接受答案的评论:
This is basecamp account id, as you can see this unique id in url after login in basecamp account
通常当我登录basecamp时,我会在这里登录:
https ://myclientname dot basecamphq dot com/login
。
当我登录时,它会将我重定向到
https ://myclientname 点 basecamphq.com/clients
。
当我从那里登录到网络界面时,我可以转到右上角的“我的信息”链接,其中列出了“提要阅读器或 Basecamp API 的 token ”。
但是..我的网址中没有客户端 ID?我尝试了各种组合,但没有任何效果。以下是我尝试过的一些示例(使用正确的值):
curl -u myuser:mypass -H 'User-Agent: MyApp (<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b3decaf3d6ded2dadf9dd0dcde" rel="noreferrer noopener nofollow">[email protected]</a>)' https://myclientname.basecamphq.com/api/v1/projects.json`
curl -u myuser:mypass -H 'User-Agent: MyApp (<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e08d99a0858d81898cce838f8d" rel="noreferrer noopener nofollow">[email protected]</a>)' https://basecamp.com/myclientname/api/v1/projects.json
curl -u myuser:mypass -H 'User-Agent: MyApp (<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="54392d143139353d387a373b39" rel="noreferrer noopener nofollow">[email protected]</a>)' https://basecamp.com/mytokenhere/api/v1/projects.json
curl -u myuser:mypass -H 'User-Agent: MyApp (<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="75180c351018141c195b161a18" rel="noreferrer noopener nofollow">[email protected]</a>)' https://myclientname.basecamphq.com/mytokenhere/api/v1/projects.json
curl -u myuser:mypass -H 'User-Agent: MyApp (<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7a17033a1f171b131654191517" rel="noreferrer noopener nofollow">[email protected]</a>)' https://myclientname.basecamphq.com/myclientname/api/v1/projects.json
curl -u myuser:mypass -H 'User-Agent: MyApp (<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f5988cb59098949c99db969a98" rel="noreferrer noopener nofollow">[email protected]</a>)' https://basecamphq.com/myclientname/api/v1/projects.json
这些东西只是给我常规的 html 响应,说诸如“此地址没有 Basecamp 帐户”或“哎呀,这是不对的。您可能输入了错误的 URL[..]”或有时curl 返回“curl: (51) SSL 对等证书或 SSH 远程 key 不正常”(如最后一次尝试所示)
Soo..我在这里做错了什么?
编辑
我确实注意到,当我登录 basecamphq.com
网络界面时,页面顶部有一些元标记(来自查看源代码)
看起来像这样:
<meta name='current-user' content=1234567>
<meta name='current-identity' content=12345>
<meta name='current-account' content=123456>
我还尝试了 current-identity
和 current-account
但这些也不起作用,只是一直给我相同的消息。例如
curl -u myuser:mypass -H 'User-Agent: MyApp (<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="65081c250008040c094b060a08" rel="noreferrer noopener nofollow">[email protected]</a>)' https://myclientname.basecamphq.com/123456/api/v1/projects.json
curl -u myuser:mypass -H 'User-Agent: MyApp (<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6f02162f0a020e0603410c0002" rel="noreferrer noopener nofollow">[email protected]</a>)' https://basecamp.com/123456/api/v1/projects.json
最佳答案
如果您的网址类似于 https://mycompany.basecamphq.com/
,那么您应该使用 Basecamp Classic API - 您会找到 docs here 。
使用https://github.com/basecamp/bcx-api上的API适用于使用我们于2012年3月6日推出的新版Basecamp的帐户。您的网址将类似于https://basecamp.com/1234567
:)
关于php - Basecamp api 告诉我没有 Basecamp 帐户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22264322/