Wallet API: Users/User (Deprecated)
Table of Endpoints
Name | Method | Endpoint | Legacy Scope | CDP API Key Scope |
---|---|---|---|---|
Show User (Removed Mar 6) | GET | /v2/users/:user_id | N/A | N/A |
Show Current User | GET | /v2/user | - N/A for public data - wallet:user:read - wallet:user:email | view |
Show Authorization Information | GET | /v2/user/auth | N/A | N/A |
Update Current User (Removed Feb 9) |
info
/user
refers to the current user making the request./users
allows you to pass an ID of a User from whom you want data.
Overview
The User resource represents generic user information. By default, only public information is shared without any scopes. More detailed information or email can be requested with additional scopes.
Parameter | Description |
---|---|
id string | Resource ID |
name string, optional | User's public name |
username string, optional | Payment method's native currency |
profile_location string, optional | Location for user's public profile |
profile_bio string, optional | Bio for user's public profile |
profile_url string, optional | Public profile location if user has one |
avatar_url string | User's avatar url |
resource string, constant user | |
resource_path string |
User's Public Info (default)
{
"id": "9da7a204-544e-5fd1-9a12-61176c5d4cd8",
"name": "User One",
"username": "user1",
"profile_location": null,
"profile_bio": null,
"profile_url": "https://coinbase.com/user1",
"avatar_url": "https://images.coinbase.com/avatar?h=vR%2FY8igBoPwuwGren5JMwvDNGpURAY%2F0nRIOgH%2FY2Qh%2BQ6nomR3qusA%2Bh6o2%0Af9rH&s=128",
"resource": "user",
"resource_path": "/v2/user"
}
Detailed Info of Authenticated User (wallet:user:read
)
{
...
"time_zone": "Pacific Time (US & Canada)",
"native_currency": "USD",
"bitcoin_unit": "bits",
"country": {
"code": "US",
"name": "United States"
},
"created_at": "2015-01-31T20:49:02Z"
}
Authenticated User with Email (wallet:user:email
)
{
...
"email": "user1@example.com"
}
Show Current User
Get current user's public information. To get user's email or private information, use permissions wallet:user:email
and wallet:user:read
. If current request has a wallet:transactions:send
scope, then the response will contain a boolean sends_disabled
field that indicates if the user's send functionality has been disabled.
HTTP Request
GET https://api.coinbase.com/v2/user
Scopes
- No scope required for public data
wallet:user:read
wallet:user:email
Examples
Request
- Shell
- Ruby
- Python
- JavaScript
curl https://api.coinbase.com/v2/user /
-H 'Authorization: Bearer abd90df5f27a7b170cd775abf89d632b350b7c1c9d53e08b340cd9832ce52c2c'
require 'coinbase/wallet'
client = Coinbase::Wallet::Client.new(api_key: <api key>, api_secret: <api secret>)
user = client.current_user
from coinbase.wallet.client import Client
client = Client(<api_key>, <api_secret>)
user = client.get_current_user()
var Client = require('coinbase').Client;
var client = new Client({'apiKey': 'API KEY',
'apiSecret': 'API SECRET'});
client.getCurrentUser(function(err, user) {
console.log(user);
});
Response
{
"data": {
"id": "9da7a204-544e-5fd1-9a12-61176c5d4cd8",
"name": "User One",
"username": "user1",
"profile_location": null,
"profile_bio": null,
"profile_url": "https://coinbase.com/user1",
"avatar_url": "https://images.coinbase.com/avatar?h=vR%2FY8igBoPwuwGren5JMwvDNGpURAY%2F0nRIOgH%2FY2Qh%2BQ6nomR3qusA%2Bh6o2%0Af9rH&s=128",
"resource": "user",
"resource_path": "/v2/user"
}
}
Show Authorization Information
Get current user's authorization information including granted scopes and send limits when using OAuth2 authentication.
HTTP Request
GET https://api.coinbase.com/v2/user/auth
Scopes
- No permission required
Examples
Request
- Shell
- Ruby
- Python
- JavaScript
curl https://api.coinbase.com/v2/user/auth /
-H 'Authorization: Bearer abd90df5f27a7b170cd775abf89d632b350b7c1c9d53e08b340cd9832ce52c2c'
require 'coinbase/wallet'
client = Coinbase::Wallet::Client.new(api_key: <api key>, api_secret: <api secret>)
client.auth_info
from coinbase.wallet.client import Client
client = Client(<api_key>, <api_secret>)
user = client.get_auth_info()
var Client = require('coinbase').Client;
var client = new Client({'apiKey': 'API KEY',
'apiSecret': 'API SECRET'});
client.getCurrentUser(function(err, user) {
user.showAuth(function(err, auth) {
console.log(auth);
});
});
Response
{
"data": {
"method": "oauth",
"scopes": [
"wallet:user:read",
"wallet:user:email"
],
"oauth_meta": {}
}
}