Addresses
Overview
The Addresses API allows you to retrieve Ethereum addresses associated with a user in the Ethos network. This API is useful for obtaining both the primary address and all addresses linked to a specific user.
Endpoints
Get Addresses by Userkey
Description: Retrieves the primary address and all addresses associated with a specific user identified by their userkey.
Authentication Required: No
Parameters
Path Parameters
userkey
string
Yes
The userkey for the user. Can be in the format of "profileId:123", "address:0x1234...", or "service:x.com:123456789"
Responses
Success Response
Code: 200 OK
ok
boolean
Success status
data
object
Address data
data.profileId
number
The profile ID associated with the userkey (may be undefined if not applicable)
data.primaryAddress
string
The primary Ethereum address
data.allAddresses
array
Array of all Ethereum addresses associated with the user
Error Responses
Code: 404 Not Found
Code: 400 Bad Request
Example
Request
Response
Notes
The primary address is always the first address in the
allAddresses
array.If a user has no addresses, the API will return an empty array for
allAddresses
and theprimaryAddress
will be undefined.If the userkey is an address format (e.g., "address:0x1234..."), the response will include that address and any other addresses associated with the same user.
When using a service-based userkey (e.g., "service:x.com:username"), if the service account is not associated with a profile, the response will return the zero address (0x0000000000000000000000000000000000000000) for both
primaryAddress
and in theallAddresses
array.Unlike some other endpoints, this endpoint does not return a 404 error for invalid or non-existent userkeys; instead, it returns a 200 OK with default values.
The
profileId
field might be omitted from the response if the userkey doesn't correspond to an existing profile.
Last updated