question

Brent Batas (Lisk) avatar image
Brent Batas (Lisk) asked

Get player profile using Admin API?

I would like to perform an admin operation on a single player profile (for testing) before I perform it on a full segment.

I see Server.GetPlayerProfile and Client.GetPlayerProfile which would be perfect, but I'm working with the Admin API, so it seems like these won't work. (unless there's a way to cast from a ServerModels.PlayerProfileModel to an AdminModels.PlayerProfile)

Is it possible to get a GetPlayerProfile call for the Admin API?

apis
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

The call doesn't exist in the Admin API, but to date we haven't heard of that as an issue, since Server API calls have the same requirements as Admin API calls (so, people tend to just use both in their custom tools). What's the context in which you would have access to the Admin API, but not the Server API?

5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Brent Batas (Lisk) avatar image Brent Batas (Lisk) commented ·

I have access to both, but I just have a method that accepts an Admin Player Profile. I guess I could write my own data structure or extension method to handle casting between a Server Player Profile and an Admin Player Profile, but that seems a roundabout way of doing things.

0 Likes 0 ·
brendan avatar image brendan Brent Batas (Lisk) commented ·

Since that specific call isn't in the Admin API, I'd recommend using the Server API version for now, and updating your method to use the player profile you get from there (from the Server models). The two models are effectively the same, but I can't guarantee the mapping if you were to attempt to serialize one with data for the other, as that's untested.

0 Likes 0 ·
Brent Batas (Lisk) avatar image Brent Batas (Lisk) brendan commented ·

I see - that makes sense. Will do.

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.