-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTechnical Specifications - Backend.txt
92 lines (68 loc) · 2.14 KB
/
Technical Specifications - Backend.txt
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
Technical Specification - Backend
=========
### Technology Stack
- Node.js fileserver/api server
- Express middleware/request routing
- MongoDB for Database
- ElasticSearch for Analytics (stretch goal)
### API
(API Design Guidelines were found [at Vinay Sahni's blog.](http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api))
The API will be versioned via URL.
Requests should be made to:
/api/v0/[endpoint]
## API Version V0 Endpoints
### Post /requests
**Send**: Json request object with the following structure:
> {
> requestingTeamName: string
> requestingTeamID: number
> location: string
> topic: string
> description: string
> blockingProblem: string
> }
**Receive**: HTTP 201 Created status code, with Location header that points to the url of the new request (/requests/requestid).
### Get /requests
**Send**: Get request
**Receive**: Last 20 request id's in JSON format:
> { requests:
> [id1, id2, id3...id20]
> }
### Get /requests/:id
**Send**: Get request
**Receive**: 200 OK, and Last 20 requests, Json response with the following structure:
> {
> requestingTeamName: string
> requestingTeamID: number
> location: string
> topic: string
> description: string
> blockingProblem: string
> }
### Patch /requests/:id
**Send**: Json requests with the any of the following fields:
> {
> requestingTeamName: string
> requestingTeamID: number
> location: string
> topic: string
> description: string
> blockingProblem: string
> }
**Receive**: 200 OK
### Post /logging
**Send**: Json requests with the following structure:
> {
> time: string in UTC format
> sessionID: string (unused currently)
> message: string
> }
**Receive**: 200 OK. No redirect URL
### Post /feedback
**Send**: Json requests with the following structure:
> {
> time: string in UTC format
> score: number (1<= number <=10)
> message: string
> }
**Receive**: 200 OK. No redirect URL