Documentation

Sensitivity

→ High
→ Medium
→ Low
→ None

User API










Information API



Minecraft API





Codity API




MH-DNS API



Need to verify your application or manually associate with a host? Get in touch with me via Discord.

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, host 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",
	"host":"127.0.0.1",
	"message":"explanation"
}
Success Example
{
	"status":"success",
	"code":"200",
	"host":"127.0.0.1",
	"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

Unlike the rest of the API, authentication does not use a request to response method. Instead, you must send users through theartex.net to authenticate them. To do so, you must create a file to gather the user's information when they have been authenticated.

For example, if I have a website called example.com and file to authenticate users at example.com/auth/, I would send my users to theartex.net/system/login/?red=http://example.com/auth/. However, if I send users from a local application instead of a website, they will be redirected to a more application-friendly page. For example, if I have an application called Artex Development Dashboard, I would send my users to theartex.net/system/login/?red=http://localhost:8080/auth/.

Once the user has been authenticated, they will be sent back to the specified redirect URL and GET paramaters will be added to the end. These parameters contain all necessary information for accessing other sections of the API.

If my website is behind a proxy such as CloudFlare, it is likely that the user's tokens will not match upon validation. This is because the host associated with the domain and the host connecting to the API will differ. To fix this issue, it is suggested that you verify your application and associate with a host manually.

The following is an example of the GET parameters encoded in valid JSON.


Example
{
	"id":"10099",
	"token":"FgaIcPTIqlYigqPPEeNN",
	"remember":"true"
}

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, application = application name, domain or URL, ip = IPv4 address, id = user id and token = user token.


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

Validate

The validate section of the user API allows you to check if a user's token is still valid.
The following values must be present in the request, but the format of the request will vary: sec = validate, id = user id and token = user token.


Example
{
	"status":"success",
	"code":"200",
	"host":"127.0.0.1",
	"message":"user retrieved",
	"data":
	{
		"id":"10099",
		"username":"Example",
		"role":"User",
		"email":"example@email.com",
		"gravatar":"example@email.com",
		"application":"https://www.theartex.net/documentation/",
		"last_seen":"2017-08-23 15:37:01"
	}
}

ID to Username

The ID to username section of the user API allows you to convert the ID of a user to the username of that user.
The following values must be present in the request, but the format of the request will vary: sec = id and username = username.


Example
{
	"status":"success",
	"code":"200",
	"host":"127.0.0.1",
	"message":"user retrieved",
	"data":
	{
		"id":"10099",
		"name":"Example"
	}
}

Username to ID

The username to ID section of the user API allows you to convert the username of a user to the ID of that user.
The following values must be present in the request, but the format of the request will vary: sec = username and id = id.


Example
{
	"status":"success",
	"code":"200",
	"host":"127.0.0.1",
	"message":"user retrieved",
	"data":
	{
		"id":"10099",
		"name":"Example"
	}
}

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 = alert title, message = alert message, id = user id and token = user token.


Example
{
	"status":"success",
	"code":"200",
	"host":"127.0.0.1",
	"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, id = user id and token = user token.


Example
{
	"status":"success",
	"code":"200",
	"host":"127.0.0.1",
	"message":"alerts retrieved",
	"data":
	[
		{
			"id":"346",
			"title":"Profile",
			"message":"Your profile has been successfully updated.",
			"status":"new",
			"trn_date":"2017-08-23 15:37:01"
		},
		{
			"id":"345",
			"title":"API",
			"message":"Your developer and user keys have been successfully created.",
			"status":"idle",
			"trn_date":"2017-08-23 15:37:01"
		},
		{
			"id":"344",
			"title":"mathhulk.me",
			"message":"Your project, Testing, has been updated.",
			"status":"old",
			"trn_date":"2017-08-23 15:37:01"
		}
		...
	]
}

Alert Status

The alert status section of the user API allows you to update the status of an alert.
The following values must be present in the request, but the format of the request will vary: sec = status, alert = alert id, status = status type, id = user id and token = user token.


Example
{
	"status":"success",
	"code":"200",
	"host":"127.0.0.1",
	"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",
	"host":"127.0.0.1",
	"message":"announcements retrieved",
	"data": 
	[
		{
			"id":"10098",
			"message":"This is an announcement.",
			"trn-date":"2017-08-23 15:37:01"
		},
		{
			"id":"10099",
			"message":"This is also an announcement.",
			"trn-date":"2017-08-23 15:37:01"
		},
		...
	]
}

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",
	"host":"127.0.0.1",
	"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",
	"host":"127.0.0.1",
	"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",
	"host":"127.0.0.1",
	"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",
	"host":"127.0.0.1",
	"message":"paste retrieved",
	"data": 
	{
		"name":"Public API",
		"username":"---",
		"url":"https://c.theartex.net/12iU3uRH8G",
		"raw":"https://c.theartex.net/raw/12iU3uRH8G",
		"trn_date":"2017-08-23 15:37:01",
	}
}

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",
	"host":"127.0.0.1",
	"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-08-23 15:37:01",
		},
		{
			"name":"---",
			"id":"23r9ufnWE3",
			"url":"https://c.theartex.net/23r9ufnWE3",
			"raw":"https://c.theartex.net/raw/23r9ufnWE3",
			"trn_date":"2017-08-23 15:37:01",
		}
		...
	]
}

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",
	"host":"127.0.0.1",
	"message":"record retrieved",
	"data": 
	{
		"name":"test",
		"domain":"mh-dns.us",
		"username":"mathhulk",
		"ip":"127.0.0.1",
		"port":"---",
		"trn_date":"2017-08-23 15:37:01",
	}
}

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",
	"host":"127.0.0.1",
	"message":"records retrieved",
	"data": 
	[
		{
			"id":"10078",
			"name":"test",
			"domain":"mh-dns.us",
			"ip":"127.0.0.1",
			"port":"---",
			"trn_date":"2017-08-23 15:37:01",
		},
		{
			"id":"10077",
			"name":"test",
			"paste":"mineserver.rocks",
			"ip":"68.101.23.48",
			"port":"25566",
			"trn_date":"2017-08-23 15:37:01",
		}
		...
	]
}