DEVELOPER API
DOCUMENTATION

info_outline
INFO: All projects using the developer API are required to be verified before public release.

Basic Information


Request

The developer API accepts both POST and GET requests, except for medium and high sensitivity sections of the API where only POST requests are accepted. All request bodies must also be in valid JSON format. Along with this, every request requires a section (sec) value to define what portion of the API is being accessed. Every response will be in valid JSON format, except when otherwise noted in the request. The base API can be accessed from https://theartex.net/cloud/api.

Response

Each response will always include status, code, and message values.

In the occurrence of any error, status will return error, code will return an error code in the form of an integer and message will return a simple explanation of the error. The error code returned from code should not be used to identify errors.

If a request is successful, status will return success, code will return 0 and message will return a simple explanation of the response or request. If data is requested, a data value, containing all requested information, will also be present in the response.

Error Example
{
	"status":"error",
	"code":"400",
	"message":"explanation"
}
Success Example
{
	"status":"success",
	"code":"200",
	"message":"explanation",
	"data": 
	{
		"name":"value"
	}
}

Useful Links

A Java hook for the developer API can be found on the Artex Development GitHub organization at https://github.com/artexdevelopment/MathhulkJavaAPI.

Documentation Examples


User API

Authentication

The authentication section of the user API allows you to authenticate users.
The following values must be present in the request, but the format of the request will vary: sec = login, username = username and password = password.


Example
{
	"status":"success",
	"code":"200",
	"message":"user retrieved",
	"data": 
	{
		"id":"10099",
		"username":"Example",
		"role":"User",
		"email":"[email protected]",
		"gravatar":"[email protected]",
		"banned":"no",
		"active":"yes",
		"key":"NNeEPPqgiYlqITPcIagF"
	}
}

Session

The session section of the user API allows you to update the status of a user.
The following values must be present in the request, but the format of the request will vary: sec = session, page = application://current location, ip = ip address and key = user key.


Example
{
	"status":"success",
	"code":"200",
	"message":"session updated"
}

New Alert

The new alert section of the user API allows you to send an alert to a user.
The following values must be present in the request, but the format of the request will vary: sec = alert, title = application, message = alert and key = user key.


Example
{
	"status":"success",
	"code":"200",
	"message":"alert created",
	"data":
	{
		"id":"448"
	}
}

List Alerts

The list alerts section of the user API allows you to collect all current alerts of a user.
The following values must be present in the request, but the format of the request will vary: sec = alerts and key = user key.


Example
{
	"status":"success",
	"code":"200",
	"message":"alerts retrieved",
	"data":
	[
		{
			"id":"346",
			"title":"Profile",
			"message":"Your profile has been successfully updated.",
			"new":"yes",
			"trn_date":"2017-03-12 02:45:06"
		},
		{
			"id":"345",
			"title":"API",
			"message":"Your developer and user keys have been successfully created.",
			"new":"yes",
			"trn_date":"2017-03-12 02:44:46"
		}
		...
	]
}

Alert State

The alert state section of the user API allows you to mark alerts as read, meaning they are no longer shown as new to the user.
The following values must be present in the request, but the format of the request will vary: sec = read, id = alert id and key = user key.


Example
{
	"status":"success",
	"code":"200",
	"message":"alert updated"
}

Information API

Announcements

The announcements section of the user API allows you collect all current announcements.
The following values must be present in the request, but the format of the request will vary: sec = announcements.


Example
{
	"status":"success",
	"code":"200",
	"message":"announcements retrieved",
	"data": 
	[
		{
			"id":"10098",
			"message":"This is an announcement.",
			"trn-date":"2017-06-28 12:07:15"
		},
		{
			"id":"10099",
			"message":"This is also an announcement.",
			"trn-date":"2017-06-28 12:07:15"
		},
		...
	]
}

Minecraft API

The Minecraft API is separate from the base API and can be accessed from https://theartex.net/cloud/api/minecraft. All responses are cached for five minutes. If you would like to receive your result in plain text instead of valid JSON format, use the following value with your request: response = text.

Username

The username section of the Minecraft API allows you to get the username of a Minecraft player from their UUID.
The following values must be present in the request, but the format of the request will vary: sec = username and uuid = uuid.


Example
{
	"status":"success",
	"code":"200",
	"message":"username retrieved",
	"data": 
	{
		"id":"e7ec6c61f69f437f89f888c4d1536395",
		"name":"mathhulk"
	}
}

UUID

The UUID section of the Minecraft API allows you to get the UUID of a Minecraft player from their username.
The following values must be present in the request, but the format of the request will vary: sec = uuid and username = username.


