Sign In Register

How can we help you today?

Start a new topic

Getting Account Details of a different user

Hello!

I'm trying to get the account details of a different user by ID.


Desired result:

Imagine two users,

USERALPHA and USERBETA.

USERALPHA is logged in the Unity Client.

USERALPHA sends a request for USERBETA's account details.

USERALPHA receives response containing USERBETA's account details.


In the Test Harness, everything works

1. AuthenticationRequest as "USERALPHA", successful.

2. Send an AccountDetailsRequest:

{
  "@class": ".AccountDetailsRequest",
  "playerId": "USERBETA_ID"
}

3. Successfully receive AccountDetailsResponse with "USERBETA" information.


However, in Unity, this does not work.

I am correctly setting the "playerId" field within Unity.

Here is what happens:

1. Log in via AuthenticationRequest as USERALPHA. Success.

2. Send an AccountDetailsRequest as USERALPHA.

3. Success: returns USERALPHA's account details.

4. Send an AccountDetailsRequest with playerId: USERBETA_ID.

5. Receive response with USERALPHA's details.


 


Is there any method that currently exists to get a different user's account details?

https://docs.gamesparks.com/api-documentation/request-api/player/accountdetailsrequest.html


Retrieves the details of the current authenticated player.

I'm not trying to retrieve the details of the current authenticated player.


I'm trying to get the details of ANOTHER player.

Not the current player.

Hi Samuel,


You can do this by using a SparkRequest to send the request on behalf of another player. See here for more details.


Regards,

Liam

Login to post a comment