DEVELOPMENT
DOCUMENTATION

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

Basic Information


Input

Instead of using POST, GET, PUT, and DELETE requests, the following API uses only POST and JSON requests. Because of this, every request must have a "sec" header or parameter to define what portion of the API is being called. Along with this, all results are encoded using JSON. All requests should be sent to https://theartex.net/cloud/api.

Output

As stated above, every response (result) will be encoded using JSON. Each response will ALWAYS include status, code, and message data. These pieces of data will be treated as variables.

In the occurrence of any error, the status variable will return "error," the code variable will return an error code in the form of an integer, and the message variable will return a simple explanation of the error.

If a request were to go through successfully, the status variable will return "success," the code variable will return "0," and the message variable will return an explanation of the resulting data. On a successful request, a data variable will (almost always) also be present. This variable will contain all information regarding your request, such as a list of announcements or user data.

Error Example
{
	"status":"error",
	"code":"403",
	"message":"incorrect username or password"
}
Success Example
{
	"status":"success",
	"code":"0",
	"message":"user found",
	"data": 
	{
		"id":"10099",
		"username":"Example",
		"role":"User",
		"email":"[email protected]",
		"banned":"no",
		"active":"yes",
		"key":"NNeEPPqgiYlqITPcIagF",
		"val":"f830f69d23b8224b512a0dc2f5aec974"
	}
}

Useful Links

  • A Java hook for the developer API by AL_1: GitHub

Documentation Examples


User API

Authentication

The authentication section of the user API allows you to verify and log in users.
The following post fields must be present in the POST request to use this portion of the API: sec = "login," username = "username" and password = "password." If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "incorrect username or password" or "malformed data," meaning the user was either not found or you didn't send the correct post fields in your POST request. If you receive a successful response, the output should look similar to the following example.


Example
{
	"status":"success",
	"code":"0",
	"message":"user found",
	"data": 
	{
		"id":"10099",
		"username":"Example",
		"role":"User",
		"email":"[email protected]",
		"banned":"no",
		"active":"yes",
		"key":"NNeEPPqgiYlqITPcIagF",
		"val":"f830f69d23b8224b512a0dc2f5aec974"
	}
}

Session

The session section of the user API allows you to update the status of a user.
The following post fields must be present in the POST request to use this portion of the API: sec = "session," page = "application://current location," ip = "ip address" and key = "user key." If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "invalid key" or "malformed data," meaning the user was either not found or you didn't send the correct post fields in your POST request. If you receive a successful response, the output should look similar to the following example.


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

New Alert

The new alert section of the user API allows you to send an alert to a user.
The following post fields must be present in the POST request to use this portion of the API: sec = "alert," title = "application," message = "alert" and key = "user key". If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "invalid key" or "malformed data," meaning the user was either not found or you didn't send the correct post fields in your POST request. If you receive a successful response, the output should look similar to the following example.


Example
{
	"status":"success",
	"code":"0",
	"message":"user alerted",
	"data":
	{
		"id":"448"
	}
}

List Alerts

The list alerts section of the user API allows you to view the alerts of a user.
The following post fields must be present in the POST request to use this portion of the API: sec = "alerts" and key = "user key". If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "invalid key" or "malformed data," meaning the user was either not found or you didn't send the correct post fields in your POST request. If you receive a successful response, the output should look similar to the following example.