Example
{
	"status":"success",
	"code":"200",
	"message":"uuid retrieved",
	"data": 
	{
		"id":"e7ec6c61f69f437f89f888c4d1536395",
		"name":"mathhulk"
	}
}

Name History

The name history section of the Minecraft API allows you to get a list of usernames that have been or are currently associated with a UUID.
The following values must be present in the request, but the format of the request will vary: sec = history and uuid = uuid.


Example
{
	"status":"success",
	"code":"200",
	"type":"url",
	"message":"history retrieved",
	"data": 
	[
		{
			"name":"KingAlterIV"
		},
		{
			"name":"CorruptedS0ul",
			"changedToAt":1451346513000
		},
		{
			"name":"Karamatsu",
			"changedToAt":1457134037000
		}
	]
}

Codity API

Paste

The paste section of the Codity API allows you to gather information on a specific Codity paste.
The following values must be present in the request, but the format of the request will vary: sec = paste and id = paste.


Example
{
	"status":"success",
	"code":"200",
	"message":"paste retrieved",
	"data": 
	{
		"name":"Public API",
		"username":"---",
		"url":"https://c.theartex.net/12iU3uRH8G",
		"raw":"https://c.theartex.net/raw/12iU3uRH8G",
		"trn_date":"2017-06-28 12:07:15",
	}
}

List Pastes

The list pastes section of the Codity API allows you to get a list of pastes associated with a user.
The following values must be present in the request, but the format of the request will vary: sec = pastes and username = username.


Example
{
	"status":"success",
	"code":"200",
	"message":"pastes retrieved",
	"data": 
	[
		{
			"name":"Public API",
			"id":"12iU3uRH8G",
			"url":"https://c.theartex.net/12iU3uRH8G",
			"raw":"https://c.theartex.net/raw/12iU3uRH8G",
			"trn_date":"2017-06-28 12:07:15",
		},
		{
			"name":"---",
			"id":"23r9ufnWE3",
			"url":"https://c.theartex.net/23r9ufnWE3",
			"raw":"https://c.theartex.net/raw/23r9ufnWE3",
			"trn_date":"2017-06-28 12:07:15",
		}
		...
	]
}

MH-DNS API

Record

The record section of the MH-DNS API allows you to gather information on a specific MH-DNS record.
The following values must be present in the request, but the format of the request will vary: sec = record and id = record.


Example
{
	"status":"success",
	"code":"200",
	"message":"record retrieved",
	"data": 
	{
		"name":"test",
		"domain":"mh-dns.us",
		"username":"mathhulk",
		"ip":"127.0.0.1",
		"port":"---",
		"trn_date":"2017-06-28 12:07:15",
	}
}

List Records

The list records section of the MH-DNS API allows you to get a list of records associated with a user.
The following values must be present in the request, but the format of the request will vary: sec = records and username = username.


Example
{
	"status":"success",
	"code":"200",
	"message":"records retrieved",
	"data": 
	[
		{
			"id":"10078",
			"name":"test",
			"domain":"mh-dns.us",
			"ip":"127.0.0.1",
			"port":"---",
			"trn_date":"2017-06-28 12:07:15",
		},
		{
			"id":"10077",
			"name":"test",
			"paste":"mineserver.rocks",
			"ip":"68.101.23.48",
			"port":"25566",
			"trn_date":"2017-06-28 12:07:15",
		}
		...
	]
}

Skript API

The Skript API is separate from the base API and can be accessed from https://theartex.net/cloud/api/skript.

Addon

The addon section of the Skript API allows you to gather information on a specific Skript addon.
The following values must be present in the request, but the format of the request will vary: sec = addon and name = addon.


Example
{
	"status":"success",
	"code":"200",
	"message":"addon retrieved",
	"data": 
	{
		"name":"Skript",
		"version":"2.2",
		"status":"on",
		"author":"TonyMaster21",
		"trn_date":"2017-04-01 17:23:13"
	}
}

List Addons

The list addons section of the Skript API allows you to get a list of addons.
The following values must be present in the request, but the format of the request will vary: sec = addons.


Example
{
	"status":"success",
	"code":"200",
	"message":"addons retrieved",
	"data": 
	[
		{
			"name":"Skript",
			"version":"2.2",
			"status":"on",
			"author":"TonyMaster21",
			"trn_date":"2017-04-01 17:23:13"
		},
		{
			"name":"OpenAudioMc",
			"version":"2.2",
			"status":"on",
			"author":"Legoman99573",
			"trn_date":"2017-04-01 18:12:56"
		},
		{
			"name":"mathhulkSK",
			"version":"1.0pre2",
			"status":"on",
			"author":"mathhulk",
			"trn_date":"2017-04-02 16:06:30"
		}
		...
	]
}

