-
Notifications
You must be signed in to change notification settings - Fork 5
/
apiary.apib
104 lines (75 loc) · 2.48 KB
/
apiary.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
FORMAT: 1A
HOST: https://bethro.alwaysdata.net/api/v1
# suplike
# Welcome to the suplike API documentation
simply work with suplike social website.
the API allows you to connect and use some off the suplike features such as;
* signup
* login
* posting
* fetching post
* search
* chat
* like
* follow
if a feature isn't there, it is still being added.
## User sign up [/signup]
create a new account on suplike.
the account must have `username`,`email` and `password`.
### Signup a new user [POST]
+ Request (application/json)
{
"uid": "username",
"mail": "email",
"mail": "password",
}
+ Response 200 (application/json)
[
]
## User Login [/login]
this enebles you to login to suplike using an existing account.
Please note that you are required to store the information and use it to send later requests.
### Login to an existing account [POST]
+ Request (application/json)
{
"usermail": "username", // can also be email
"userpass": "password" // the users password
}
+ Response 201 (application/json)
+ Headers
Location: /login
+ Body
{
"username": "test",
"profile_picture": "http://localhost/suplike/img/download.jpg",
"full_name": "fname lname",
"user_token": "fb787eb1d2a7b234866b912b8e14191260b8f3e5fb2dc6ea53a53104ee",
"chat_key": "3e1630d6e3e"
}
## User Posts [/post]
this is for getting all the post from the user and the people the user follows.
you will be needed to send `user_token` as a parameter in the url.
### This is for getting posts [GET]
+ Request (application/json)
{
"user_key": "/user_token/", //this is the token from login
}
+ Response 201 (application/json)
+ Headers
Location: /post
+ Body
{
"id": "172",
"post_id": "a4479fb9",
"image": "1089.png",
"image_text": "still at school and this is the only image on the computer",
"userid": "5",
"type": "img",
"repost": "a421d86b",
"date_posted": "20 Mar",
"post_likes": "1",
"day": "Sunday",
"time": "2022-03-20 12:39:53",
"user": true,
"liked": true
}