You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documents/API.md
+54-1Lines changed: 54 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,53 @@
1
1
## API
2
2
3
+
This application comes with an out-of-the-box API, which will allow you to provide an API to your users or build a mobile app from your API.
4
+
5
+
### Access Data from the API
6
+
7
+
In order to access data from the API a user or an application will need to pass an Access Token to the API. This access token along with the **ROLE** of the user will determine what kind of data can be accessed or returned.
8
+
9
+
- You can request an Access Token with a **username** and a **password**
10
+
11
+
To get an Access Token from a User Login you can do a POST request to:
You'll see that this response includes additional fields **refreshToken** and **expiresAt**. When your application detects the **authenticationToken** has expired it will need you to request a new **authenticationToken** with the following API request:
|`http://localhost:8080/api/v1/auth/refresh/token`| POST |Refresh Token from login should be passed |[JSON](#refresh-token)|
33
+
34
+
35
+
##### sample refresh token request body
36
+
37
+
```json
38
+
{
39
+
"token":"1178cd43-21d2-45b4-8b5f-c79aa1d5b76e",
40
+
"username":"johndoe"
41
+
}
42
+
```
43
+
44
+
And you will recieve a new **authenticationToken** for your application to be used. This expiration and refresh tokens are common for keeping your API secure.
45
+
46
+
### Request Data with an Access Token
47
+
48
+
Now, that you have an **authenticationToken** you can request data from the application using that token. Based on the permission of the current user they will be able to CREATE, READ, UPDATE, and DELETE content in your application.
49
+
50
+
3
51
### API Rate Limiting
4
52
5
53
| Tier | API Request Cap | API Key Prefix |
@@ -24,7 +72,6 @@ If the application remains inactive for a specified period of time, the session
24
72
25
73
This value **server.servlet.session.timeout** can be configured in **application.properties** file
26
74
27
-
28
75
## Explore Rest APIs
29
76
30
77
The app defines following CRUD APIs. **If localhost doesn't work, use 192.168.99.102**
@@ -35,6 +82,11 @@ Since the SSL certificate is self signed, turn off the **SSL certificate verific
0 commit comments