POST
/
#getUserInfoByIdentity
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"
      }
    ]
  }
}

Understanding getUserInfoByIdentity

  • getUserInfoByIdentity 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.

Authorization use project server key

Query example

JavaScript
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);
})();

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json
Request parameters for retrieving user information by user identity.
jsonrpc
string
default:2.0

Version of the JSON-RPC protocol, should be 2.0.

Example:

"2.0"

id
integer
default:1

The request identifier.

Example:

1

method
string
default:getUserInfoByIdentity

API method being called, should be getUserInfoByIdentity.

Example:

"getUserInfoByIdentity"

params
string[]

Parameters for the API method call, including the identity provider and user identifier.

Example:
["jwt", "UID"]

Response

200 - application/json
Successful response with user information.
jsonrpc
string
Example:

"2.0"

id
integer
Example:

1

result
object