Skip to content

Commit 3cb6dd8

Browse files
authored
Update README.md
1 parent 7a7fed9 commit 3cb6dd8

File tree

1 file changed

+106
-1
lines changed

1 file changed

+106
-1
lines changed

README.md

Lines changed: 106 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ Following are the features of this project:
4444
<br>
4545

4646
## You can find the complete API documentation [here](https://documenter.getpostman.com/view/1552895/SzYUZg52?version=latest)
47-
<a href="https://documenter.getpostman.com/view/1552895/SzYUZg52?version=latest" target="_blank"><img src="https://raw.githubusercontent.com/afteracademy/nodejs-backend-architecture-typescript/master/addons/github_assets/api-doc-button.png" width="200" height="60"/></a>
47+
<a href="https://documenter.getpostman.com/view/1552895/SzYUZg52?version=latest" target="_blank">
48+
<img src="https://raw.githubusercontent.com/afteracademy/nodejs-backend-architecture-typescript/master/addons/github_assets/api-doc-button.png" width="200" height="60"/>
49+
</a>
4850

4951
## How to build and run this project
5052

@@ -73,4 +75,107 @@ Following are the features of this project:
7375
* Execute `npm start` and You will be able to access the api from http://localhost:3000
7476
* To run the tests execute `npm test`.
7577

78+
## API Examples
79+
* Signup
80+
* Method and Headers
81+
```
82+
POST /v1/signup/basic HTTP/1.1
83+
Host: localhost:3000
84+
x-api-key: GCMUDiuY5a7WvyUNt9n3QztToSHzK7Uj
85+
Content-Type: application/json
86+
```
87+
* Request Body
88+
```json
89+
{
90+
"name" : "Janishar Ali",
91+
"email": "[email protected]",
92+
"password": "changeit",
93+
"profilePicUrl": "https://avatars1.githubusercontent.com/u/11065002?s=460&u=1e8e42bda7e6f579a2b216767b2ed986619bbf78&v=4"
94+
}
95+
```
96+
* Response Body: 200
97+
```json
98+
{
99+
"statusCode": "10000",
100+
"message": "Signup Successful",
101+
"data": {
102+
"user": {
103+
"_id": "5e7c9d32307a223bb8a4b12b",
104+
"name": "Janishar Ali",
105+
"email": "[email protected]",
106+
"roles": [
107+
"5e7b8acad7aded2407e078d7"
108+
],
109+
"profilePicUrl": "https://avatars1.githubusercontent.com/u/11065002?s=460&u=1e8e42bda7e6f579a2b216767b2ed986619bbf78&v=4"
110+
},
111+
"tokens": {
112+
"accessToken": "some_token",
113+
"refreshToken": "some_token"
114+
}
115+
}
116+
}
117+
```
118+
* Response Body: 400
119+
```json
120+
{
121+
"statusCode": "10001",
122+
"message": "Bad Parameters"
123+
}
124+
```
125+
* Profile Private
126+
* Method and Headers
127+
```
128+
GET /v1/profile/my HTTP/1.1
129+
Host: localhost:3000
130+
x-api-key: GCMUDiuY5a7WvyUNt9n3QztToSHzK7Uj
131+
Content-Type: application/json
132+
x-access-token: your_token_received_from_signup_or_login
133+
x-user-id: your_user_id
134+
```
135+
* Response Body: 200
136+
```json
137+
{
138+
"statusCode": "10000",
139+
"message": "success",
140+
"data": {
141+
"name": "Janishar Ali Anwar",
142+
"profilePicUrl": "https://avatars1.githubusercontent.com/u/11065002?s=460&u=1e8e42bda7e6f579a2b216767b2ed986619bbf78&v=4",
143+
"roles": [
144+
{
145+
"_id": "5e7b8acad7aded2407e078d7",
146+
"code": "LEARNER"
147+
},
148+
{
149+
"_id": "5e7b8c22d347fc2407c564a6",
150+
"code": "WRITER"
151+
},
152+
{
153+
"_id": "5e7b8c2ad347fc2407c564a7",
154+
"code": "EDITOR"
155+
}
156+
]
157+
}
158+
}
159+
```
160+
161+
### Find this project useful ? :heart:
162+
* Support it by clicking the :star: button on the upper right of this page. :v:
163+
164+
### License
165+
```
166+
Copyright (C) 2020 MINDORKS NEXTGEN PRIVATE LIMITED
167+
168+
Licensed under the Apache License, Version 2.0 (the "License");
169+
you may not use this file except in compliance with the License.
170+
You may obtain a copy of the License at
171+
172+
http://www.apache.org/licenses/LICENSE-2.0
173+
174+
Unless required by applicable law or agreed to in writing, software
175+
distributed under the License is distributed on an "AS IS" BASIS,
176+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
177+
See the License for the specific language governing permissions and
178+
limitations under the License.
179+
```
180+
76181

0 commit comments

Comments
 (0)