This repository has been archived by the owner on Dec 19, 2019. It is now read-only.
/
API.txt
126 lines (114 loc) · 2.95 KB
/
API.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
API:
POST /user: create a user account
{"email": "email@address.com",
"name": "My Name",
"address": "My Address",
"lat_long": [lat, long]
}
Response:
200 OK:
{all data,
"url": "/user/15"
}
Location: /user/15
400 Bad Request:
{"error_message": "You did something wrong",
"fields": {"email": {"error": "bad email address",
"value": "email@address.com"},
"name": {"value": "My Name"}
}
}
GET /user/{user_id}
Response:
200 OK: user data
what is POSTed to /user, plus "url"
GET /user/15/topics - list of topics (threads)
{"topics": [
{"url": "/topic/3",
"center": [lat, long],
"subject": "Free flowers",
"author": {"name": "Bob",
"address": "1324 N 10th",
"user_url": "/user/12"},
"last_updated": "20100104T04:23:53",
"messages": 5
}
], ...
"next_page": "/user/15/topics?page=2"
}
POST /user/15/topics - compose new topic:
Request body:
{"subject": "Lost cat",
"body": "I lost my cat"}
GET /user/15/topics?since=timestamp
Response: all topics updated since timestamp
GET /topic/3 - list of messages in a topic:
Response:
{...everything from the GET...
"sticky": true,
"messages": [
{"url": "/topic/3/message/5",
"author": ...
"posted": "timestamp",
"body": "message text",
"in_reply_to": "/topic/3/message/2" # maybe?
}
...]
}
PUT /topic/3
Edit one piece of the document:
{"sticky": false}
POST /topic/3 - add a message to a topic
Request body:
{"body": "message text"}
Response:
{"url": "/topic/3/message/6", ...}
GET /user/15/neighbors - list neighbors
{"neighbors": [
{"user_url": "/user/17",
"name": "Bob", ...}
]
}
GET /user/15/neighbors?since=timestamp
GET /user/17 - show info on one user
{"name": "Bob",
"address": "31xx 10th Ave",
"lat_long": [lat, long],
}
GET /user/15/user-prefs
Response:
{"no_contact_users": ["/users/17"],
"invisible_to_users": ["/user/21"],
"circle_discussion_limit": 100}
PUT /user/15/user-prefs/ignore-list
POST /user/15/user-prefs/ignore-list #?
{"ignore_users": ...users to add...}
POST /user/15/invite
{"invite": [{"email": "friend1@email.com", "name": "Friend"}],
"message": "Hi, try this!"}
GET/PUT /user/15/exposure
{"circle_limit": 25,
"name": {"expose": "public"},
"address": {"expose": "public", "display": "block"},
"phone": {"expose": "neighbors", "limit": 100}, # limit?
"photo": {"expose": "none"},
}
GET /user/15/local-link
{"links":
[{"url": "http://ppna.org",
"author_url": "/user/17",
"link_url": "/local-links/54",
"title": "Powderhorn Neighbors Association"}]
}
GET/PUT/DELETE /local-link/54 - see/edit/delete link
POST /local-link - create new link
email settings
advertisement admin
block captain / superuser view
other admin views
digest email
intro email
response email after user posts
invitation email
confirm invitation
exposure prefs