-
Add Accept: application/json in headers in all requests
-
Add Authorization: Bearer {token} in headers in requests requires Authentication
Example: Bearer 2|8uPfGUbEQIrVYrht0ag72AgueiTceq54EThxtybB
| Model | EndPoints | Requires Authentication |
|---|---|---|
| Authentication | Login, Register | no |
| Profile | Show, Update | yes |
| Friend Request | Friend Requests, Send, Accept, Remove | yes |
| Post | Index, Create, Update, Show,Delete | yes |
| Like | Like | yes |
| Comment | Comment | yes |
| User | All Users, Single User | yes |
| Post Comments | Show All Post Comments | yes |
Create Account
-
URL
-
Method
POST -
Requires
name=[name],email=[email],password=[password] -
Return
token -
Note
Save Token and Send in headers with Authorization = Bearer {saved token}
Login With Registed Account
-
URL
-
Method
POST -
Requires
email=[email],password=[password] -
Return
token -
Note
Save Token and Send in headers with Authorization = Bearer {saved token}
Showing Authenicated User Data
-
URL
-
Method
GET -
Return
data
Login With Registed Account
-
URL
-
Method
POST -
Requires
name=[string],email=[email] -
Nullable
password=[password],avatar=[image] -
Return
data
All Users That Sent Friend Request to You
-
URL
https://social-app-laravel.herokuapp.com/api/friend/requests
-
Method
GET -
Return
data
Send Friend Request To Another User
-
URL
-
Method
POST -
Requires
friend_id=[number] -
Return
message -
Note
friend_id is user id that you want to send friend request to him
Accept Friend Request
-
URL
-
Method
POST -
Requires
friend_id=[number] -
Return
message -
Note
friend_id is user id u did sent friend request to him
Remove Friend Request (Unfriended)
-
URL
-
Method
DELETE -
Requires
friend_id=[number] -
Return
message -
Note
friend_id is user id that you want to remove from your friends
Show All Posts
-
URL
-
Method
GET -
Return
data
Create Post With Authenticated User
-
URL
-
Method
POST -
Requires
body=[text]OrImage=[file:png,jpg] -
Return
data -
Note
To Create Post You Need To Send body or Image
Update Post With Authenticated User
-
URL
-
Method
PATCH -
Requires
body=[text]OrImage=[file:png,jpg] -
Return
data -
Note
To Update Post You Need To Send body or Image
Show Single Post
-
URL
https://social-app-laravel.herokuapp.com/api/posts/{post_id}
-
Method
GET -
Return
data
Show Single Post
-
URL
https://social-app-laravel.herokuapp.com/api/posts/{post_id}
-
Method
DELETE -
Return
data
Add Like To Post
-
URL
-
Method
POST -
Requires
post_id=[number] -
Return
data -
Note
If You add Like to specific post and this has like from this user like will be removed from this post
Add Comment To Post
-
URL
-
Method
POST -
Requires
post_id=[number],body=[text] -
Return
data
-
URL
-
Method
GET -
Return
data
-
URL
https://social-app-laravel.herokuapp.com/api/users/{user_id}
-
Method
GET -
Return
data
-
URL
https://social-app-laravel.herokuapp.com/api/posts/{post_id}/comments
-
Method
GET -
Return
data