You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can specify the query parameter `queryBy` to query by different user identifiers:
26
+
27
+
-`queryBy`: The parameter to query by. Can be one of `walletAddress`, `email`, `phone`, `externalWalletAddress`, or `id`.
28
+
29
+
You can then specify the value to query by, matching the queryBy parameter:
30
+
31
+
-`walletAddress`: The user's wallet address that thirdweb has generated for them
32
+
-`email`: The user's email address
33
+
-`phone`: The user's phone number
34
+
-`externalWalletAddress`: The user's wallet address that used to login via SIWE
35
+
-`id`: The user's ID (for custom auth)
36
+
37
+
### Authentication
38
+
39
+
You need to include your ThirdWeb Client Secret in the Authorization header.
40
+
41
+
If you are an ecosystem owner, you have to include the `x-ecosystem-id` header and optionally the `x-ecosystem-partner-id` header if the ecosystem is set to partners only.
42
+
43
+
### Example curl Command
44
+
45
+
Here's an example curl command to fetch user details by email:
46
+
47
+
```bash
48
+
curl -X GET 'https://in-app-wallet.thirdweb.com/api/2023-11-30/embedded-wallet/user-details?queryBy=email&[email protected]' \
49
+
-H 'x-secret-key: YOUR_THIRD_WEB_CLIENT_SECRET'
50
+
```
51
+
52
+
Here's an example curl command to fetch user details by address:
53
+
54
+
```bash
55
+
curl -X GET 'https://in-app-wallet.thirdweb.com/api/2023-11-30/embedded-wallet/user-details?queryBy=walletAddress&walletAddress=0x123456789abcdef' \
56
+
-H 'x-secret-key: YOUR_THIRD_WEB_CLIENT_SECRET'
57
+
```
58
+
59
+
Here's an example curl command to fetch the user details for an ecosystem owner:
60
+
61
+
```bash
62
+
curl -X GET 'https://in-app-wallet.thirdweb.com/api/2023-11-30/embedded-wallet/user-details?queryBy=walletAddress&walletAddress=0x123456789abcdef' \
In both examples, replace `YOUR_THIRD_WEB_CLIENT_SECRET` with your actual ThirdWeb Client Secret.
69
+
70
+
Replace `YOUR_ECOSYSTEM_ID` and `YOUR_PARTNER_ID` with your actual ecosystem ID and partner ID respectively. The partner ID can be one you set up for yourself as the ecosystem owner.
71
+
72
+
### Response Format
73
+
74
+
The API returns a JSON array with the following structure for each user:
75
+
76
+
```json
77
+
[
78
+
{
79
+
"userId": "string",
80
+
"walletAddress": "string",
81
+
"email": "string (optional)",
82
+
"phone": "string (optional)",
83
+
"createdAt": "string",
84
+
"linkedAccounts": [
85
+
{
86
+
"type": "string",
87
+
"details": {
88
+
"phone": "string",
89
+
// or
90
+
"email": "string",
91
+
// or
92
+
"address": "string",
93
+
// or
94
+
"id": "string",
95
+
// Additional key-value pairs may be present
96
+
}
97
+
}
98
+
]
99
+
}
100
+
]
101
+
```
102
+
103
+
Note: The `details` object in `linkedAccounts` will contain different fields based on the account type. See the [list of Strategies](#list-of-strategies) above for more information.
104
+
105
+
Remember to handle the response appropriately in your chosen programming language, including error cases and parsing the JSON response.
106
+
107
+
### Convenience Methods
108
+
109
+
If you are using the thirdweb SDK, you can use the `getUser` method to retrieve user details.
110
+
111
+
<ArticleIconCard
112
+
title="getUser"
113
+
icon={TypeScriptIcon}
114
+
description="Get user details from your backend for thirdweb wallets in TypeScript"
115
+
href="/references/typescript/v5/getUser"
116
+
/>
117
+
118
+
# Get All Users
14
119
15
120
Once you have users connecting to your app through in-app wallets, you can fetch all users through our REST API:
16
121
```
@@ -31,7 +136,7 @@ You need to include the following headers:
31
136
Here's an example curl command to pregenerate a thirdweb wallet for the user `[email protected]`:
0 commit comments