List Documentation

The list documentation section of the Skript API allows you to get a list of documentation associated with an addon.
The following values must be present in the request, but the format of the request will vary: sec = docs and name = addon.


Example
{
	"status":"success",
	"code":"200",
	"message":"documentation",
	"data": 
	[
		{
			"id":"4",
			"name":"on audio open\/close",
			"type":"event",
			"description":"Fired when a player connects\/disconnects from OpenAudio server",
			"plugins":"OpenAudioMc",
			"pattern":"[on] audio (connect\/disconnect):",
			"example":"on audio open:\r\n broadcast \"%event-player% connected to openaudio\"\r\n\r\non audio close:\r\n broadcast \"%event-player% disconnected from openaudio\"",
			"trn_date":"2017-04-01 18:29:30"
		},
		{
			"id":"6",
			"name":"on hue connect",
			"type":"event",
			"description":"Fired when a player connects their Phillips Hue bridge.",
			"plugins":"OpenAudioMc",
			"pattern":"[on] hue (connect):",
			"example":"on hue connect:\r\n broadcast \"%event-player% linked their philips hue bridge to openaudio\"",
			"trn_date":"2017-04-01 18:35:20"
		}
		...
	]
}

List Examples

The list examples section of the Skript API allows you to get a list of examples associated with a portion of the documentation.
The following values must be present in the request, but the format of the request will vary: sec = examples and id = id.


Example
{
	"status":"success",
	"code":"200",
	"message":"examples retrieved",
	"data": 
	[
		{
			"description":"Test",
			"example":"test",
			"username":"mathhulk",
			"trn_date":"2017-04-04 04:36:04"
		},
		{
			"description":"This is an example.",
			"example":"command \/me:\r\n trigger:\r\n send \"%player%\"",
			"username":"mathhulk",
			"trn_date":"2017-04-04 04:54:32"
		}
		...
	]
}

Search

The search section of the Skript API allows you to get a list of documentation that matches a specific search query.
The following values must be present in the request, but the format of the request will vary: sec = search and search = query.


Example
{
	"status":"success",
	"code":"200",
	"message":"results retrieved,
	"data": 
	[
		{
			"id":"4",
			"name":"on audio open\/close",
			"addon":"OpenAudioMc",
			"type":"event",
			"description":"Fired when a player connects\/disconnects from OpenAudio server",
			"plugins":"OpenAudioMc",
			"pattern":"[on] audio (connect\/disconnect):",
			"example":"on audio open:\r\n broadcast \"%event-player% connected to openaudio\"\r\n\r\non audio close:\r\n broadcast \"%event-player% disconnected from openaudio\"",
			"trn_date":"2017-04-01 18:29:30"
		},
		{
			"id":"6",
			"name":"on hue connect",
			"addon":"OpenAudioMc",
			"type":"event",
			"description":"Fired when a player connects their Phillips Hue bridge.",
			"plugins":"OpenAudioMc",
			"pattern":"[on] hue (connect):",
			"example":"on hue connect:\r\n broadcast \"%event-player% linked their philips hue bridge to openaudio\"",
			"trn_date":"2017-04-01 18:35:20"
		}
		...
	]
}

New Documentation

The new documentation section of the Skript API allows addon developers to add documentation to their Skript addon.
The following values must be present in the request, but the format of the request will vary: sec = new, name = name, description = description, plugins = plugins, doc_type = type, pattern = pattern, example = example, addon = addon and dev_key = developer key.


Example
{
	"status":"success",
	"code":"200",
	"message":"documentation created",
	"data": 
	{
			"id":"21",
	}
}

Delete Documentation

The delete documentation section of the Skript API allows addon developers to remove documentation from their Skript addon.
The following values must be present in the request, but the format of the request will vary: sec = delete, id = documentation id and dev_key = developer key.


Example
{
	"status":"success",
	"code":"200",
	"message":"documentation removed"
}

Generate Documentation

The generate documentation section of the Skript API allows addon developers to generate mass amounts of documentation from a single file.
The following values must be present in the request, but the format of the request will vary: sec = gen, addon = addon, file = JSON documentation file, purge = boolean and dev_key = developer key.


Example
{
	"status":"success",
	"code":"200",
	"message":"documentation generated"
}