githubEdit

hammer-brushCedMod Api

The CedMod Api integration provides easy interaction and data handling of the api of https://cedmod.nl/arrow-up-right

Usage

All functions for the CedMod Api are located in the io.github.vxrpenter.cedmod.Cedmod class, and can easily imported with one line:

import io.github.vxrpenter.cedmod.Cedmod

The Cedmodarrow-up-right class has to be supplied with the servers api-key and it's instance-url before making any requests. This is a short representation of correct Cedmodarrow-up-right invocation:

import io.github.vxrpenter.cedmod.Cedmod

val api = "API_KEY"
val instanceUrl = "https://myservername.cmod.app"

val cedmod = Cedmod(api, instanceUrl)

Exceptions

All functions that are contained in the Cedmodarrow-up-right class throw a CallFailureExceptionarrow-up-right inherited from a CedmodExceptionarrow-up-right when a call to the api fails for any reason. You can could catch it like this:

try {
  val cedmod = Cedmod(api, instanceUrl).changelogGet()
} catch (e: Exception) {
  println("An error has occured during an cedmod api call")
  return
}

Examples

Issuing a ban for a user, using the CedMod Api. This returns a status code of the interaction

Fetching a player and their stats using the CedMod Api. This returns a Playerarrow-up-right object

Last updated