Skip to content
This repository was archived by the owner on Jan 1, 2021. It is now read-only.

Commit e1b0904

Browse files
authored
Update brainstorming.md
1 parent cb1b724 commit e1b0904

1 file changed

Lines changed: 45 additions & 1 deletion

File tree

mappings/brainstorming.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
### POST /mappings/add
4747

48-
Add new Mapping
48+
Add new Mapping. If mapping already exists (determined via clean_title) it is "upvoted".
4949

5050
#### Params
5151
| name | type |
@@ -66,6 +66,7 @@ Add new Mapping
6666

6767
```
6868
{
69+
"id" : 1,
6970
"type" : "title",
7071
"tmdbid" : 11,
7172
"imdbid" : "tt0000011",
@@ -77,6 +78,7 @@ Add new Mapping
7778

7879
```
7980
{
81+
"id" : 2,
8082
"type" : "year",
8183
"tmdbid" : 11,
8284
"imdbid" : "tt0000011",
@@ -86,6 +88,48 @@ Add new Mapping
8688
}
8789
```
8890

91+
### PUT /mappings/vote
92+
93+
"Vote" on existing mapping
94+
95+
#### Params
96+
| name | type |
97+
|--------|----------|
98+
| id | int |
99+
| direction | int (either 1 or -1, default 1)|
100+
101+
#### Sample Request
102+
103+
`PUT /mappings/vote?id=1&direction=1`
104+
105+
`PUT /mappings/vote?id=2&direction=-1`
106+
107+
#### Sample Response
108+
109+
```
110+
{
111+
"id" : 1,
112+
"type" : "title",
113+
"tmdbid" : 11,
114+
"imdbid" : "tt0000011",
115+
"aka_title" : "Star Wars",
116+
"report_count" : 2,
117+
"total_reports" : 2
118+
}
119+
```
120+
121+
```
122+
{
123+
"id" : 2,
124+
"type" : "year",
125+
"tmdbid" : 11,
126+
"imdbid" : "tt0000011",
127+
"aka_year" : 1978,
128+
"report_count" : 0,
129+
"total_reports" : 2
130+
}
131+
```
132+
89133
### GET /mappings/get
90134

91135
Retrieve mappings for movie

0 commit comments

Comments
 (0)