githubEdit

maskSecretlab Api

The SecretLab Api integration provides easy interaction and data handling with the: https://api.scpslgame.comarrow-up-right

Usage

All functions for the Secretlab Api are located in the io.github.vxrpenter.secretlab.SecretLab class, and can easily imported with one line:

import io.github.vxrpenter.secretlab.SecretLab

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

import io.github.vxrpenter.secretlab.SecretLab

val api = "API_KEY"
val accountId = "1235644644"
    
val secretLab = SecretLab(api, accountId)    

Exceptions

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

try {
  val secretLab = SecretLab(api, accountId).ip()
} catch (e: Exception) {
  println("An error has occured during an secretlab api call")
  return
}

Examples

Fetching server information through the Secretlab Api. This returns a Serverarrow-up-right object:

Last updated