The Visuly API is structured in multiple departments:
-
feed
-
post
-
status
-
user
1. Index
-
feed
-
post
2. User
The user part of the API gives information about one or multiple users in the System.
2.1. Email used
API Path |
./API/user/email-used.php |
Request |
POST |
needs database |
true |
2.1.1. Input
-
Takes a JSON in the body of the post header:
{
"email" : "<EMAIL>"
}
2.1.2. Output
Default output
The default output is the following json:
{
"exists" : "<.>"
}
| 1 | boolean: true if used, false otherwise |
Errors
If the Database is not available or the request fails, the Server will respond with:
Internal Server error (<ERRORCODE>)
2.2. logout
API Path |
./API/user/logout.php |
Request |
GET |
needs database |
false |
Deletes the cookie for the login.
2.2.1. Input
-
login Cookie
2.2.2. Output
Default output
-
The server will unset the cookie from the client.
-
Response with a following json, no matter what
{
"response" : true
}
2.3. username-exists
API Path |
./API/user/username-exists.php |
Request |
POST |
needs database |
true |
2.3.1. Input
-
Takes a JSON in the body of the post header:
{
"username" : "<USERNAME>"
}
2.3.2. Output
Default output
If everything goes correctly, the Server will respond with the following json:
{
"exists" : "<.>"
}
| 1 | Response value |
The response value is either true or false.
the response is true, if the username does exist, false otherwise
Errors
If the input is unexpected, the Server will respond with the following message:
{
"error" : "Invalid Request"
}
if the Database connection fails, the Server will respond with the default database connection error, the same goes for the a failed request to the datbase.
The Server could also respond with the default php error.