/support-tool-api

REST API for a support tool

Primary LanguagePHPMIT LicenseMIT

support-tool-api

This api is the wrapper for the database. Requests are being made to this endpoint in order to prevent direct requests to the database.

Requirements:

  • PHP (7.0 or above)
  • MySQL database with demo data (demo data is not included).
  • Optional: Apache 2

Examples

These examples might help you requesting the api with your demo data.

Requesting users

Users are all users. This means customers, support employees, and administrators.

You will receive the following attributes when requesting a user:

  • email: string
  • firstname: string
  • lastname: string
  • role: int
Request user by authkey

URL: here

Returns:

[
    {
        "email": "mueller@mail.xyz",
        "firstname": "Thomas",
        "lastname": "Müller",
        "role": "1"
    }
]
Request user by id

URL: here

Returns:

[
    {
        "email": "philipp.schwaighofer@sbg.at",
        "firstname": "Philipp",
        "lastname": "Schwaighofer",
        "role": "2"
    }
]
Request other users without access

URL: here

Returns:

{
    "error": "You do not have permission to request that data!"
}
Request without a valid authkey

URL: here

Returns:

{
    "error": "Invalid or unknown authkey!"
}

Request roles

Request all roles

URL: here

Returns:

[
    {
        "id": "1",
        "name": "Kunde"
    },
    {
        "id": "2",
        "name": "Supportmitarbeiter"
    },
    {
        "id": "3",
        "name": "Administrator"
    }
]