getUserInfo
Learn how to use the getUserInfo JSON-RPC method.
Understanding getUserInfo
-
getUserInfo
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 asfacebookId
,googleId
, etc.) will be dependent upon their primary associated social account.` It takes:-
UUID
- string. -
Token
- string.
-
Query example
const axios = require("axios");
(async () => {
const response = await axios.post(
"https://api.particle.network/server/rpc",
{
jsonrpc: "2.0",
id: 0,
method: "getUserInfo",
params: ["Particle Auth User Uuid", "Particle Auth User Token"],
},
{
auth: {
username: "Your Project Id",
password: "Your Project Server Key",
},
}
);
console.log(response.data);
})();
Authorizations
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Body
Version of the JSON-RPC protocol, should be 2.0.
The request identifier.
API method being called, should be getUserInfo.
Parameters for the API method call, including the user's UUID and session token.
Response
Was this page helpful?