Difference between revisions of "Realms API"

From wiki.vg
Jump to navigation Jump to search
(Added temp. Pocket Realms API)
 
(Added Pocket Realms page)
Line 3: Line 3:
 
The API endpoint for Desktop Edition is located at https://mcoapi.minecraft.net .
 
The API endpoint for Desktop Edition is located at https://mcoapi.minecraft.net .
  
There is also an endpoint for Pocket Edition in development, located at https://peoapi.minecraft.net. It is being documentated on [http://docs.mcperealms.apiary.io/ apiary], and will be moved here once it is completed.
+
There is also an endpoint for Pocket Edition in development, located at https://peoapi.minecraft.net. It is being documentated on [[Pocket Realms]]
  
 
[[Category:Minecraft Modern]]
 
[[Category:Minecraft Modern]]

Revision as of 20:38, 14 June 2013

The Minecraft Realms API is the api endpoint used to control worlds hosted by Mojang's Minecraft Realms service.

The API endpoint for Desktop Edition is located at https://mcoapi.minecraft.net .

There is also an endpoint for Pocket Edition in development, located at https://peoapi.minecraft.net. It is being documentated on Pocket Realms

Sessions

Session identification is stored in a pair of cookies sent with the header of every request. sid is the session ID of the currently logged in user (see Authentication) user is the case-correct? username of the current user. An example session is shown below:

GET /mco/available HTTP/1.1
Cookie: sid=-000000000000000000;user=Herobrine
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Java/1.6.0_27
Host: mcoapi.minecraft.net
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive


Endpoints:

GET /mco/available

Returns whether the user can access the Minecraft Realms service.

Parameters: none

Returns: plain text; only observed value is

false

GET /worlds

Return a list of servers that the user owns/is invited to? Returns: a JSON object with one array.

{"servers":[]}

GET /worlds/locations

Returns a list of datacenters with server space available.

Returns: a JSON object with currently available locations.

{"locations":[{"locationId":"3","locationName":"London"},{"locationId":"6","locationName":"Los Angeles - California"}],"suggestion":{"locationId":"3","locationName":"London"}}

GET /worlds/$ID

Gets world info? For example, worlds/1 returns:

Not owner

GET /worlds/$ID/join

Joins a world?

World '1' not found!

POST /worlds/$NAME/$LOCATION

Creates a world?