-
Notifications
You must be signed in to change notification settings - Fork 0
/
apiary.apib
72 lines (54 loc) · 1.82 KB
/
apiary.apib
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
FORMAT: 1A
HOST: http://polls.apiblueprint.org/
# modemo
API for getting bias analysis of Facebook account and/or an article.
## Facebook Login [/login]
### Login [POST]
User should be able to log in with their Facebook account; need to decide what information is needed for frontend to process and send to backend.
+ Request (application/json)
{
"user_id": 99999,
"token": "ABCDEFG12345"
}
+ Response 200 (application/json)
[
{
"question": "Favourite programming language?",
"published_at": "2015-08-05T08:40:51.620Z",
"choices": [
{
"choice": "Swift",
"votes": 2048
}, {
"choice": "Python",
"votes": 1024
}, {
"choice": "Objective-C",
"votes": 512
}, {
"choice": "Ruby",
"votes": 256
}
]
}
]
## Non-Facebook Analysis [/analyze]
### Analyze Article [POST]
Given an article link, send to backend server for processing. Server response should be 200 with a ton of information (stats, article sentences mapped to their bias indices)
Still unsure what to do with the neutral field, statistics-wise.
+ Request (application/json)
{
"url": https://google.com
}
+ Response 200 (application/json)
+ Headers
+ Body
{
"liberal": 0.5,
"conservative": -0.5,
"neutral": 20,
"mappings":
{
"sentence1": "blah blah politics"
}
}