Difference between revisions of "Pocket Realms"

From wiki.vg
Jump to navigation Jump to search
m (Added /m/session note.)
(update endpoint)
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
[[Category:Pocket_Minecraft]]
 +
 +
This page was last updated for Realms version 0.7.6 and will likely not be accurate for future Minecraft PE versions.
 +
 +
Currently, Pocket Realms has been discontinued for MCPE, so it would not work.
 +
 
== Authentication ==
 
== Authentication ==
  
Line 4: Line 10:
  
 
Steps to Login
 
Steps to Login
*Pull authenticityToken from /m/login?app=mcpe
+
*Pull authenticityToken from /m/login?app=mcpe&version=0.7.6
 
*POST to /m/login
 
*POST to /m/login
 
*Client is redirected to /m/launch
 
*Client is redirected to /m/launch
Line 16: Line 22:
 
Request Parameters:
 
Request Parameters:
  
*authenticityToken: Pulled from /m/login?app=mcpe
+
*authenticityToken: Pulled from /m/login?app=mcpe&version=0.7.6
 
*email: Email of user
 
*email: Email of user
 
*password: Password of user
 
*password: Password of user
  
Pull mojangSessionId from the PLAY_SESSION cookie, and use that as the sid cookie in peoapi.minecraft.net requests. The mojangSessionId is also returned in a JSON key of sessionID with a request to /m/session
+
Pull mojangSessionId from the PLAY_SESSION cookie, and use that as the sid cookie in pocket.realms.minecraft.net requests. The mojangSessionId is also returned in a JSON key of sessionID with a request to /m/session
  
Cookies needed for peoapi.minecraft.net requests:
+
Cookies needed for pocket.realms.minecraft.net requests:
  
 
*sid: Pulled from mojangSessionId
 
*sid: Pulled from mojangSessionId
 
*gameversion: Version of the game the requests are coming from
 
*gameversion: Version of the game the requests are coming from
 +
 +
Response:
 +
 +
<pre>
 +
Logged in.
 +
</pre>
  
 
== Endpoints ==
 
== Endpoints ==
  
Endpoint: https://peoapi.minecraft.net
+
Endpoint: https://pocket.realms.minecraft.net
  
 
=== GET /server/list ===
 
=== GET /server/list ===
Line 46: Line 58:
 
*playerNames: Usernames of players currently playing on the server
 
*playerNames: Usernames of players currently playing on the server
 
*invited: Usernames of players who are invited to the server
 
*invited: Usernames of players who are invited to the server
 +
*daysLeft: Unknown use
  
 
Response:
 
Response:
Line 59: Line 72:
 
     "type":"survival",
 
     "type":"survival",
 
     "playerNames":["Steve", "Stevie"],
 
     "playerNames":["Steve", "Stevie"],
     "invited":["Steve", "Stevie"]
+
     "invited":["Steve", "Stevie"],
 +
    "daysLeft": 0
 
   
 
   
 
  }]
 
  }]
Line 198: Line 212:
 
Response:
 
Response:
  
  {"buyServerEnabled":false,"createServerEnabled":false}
+
  {"serviceEnabled":true,"buyServerEnabled":false,"createServerEnabled":false}
  
 
[[Category: Pocket Minecraft]]
 
[[Category: Pocket Minecraft]]

Revision as of 11:07, 10 July 2017


This page was last updated for Realms version 0.7.6 and will likely not be accurate for future Minecraft PE versions.

Currently, Pocket Realms has been discontinued for MCPE, so it would not work.

Authentication

Endpoint: https://account.mojang.com

Steps to Login

  • Pull authenticityToken from /m/login?app=mcpe&version=0.7.6
  • POST to /m/login
  • Client is redirected to /m/launch

POST /m/login

Player Login

Parameters sent in body

Request Parameters:

  • authenticityToken: Pulled from /m/login?app=mcpe&version=0.7.6
  • email: Email of user
  • password: Password of user

Pull mojangSessionId from the PLAY_SESSION cookie, and use that as the sid cookie in pocket.realms.minecraft.net requests. The mojangSessionId is also returned in a JSON key of sessionID with a request to /m/session

Cookies needed for pocket.realms.minecraft.net requests:

  • sid: Pulled from mojangSessionId
  • gameversion: Version of the game the requests are coming from

Response:

Logged in.

Endpoints

Endpoint: https://pocket.realms.minecraft.net

GET /server/list

List servers that user own or has been invited to

Response Parameters:

  • serverId: Id of server
  • name: Server Title
  • open: Whether server is joinable
  • ownerName: Name of server owner
  • myWorld: Whether the server belongs to the current user
  • maxNrPlayers: Max number of players
  • type: Type of server, can be creative or survival
  • playerNames: Usernames of players currently playing on the server
  • invited: Usernames of players who are invited to the server
  • daysLeft: Unknown use

Response:

[{

   "serverId":1,
   "name":"Steve's Server",
   "open":true,
   "ownerName":"Steve",
   "myWorld":true,
   "maxNrPlayers":10,
   "type":"survival",
   "playerNames":["Steve", "Stevie"],
   "invited":["Steve", "Stevie"],
   "daysLeft": 0

}]


POST /server/{id}/join

Join a server

Request Parameters:

  • id: Pulled from serverId on /server/list

Response Paramenters:

  • ip: IP of server
  • port: Port of server
  • key: Key used to encrypt the data received on the server (AES-128 ECB)

Response:

{
   "ip":"87.169.167.12",
   "port":21647,
   "key":"/6UAOMG6Q/EIjHxLa87un5l=="
}


POST /server/create?name={server_name}&type={type}&seed={seed}

Create a server. (Not complete)

Request Parameters:

  • server_name: Title of server
  • type: Type of server, can be creative or survival
  • seed: Seed for server

Response:

Response not yet documented


PUT /server/{id}/name/{server_name}

Change name of server (Not complete)

Request Parameters:

  • id: Pulled from serverId on /server/list
  • server_name: Title of server

Response:

Response not yet documented


PUT /server/{id}/open

Open server (Not complete)

Request Parameters:

  • id: Pulled from serverId on /server/list

Response:

Response not yet documented


PUT /server/{id}/close

Close server (Not complete)

Request Parameters:

  • id: Pulled from serverId on /server/list

Response:

Response not yet documented


POST /server/{id}/whitelist/{username}

Add username to whitelist (Not complete)

Request Parameters:

  • id: Pulled from serverId on /server/list
  • username: Username of player to add to the whitelist

Response:

Response not yet documented


DELETE /server/{id}/whitelist/{username}

Delete username from whitelist (Not complete)

Request Parameters:

  • id: Pulled from serverId on /server/list
  • username: Username of player to delete from the whitelist

Response:

Response not yet documented


POST /server/heartbeat?nplayers={num_players}

Exact use unknown (Not complete) (Most likely a POST)

Request Parameters:

  • num_players: Number of players currently on server?

Response:

Response not yet documented


GET /auth/validate-player/{unknown_string}/{unknown_string}

Check whether username is authorized? (Not complete)

Needs the cookie key

Request Parameters:

  • unknown_string: One of the values could be a username?

Response:

Response not yet documented


GET /info/status

Determines whether server creation is allowed

Response Parameters:

  • buyServerEnabled: Whether server buying is enabled?
  • createServerEnabled: Whether server creation is enabled?

Response:

{"serviceEnabled":true,"buyServerEnabled":false,"createServerEnabled":false}