Learn how to use the getUserInfoByIdentity JSON-RPC method.
curl --request POST \
--url 'https://api.particle.network/server/rpc/#getUserInfoByIdentity' \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getUserInfoByIdentity",
"params": [
"jwt",
"UID"
]
}
'{
"jsonrpc": "2.0",
"id": 1,
"result": {
"uuid": "2d7b1ff2-0791-4fd2-a26e-16fbcaefdf8a",
"phone": null,
"email": "U1gphy1mnU@particle.network",
"name": null,
"avatar": null,
"facebookId": null,
"facebookEmail": null,
"googleId": null,
"googleEmail": null,
"appleId": null,
"appleEmail": null,
"twitterId": null,
"twitterEmail": null,
"telegramId": null,
"telegramPhone": null,
"discordId": null,
"discordEmail": null,
"githubId": null,
"githubEmail": null,
"twitchId": null,
"twitchEmail": null,
"microsoftId": null,
"microsoftEmail": null,
"linkedinId": null,
"linkedinEmail": null,
"createdAt": "2022-06-08T07:47:54.000Z",
"updatedAt": "2022-06-08T07:47:55.000Z",
"wallets": [
{
"chain": "evm_chain",
"publicAddress": "0x6D5fCEd0C74F22a1B145ef48B25527Ce9BF829bF"
}
]
}
}getUserInfoByIdentitygetUserInfoByIdentity retrieves a JSON object containing various data points relating to a registered user (a user that has already undergone social login), such as their name, UUID, token, email, and so on. The population of specific data points (such as facebookId, googleId, etc.) will be dependent upon their primary associated social account.` It takes:
provider - string, identity provider, now only support jwt.
UID - string, user identifier.
const axios = require("axios");
(async () => {
const response = await axios.post(
"https://api.particle.network/server/rpc",
{
jsonrpc: "2.0",
id: 0,
method: "getUserInfoByIdentity",
params: ["jwt", "User Identity ID"],
},
{
auth: {
username: "Your Project Id",
password: "Your Project Server Key",
},
}
);
console.log(response.data);
})();
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Request parameters for retrieving user information by user identity.
Version of the JSON-RPC protocol, should be 2.0.
"2.0"
The request identifier.
1
API method being called, should be getUserInfoByIdentity.
"getUserInfoByIdentity"
Parameters for the API method call, including the identity provider and user identifier.
["jwt", "UID"]Was this page helpful?
curl --request POST \
--url 'https://api.particle.network/server/rpc/#getUserInfoByIdentity' \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getUserInfoByIdentity",
"params": [
"jwt",
"UID"
]
}
'{
"jsonrpc": "2.0",
"id": 1,
"result": {
"uuid": "2d7b1ff2-0791-4fd2-a26e-16fbcaefdf8a",
"phone": null,
"email": "U1gphy1mnU@particle.network",
"name": null,
"avatar": null,
"facebookId": null,
"facebookEmail": null,
"googleId": null,
"googleEmail": null,
"appleId": null,
"appleEmail": null,
"twitterId": null,
"twitterEmail": null,
"telegramId": null,
"telegramPhone": null,
"discordId": null,
"discordEmail": null,
"githubId": null,
"githubEmail": null,
"twitchId": null,
"twitchEmail": null,
"microsoftId": null,
"microsoftEmail": null,
"linkedinId": null,
"linkedinEmail": null,
"createdAt": "2022-06-08T07:47:54.000Z",
"updatedAt": "2022-06-08T07:47:55.000Z",
"wallets": [
{
"chain": "evm_chain",
"publicAddress": "0x6D5fCEd0C74F22a1B145ef48B25527Ce9BF829bF"
}
]
}
}