2015-05-26 19 views

回答

1

感謝您對我們API的使用感興趣!

我認爲如何使用API​​的最佳解釋是在我們的developers site文檔中。

看看那個,讓我們知道你是否有任何其他問題。

從該網頁特別有用的是,你的應用程序可能通過這個樣品流量:

# Redirect the user to this page 
https://www.coinbase.com/oauth/authorize?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_CALLBACK_URL&scope=user+balance 

# If the user accepts, they will be redirected to: 
YOUR_CALLBACK_URL?code=CODE 

# Initiate a POST request to get the access token 
https://api.coinbase.com/oauth/token& 
    grant_type=authorization_code& 
    code=CODE& 
    redirect_uri=YOUR_CALLBACK_URL& 
    client_id=CLIENT_ID& 
    client_secret=CLIENT_SECRET 

# Response containing the 'access_token' 
{ 
    "access_token": "...", 
    "refresh_token": "...", 
    "token_type": "bearer", 
    "expire_in": 7200, 
    "scope": "universal" 
} 

# Now you can use the 'access_token' to initiate authenticated requests 
https://api.coinbase.com/v1/account/balance?access_token=... 

# Response 
{ 
    "amount": "50.00000000", 
    "currency": "BTC" 
} 
+0

你好約翰, 感謝您的答覆。我不想在postrequest表單中,我想使用java函數,所以需要知道調用身份驗證的函數。 而在獲取令牌時,參數代碼是什麼?我應該在那裏提及。 – Akshea