这些是我的临时API设置:
wallet:accounts:read wallet:addresses:read wallet:buys:read wallet:checkouts:read wallet:contacts:read wallet:deposits:read wallet:notifications:read wallet:orders:read wallet:payment-methods:read wallet:sells:read wallet:transactions:read wallet:transactions:request wallet:transactions:send wallet:transactions:transfer wallet:user:read wallet:withdrawals:read
阅读帐户数据:
HTTP REQUEST
GET https://api.coinbase.com/v2/accounts
SCOPES
wallet:accounts:read
......效果很好。
但是交易数据的请求(我只需要购买,如图所示)......
HTTP REQUEST
GET https://api.coinbase.com/v2/accounts/:account_id/transactions
SCOPES
wallet:transactions:read
...给我一个空洞的结果:
{"pagination":{"ending_before":null,"starting_after":null,"limit":25,"order":"desc","previous_uri":null,"next_uri":null},"data":[]}
任何人都知道我在这里可以错过什么?
答案 0 :(得分:1)
我不知道为什么你不能得到交易。我告诉我我在BTC账户上进行了交易。检索和出售BTC。当我打电话
https://api.coinbase.com/v2/accounts/account_id/transactions
CB-VERSION
2018-05-09
(新发布),它返回。
一定要确定;
1-您所选帐户中有交易。当您从coinbase.com查询时,请确保您看到了交易。
2-请确保您的帐户ID转到带有网址的API
3-确保所选帐户ID与发送帐户ID匹配。
3-确保您的请求标题正常。
4-确保您的Auth令牌未过期。
我很确定你在代码中遗漏了一些东西。如果以上都不能解决您的问题,请找我。我可以帮忙。
答案 1 :(得分:1)
感谢您的回答 - 我明白了。
我的错误是认为我需要为一个且唯一的帐户ID请求我的交易,例如用户ID。但在阅读JSON帐号后,我发现每个钱包都有一个帐号ID。我读了欧元钱包,我当然没有单笔交易。
非常感谢。 塞巴斯蒂安。