-
Notifications
You must be signed in to change notification settings - Fork 0
/
apiary.apib
130 lines (113 loc) · 2.27 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
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
127
128
129
130
HOST: http://streetmix-staging.herokuapp.com/api/v1
--- Streetmix REST API
---
REST API for the [Streetmix](http://streetmix.net) application
---
--
User Authentication Resources
--
Sign-in a user, creating one if necessary.
POST /users
> Content-Type: application/json
> Accept: application/json
{
"twitter": {
"userId": 8254163,
"screenName": "shaunak",
"oauthAccessToken": "fdy36ydgsjw0263bhd73181bdbe630eh033g28e=",
"oauthAccessTokenSecret": "ue63tsbvjc92nvmdt268fnc0209e03yenc9371v383gr61u83r"
}
}
< 201
< Location: /users/{id}
< Content-Type: application/json
{
"id": "9cc211c0-c561-11e2-8b8b-0800200c9a66",
"loginToken": "906f7180-c4ba-11e2-8b8b-0800200c9a66"
}
Sign-out a user.
DELETE /users/{id}/login-token
< 204
--
User Resources
--
Retrieve a user's information.
GET /users/{id}
> Accept: application/json
< 200
{
"id": "shaunak",
"profileImageUri" "http://a0.twimg.com/profile_images/1777569006/image1327396628_normal.png"
}
Update a user's information.
PUT /users/{id}
> Content-Type: application/json
{
"data": ...
}
< 204
Retrieve a user's streets.
GET /users/{id}/streets
> Accept: application/json
< 200
{
"streets": [
{
"id": "906f7180-c4ba-11e2-8b8b-0800200c9a66",
"creatorId": "9cc211c0-c561-11e2-8b8b-0800200c9a66",
"name": "Haight St.",
"data": ...
},
...
]
}
--
Street Resources
--
Create a new street.
POST /streets
> Accept: application/json
< 201
< Content-Type: application/json
< Location: /streets/{id}
{
"id": "906f7180-c4ba-11e2-8b8b-0800200c9a66",
"creatorId": "9cc211c0-c561-11e2-8b8b-0800200c9a66",
"name": "Haight St.",
"data": ...
}
Retrieve a street.
GET /streets/{id}
> Accept: application/json
< 200
{
"id": "906f7180-c4ba-11e2-8b8b-0800200c9a66",
"creatorId": "9cc211c0-c561-11e2-8b8b-0800200c9a66",
"name": "Haight St.",
"data": ...
}
Delete a street.
DELETE /streets/{id}
< 204
Update an existing street.
PUT /streets/{id}
> Accept: application/json
> Content-Type: application/json
{
"name": "Haight St.",
"data": ...
}
< 204
--
Feedback Resources
--
Send feedback to the Streetmix team.
POST /feedback
> Content-Type: application/json
{
"from": "[email protected]",
"message": "This is the best application ever!"
}
< 202
< Content-Type: application/json
"Feedback accepted."