LuaShield Documentation
  • What is LuaShield?
  • API Documentation
    • Projects
      • User Management
      • Script Management
Powered by GitBook
On this page
  • Making Requests
  • Handling Errors
  • Quick Example

API Documentation

Making Requests

All requests must have a content type of application/json

All requests must include your API key as the header LuaShield-API-Key

We have a ratelimit of 60 requests per minute, however this can change depending on the endpoint

Handling Errors

When an error occurs we will return a status code of 4xx/5xx and return a JSON object with an error

{
    "error": "LuaShield > all???"
}

All of our error messages are user friendly

Quick Example

If you provide a valid API key this will output your account information

We didn't have to set our content type in this example as we aren't sending any data

const fetch = require("node-fetch");
const LUASHIELD_API_KEY = "";

async function GetAccountInformation() {
    return new Promise(async (resolve, reject) => {
        let Response = await fetch("https://api.luashield.com/account", {
            method: "GET",
            headers: { 
                ["LuaShield-API-Key"]: LUASHIELD_API_KEY
            }
        })
        .then(res => res.json())
        .catch(er => reject(er.toString()))

        if (Response?.error) {
            reject(Response.error);
        }

        resolve(Response);
    });
}

(async () => {
    let AccountInformation = await GetAccountInformation()
    .catch(er => console.log(er)); 

    console.log(AccountInformation)
})();
PreviousWhat is LuaShield?NextProjects

Last updated 2 years ago