- Have .net framework 4.7.1 installed
- Have installed iis with asp net features
- Create a website pointing to the project folders
- Create database and configure connection string to point to that db.
- Create a user with role "Admin"
- Compile code
- Run :)
All API requests require the use of a generated API key using a header called x-auth-token
. You can generate your new api key using the login endpoint.
POST /api/login
Parameter | Type | Description |
---|---|---|
username |
string |
Required. Username of the user that is going to log in |
password |
string |
Required. Password of the user that is going to log in. |
{
"username" : "admin",
"password" : "123456"
}
{
"token": "499eedc1-8e42-44b1-9e69-83139abd12d6"
}
TeLoArreglo returns the following status codes in this endpoint:
Status Code | Type | Description |
---|---|---|
200 | OK |
Ok |
404 | NOT FOUND |
Incorrect username or password |
500 | INTERNAL SERVER ERROR |
Unexpected error (probably DB related) |
Incorrect username or password.
It doesn't need any body content, you just need to have the header x-auth-token: API_KEY
that the login returned.
POST /api/logout
{
"token": "499eedc1-8e42-44b1-9e69-83139abd12d6"
}
TeLoArreglo returns the following status codes in this endpoint:
Status Code | Type | Description |
---|---|---|
200 | OK |
Ok |
400 | BAD REQUEST |
Api key not found in header |
401 | UNAUTHORIZED |
Not logged in |
500 | INTERNAL SERVER ERROR |
Unexpected error (probably DB related) |
This endpoint was created for both purposes. The only difference is that you need to have the header x-auth-token: API_KEY
that the login returned and your user an Admin
role if you want to create an user with a complex role (Admin
or Crew
). If this is not the case, the API will automatically create the new user with the User
role instead of the one specified in the request.
POST /api/users
Parameter | Type | Description |
---|---|---|
username |
string |
Required. Username of the user that is going to be created |
password |
string |
Required. Password of the user that is going to be created |
role |
string |
Required if role != User . Role of user that is going to be created (Admin , Crew or User ) |
{
"username": "admin",
"password": "123456",
"role": "Admin"
}
{
"username": "admin",
"role": "Admin",
"id": 1
}
TeLoArreglo returns the following status codes in this endpoint:
Status Code | Type | Description |
---|---|---|
200 | OK |
Ok |
400 | BAD REQUEST |
Api key not found in header |
401 | UNAUTHORIZED |
Not logged in |
403 | FORBIDDEN |
Insufficient privileges |
500 | INTERNAL SERVER ERROR |
Unexpected error (probably DB related) |
You need to have the header x-auth-token: API_KEY
that the login returned.
GET /api/actions
[0,1,2]
TeLoArreglo returns the following status codes in this endpoint:
Status Code | Type | Description |
---|---|---|
200 | OK |
Ok |
400 | BAD REQUEST |
Api key not found in header |
401 | UNAUTHORIZED |
Not logged in |
500 | INTERNAL SERVER ERROR |
Unexpected error (probably DB related) |