Mojang API: Difference between revisions

From wiki.vg
Jump to navigation Jump to search
imported>Thinkofdeath
(Created page with " == Username -> UUID == https://api.mojang.com/users/profiles/minecraft/<username> This will turn the player's username and uuid === Response === <syntaxhighlight lang="j...")
 
imported>Thinkofdeath
(Created page with " == Username -> UUID == https://api.mojang.com/users/profiles/minecraft/<username> This will turn the player's username and uuid === Response === <syntaxhighlight lang="j...")
(No difference)

Revision as of 15:08, 17 July 2014

Username -> UUID

 https://api.mojang.com/users/profiles/minecraft/<username>

This will turn the player's username and uuid

Response

<syntaxhighlight lang="javascript"> {

 "id": "7125ba8b1c864508b92bb5c042ccfe2b",
 "name": "KrisJelbring"

} </syntaxhighlight>

Username -> UUID at time

 https://api.mojang.com/users/profiles/minecraft/<username>?at=<timestamp>

This will turn the player's username and uuid at the timestamp provided

Response

<syntaxhighlight lang="javascript"> {

 "id": "7125ba8b1c864508b92bb5c042ccfe2b",
 "name": "KrisJelbring"

} </syntaxhighlight>

UUID -> All current/previous names

  https://api.mojang.com/user/profiles/<uuid>/names

Response

<syntaxhighlight lang="javascript"> [

 "KrisJelbring"

] </syntaxhighlight>


Player Information

 https://sessionserver.mojang.com/session/minecraft/profile/<uuid>

This will return the player's username plus any additional information about them (e.g. skins). Example: https://sessionserver.mojang.com/session/minecraft/profile/4566e69fc90748ee8d71d7ba5aa00d20

Response

<syntaxhighlight lang="javascript"> {

   "id":"profile identifier",
   "name":"player name",
   "properties":[ 

{ "name":"dunno", "value":"base64 string", "signature":"base64 string; signed data using Yggdrasil's private key" }

   ]

} </syntaxhighlight>

"value" base64 string decoded: <syntaxhighlight lang="javascript"> {

   "timestamp":"some numbers",
   "profileId":"profile identifier",
   "profileName":"player name",
   "isPublic":"true or false",
   "textures":{

"SKIN":{ "url":"player skin URL"

       }
       "CAPE":{

"url":"player cape URL"

       }
   }

} </syntaxhighlight>

Players profiles by names

 https://api.mojang.com/profiles/minecraft

Where 'minecraft' - agent name

This will return players profiles.

Payload

We need to send array of profiles nicknames. For example: <syntaxhighlight lang="javascript"> [

   "maksimkurb",
   "nonExistsPlayer" //Test for non-exists player

] </syntaxhighlight>

Response

<syntaxhighlight lang="javascript"> [

   {
       "id": "0d252b7218b648bfb86c2ae476954d32",    //Profile uuid
       "name": "maksimkurb",                        //Profile nickname
       "legacy": true,                              //Profile not migrated to mojang.com?  (Only appears, when true)
       "demo": true                                 //Game wasn't bought                   (Only appears, when true)
   }
   // How we can see, this url return only information about real (exists) profiles.

] </syntaxhighlight>