API for spectacle !
First you have to login with your facebook account. Then you will have access to all endpoints that you might need with your id and token.
Login via Facebook. You need to send a facebook access_token and your facebook user id.
{
"profile_id": "your facebook id",
"access_token": "your facebook access token"
}
200 -> Everything is great
{
"id": "your spectacle user id",
"token": "your spectacle access token"
}
All your authentificated request need to send the id as user and token as password via HTTP Basic Auth.
400 -> Bad request
{
"message": "Why your request isn't good"
}
Get user information
200 -> Everything is great
{
"last_name": "user last name",
"first_name": "user first name",
"gender": "user gender",
"email": "user email",
"favorites": [
"user favorites"
]
}
401 -> Need authentication
Delete server side authentification token
200 -> Everything is great
401 -> Need authentication
Delete user account
Get user params
200 -> Everything is great
[
{
"key": "name_of_the_key",
"value": "value_of_the_key"
}
]
401 -> Need authentication
Add and get user params
All POST variables sent to this endpoint will be saved as user parameters.
200 -> Everything is great
[
{
"key": "name_of_the_key",
"value": "value_of_the_key"
}
]
401 -> Need authentication
Retrieve all user favorite
200 -> Everything is great
[
{
"_id": "show id",
"data": "JSON in string format of the show"
}
]
401 -> Need authentication
Add a show in the favorite user's list
You need to send the JSON of the show. Whatever you send, you will get it back with "GET / user/favorites". You must provide an id within that JSON.
{
"data": {
"id": 123,
"whatever": "whatever",
"etc": "etc"
}
}
200 -> Everything is great
{
"message": "ok"
}
400 -> Bad request : No "data" in http request or no data.id or bad formatted JSON.
{
"message": "message with error explained"
}
401 -> Need authentication
Remove the show given in url parameters
200 -> Everything is great
{
"message": "ok"
}
401 -> Need authentication
Retrieve all user device id
200 -> Everything is great
[
"device_id",
"etc"
]
401 -> Need authentication
Register device for push notification
You need send the device ID for Google Cloud Messaging
{
"device": "id device"
}
200 -> Everything is great
{
"message": "ok"
}
400 -> Bad request : No "device" in http request
{
"message": "message with error explained"
}
401 -> Need authentication
Remove the device id given in url parameters
200 -> Everything is great
{
"message": "ok"
}
401 -> Need authentication
Incoming bro
You can post github issue if you have problem with any of this