Example
{
	"status":"success",
	"code":"0",
	"message":"alerts listed",
	"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 user alerts as read, meaning they are no longer new.
The following post fields must be present in the POST request to use this portion of the API: sec = "read," id = "alert id" and key = "user key". If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "invalid key" or "malformed data," meaning the user was either not found or you didn't send the correct post fields in your POST request. If you receive a successful response, the output should look similar to the following example.


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

Information API

Announcements

The announcements section of the user API allows you to grab a list of announcements.
The following post fields must be present in the POST request to use this portion of the API: sec = "announcements." If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "malformed data," meaning you didn't send the correct post field in your POST request. If you receive a successful response, the output should look similar to the following example.


Example
{
	"status":"success",
	"code":"0",
	"message":"user found",
	"data": 
	[
		{
			"id":"10098",
			"message":"This is an announcement.",
			"trn-date":"2017-04-28 04:16:10"
		},
		{
			"id":"10099",
			"message":"This is also an announcement.",
			"trn-date":"2017-04-28 04:16:10"
		},
		...
	]
}

Minecraft API

Unlike other portions of the developer API, you must send your requests for Minecraft sections via https://theartex.net/cloud/api/minecraft using a GET, POST, or JSON request. Along with this, all requests are cached for five minutes, so some responses may not be exact. If you would like to receive a plain text result instead of a JSON response, add a response parameter with the value of "text."

Username

The username section of the Minecraft API allows you to get the username of a Minecraft player from their UUID.
The following parameters must be present in the request to use this portion of the API: sec = "username" and uuid = "uuid." If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "malformed data," meaning you didn't send the correct post field in your POST request. If you receive a successful response, the output should look similar to the following example.


Example
{
	"status":"success",
	"code":"0",
	"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 parameters must be present in the request to use this portion of the API: sec = "username" and username = "username." If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "malformed data," meaning you didn't send the correct post field in your POST request. If you receive a successful response, the output should look similar to the following example.


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

Name History

The name history section of the Minecraft API allows you to get the past and current usernames of a player from their UUID.
The following parameters must be present in the request to use this portion of the API: sec = "history" and uuid = "uuid." If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "malformed data," meaning you didn't send the correct post field in your POST request. If you receive a successful response, the output should look similar to the following example.


Example
{
	"status":"success",
	"code":"0",
	"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 paste.
The following parameters must be present in the request to use this portion of the API: sec = "paste" and id = "paste." If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "malformed data," meaning you didn't send the correct post field in your POST request. If you receive a successful response, the output should look similar to the following example.


Example
{
	"status":"success",
	"code":"0",
	"message":"paste found",
	"data": 
	{
		"name":"Public API",
		"paste":"12iU3uRH8G",
		"username":"---",
		"url":"https://c.theartex.net/12iU3uRH8G",
		"trn_date":"2017-04-28 04:16:10",
	}
}

List Pastes

The list pastes section of the Codity API allows you to get a list of all pastes a user has created.
The following parameters must be present in the request to use this portion of the API: sec = "pastes" and username = "username." If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "malformed data," meaning you didn't send the correct post field in your POST request. If you receive a successful response, the output should look similar to the following example.


Example
{
	"status":"success",
	"code":"0",
	"message":"pastes listed",
	"data": 
	[
		{
			"name":"Public API",
			"paste":"12iU3uRH8G",
			"url":"https://c.theartex.net/12iU3uRH8G",
			"trn_date":"2017-04-28 04:16:10",
		},
		{
			"name":"---",
			"paste":"23r9ufnWE3",
			"url":"https://c.theartex.net/23r9ufnWE3",
			"trn_date":"2017-04-28 04:16:10",
		}
		...
	]
}

MH-DNS API

Record

The record section of the MH-DNS API allows you to gather information on a record.
The following parameters must be present in the request to use this portion of the API: sec = "record" and id = "record." If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "malformed data," meaning you didn't send the correct post field in your POST request. If you receive a successful response, the output should look similar to the following example.


Example
{
	"status":"success",
	"code":"0",
	"message":"record found",
	"data": 
	{
		"name":"test",
		"domain":"mh-dns.us",
		"username":"mathhulk",
		"trn_date":"2017-04-28 04:16:10",
	}
}

List Records

The list records section of the MH-DNS API allows you to get a list of all records a user has created.
The following parameters must be present in the request to use this portion of the API: sec = "records" and username = "username." If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "malformed data," meaning you didn't send the correct post field in your POST request. If you receive a successful response, the output should look similar to the following example.


Example
{
	"status":"success",
	"code":"0",
	"message":"records listed",
	"data": 
	[
		{
			"name":"test",
			"domain":"mh-dns.us",
			"trn_date":"2017-04-28 04:16:10",
		},
		{
			"name":"test",
			"paste":"mineserver.rocks",
			"trn_date":"2017-04-28 04:16:10",
		}
		...
	]
}

Skript API

Unlike other portions of the developer API, you must send your requests for Skript sections via https://theartex.net/cloud/api/skript using a GET, POST, or JSON request.

Addon

The addon section of the Skript API allows you to gather information on an addon.
The following parameters must be present in the request to use this portion of the API: sec = "addon" and name = "addon." If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "malformed data," meaning you didn't send the correct post field in your POST request. If you receive a successful response, the output should look similar to the following example.


Example
{
	"status":"success",
	"code":"0",
	"message":"addon found",
	"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 all addons and information for each one.
The following parameters must be present in the request to use this portion of the API: sec = "addons." If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "malformed data," meaning you didn't send the correct post field in your POST request. If you receive a successful response, the output should look similar to the following example.


Example
{
	"status":"success",
	"code":"0",
	"message":"addons listed",
	"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 all documentation for an addon.
The following parameters must be present in the request to use this portion of the API: sec = "docs" and name = "addon." If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "malformed data," meaning you didn't send the correct post field in your POST request. If you receive a successful response, the output should look similar to the following example.


Example
{
	"status":"success",
	"code":"0",
	"message":"docs listed",
	"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 all examples for the specified documentation.
The following parameters must be present in the request to use this portion of the API: sec = "examples" and id = "id." If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "malformed data," meaning you didn't send the correct post field in your POST request. If you receive a successful response, the output should look similar to the following example.


Example
{
	"status":"success",
	"code":"0",
	"message":"docs listed",
	"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 all documentation that match a specific query.
The following parameters must be present in the request to use this portion of the API: sec = "search" and search = "query." If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "malformed data," meaning you didn't send the correct post field in your POST request. If you receive a successful response, the output should look similar to the following example.


Example
{
	"status":"success",
	"code":"0",
	"message":"results listed",
	"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 addon.
The following parameters must be present in the request to use this portion of the API: sec = "new," name = "name," description = "description," plugins = "plugins," type = "type," pattern = "pattern," example = "example," addon = "addon" and key = "developer key." If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "malformed data," meaning you didn't send the correct post field in your POST request. If you receive a successful response, the output should look similar to the following example.


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

Delete Documentation

The delete documentation section of the Skript API allows addon developers to remove documentation from their addon.
The following parameters must be present in the request to use this portion of the API: sec = "delete," id = "documentation id" and key = "developer key." If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "malformed data," meaning you didn't send the correct post field in your POST request. If you receive a successful response, the output should look similar to the following example.


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

Generate Documentation

The generate documentation section of the Skript API allows addon developers to generate mass amounts of documentation at a single time.
The following parameters must be present in the request to use this portion of the API: sec = "gen," addon = "addon," file = `JSON documentation file,` purge = "boolean" and key = "developer key." If you encounter an error or do not receive the result you are looking for, be sure to check the message variable in the result. The message variable for an error will most likely be "malformed data," meaning you didn't send the correct post field in your POST request. If you receive a successful response, the output should look similar to the following example.


Example
{
	"status":"success",
	"code":"0",
	"message":"file loaded"
}