-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
94 lines (88 loc) · 3.62 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: Helvetica, sans-serif;
background-color: black;
color: white;
}
h1, h2 {
font-family: 'Courier New', monospace;
}
a {
color: cyan;
}
</style>
<title> API </title>
</head>
<body>
<h1><center>CRUD API</center></h1>
<h2><center>implemented on a Login and Register System</center></h2>
<br>
<h3>API End-points and Instructions</h3>
<section>
<details>
<summary> <i>POST</i> (CREATE) to <b><a href=#>https://shellcorp-api.herokuapp.com/api/register</a></b> to create an account in the form:</summary>
<p>
<blockquote>
<code>
{<br>
"username": name,<br>
"email": mail,<br>
"password": password<br>
}
</code>
</blockquote>
</p>
</details>
<br>
<details>
<summary> <i>POST</i> (READ) to <b><a href=#>https://shellcorp-api.herokuapp.com/api/login</a></b> to login to the created account and receive an AuthToken, request form:</summary>
<p>
<blockquote>
<code>
{<br>
"email": your_name,<br>
"password": your_password<br>
}
</code>
</blockquote>
</p>
<p> Copy the given AuthToken in the form: <b><i>BEARER /AUTH_TOKEN/</i></b>. This is needed for later use. </p>
</details>
<br>
<details>
<summary> <i>PUT</i> (UPDATE) to <b><a href=#>https://shellcorp-api.herokuapp.com/api/update</a></b> with the given AuthToken in the header field to change/update either the username or password of the account or both. The request body should be in the form:</summary>
<p>
<blockquote>
<code>
{<br>
"username": new_name,<br>
"password": new_password<br>
}
</code>
</blockquote>
</p>
</details>
<br>
<details>
<summary> <i>DELETE</i> Method require Admin privilege. To do that, just login on <b><a href=#>https://shellcorp-api.herokuapp.com/api/login</a></b> using the credentials: </summary>
<p>
<blockquote>
<code>
{<br>
"email": "admin@shell.com",<br>
"password": "adminhere"<br>
}
</code>
</blockquote>
<p> Use <i>DELETE</i> method on the url <b><a href=#>https://shellcorp-api.herokuapp.com/api/users/target-email</a></b> with the received admin AuthToken in the authorization field of the header. Make sure to add the complete mail address on the <b><i>target-email</i></b> field.</p>
</details>
<br>
<details>
<summary> You can also use <i>GET</i> method (ADMIN READ) to <b><a href=#>https://shellcorp-api.herokuapp.com/api/users</a></b> with the recieved admin AuthToken to access the details of every user in the database. Further, you can access single user details by specifying their email in the URL in the form: <b><a href=#>https://shellcorp-api.herokuapp.com/api/users/target-email</a><b></summary>
</details>
</section>
</body>
</html>