Last active
November 17, 2017 09:20
-
-
Save ivinstar/d78c534d08de6e6dee13f5a83df06abe to your computer and use it in GitHub Desktop.
s4f rest api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. User | |
- GET /api/users.json - get all users list | |
- POST /api/users.json - user registration with Firebase sync | |
data format | |
{ | |
user: { | |
email: '', | |
password: '', | |
fullname: '', | |
sex: 'F|M', | |
country_id: '', | |
zipcode: '', | |
username: '', | |
birth_date: '' | |
} | |
} | |
- GET /api/users/{:user_id}/avatars.json - get avatar link | |
- POST /api/users/{:user_id}/avatars.json - upload avatar with Firebase sync | |
data format | |
{ | |
user: { | |
avatar: (encoded image in base64) | |
} | |
} | |
- GET /api/users/{:user_id}.json - get user information by id | |
- PUT /api/users/{:user_id}.json - update user information with Firebase sync | |
data format same as POST | |
2. Auth | |
- POST /api/sessions.json - auth via login/password with Firebase sync | |
data format | |
{ | |
user: { | |
email: '', | |
password: '' | |
} | |
} | |
- DELETE /api/sessions/{:user_id}.json - logout | |
3. Facebook | |
- /api/omniauth_callbacks/facebook.json | |
{ | |
email: '', | |
name: '', | |
id: '', | |
accessToken: '' | |
} | |
4. Password recover | |
- POST /api/passwords.json - request on password recovering | |
data format | |
{ | |
user: { | |
email: '' | |
} | |
} | |
5. Countries | |
- GET /api/countries.json - get all countries list | |
6. Challenges | |
- POST, PUT - realized as callback functions on backend side | |
7. User challenges | |
- POST /api/users/{:user_id}/challenges.json - subscribe user on challenge with Firebase sync | |
data format | |
{ | |
userchallenge: { | |
challenge_id: | |
} | |
} | |
8. User swims | |
- POST /api/users/{:user_id}/swims.json - add user swim with Firebase sync | |
data format | |
{ | |
userswim: { | |
date: | |
distance: | |
time: | |
note: | |
user_challenge_uid: (to set swim data for challenge) | |
} | |
} | |
9. Swim Types | |
- GET /api/swim_types.json - get all swim_types | |
10. Sessions | |
- POST /api/users/{:user_id}/sessions.json - add sessions with Firebase sync | |
data format | |
{ | |
userswim: { | |
session_id: | |
date: | |
distance: | |
time: | |
note: | |
user_challenge_uid: (to set swim data for challenge) | |
} | |
} | |
11. Facebook posting | |
- POST /api/sharings/facebook.json | |
data format | |
{ | |
userswim: { | |
date: | |
distance: | |
time: | |
note: | |
user_id: | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment