-
Notifications
You must be signed in to change notification settings - Fork 29
/
API
144 lines (109 loc) · 5.46 KB
/
API
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
Users
=====
Route: GET /users/c
Description: Get the currently logged user's username and credentials.
Route: GET /users
Description: Get a paginated list of all users with username or email matching
matchtext, if provided. Returned parameters will depend on query
issuer permissions.
Parameters: matchtext, page, pagesize
Route: GET /users/:username
Description: Get info about a user
Route: GET /users/:username/password_reset/:token
Description: Check whether a reset password token is correct, and reset
a user's password if so.
Route: GET /users/:username/verify_user/:token
Description: Verifies a user's email by means of a token, or removes
that token if it has expired.
If requesting user is an admin, verifies the user and removes
the token. Token should equal '0' for admins.
Returns a success message if the user is already verified.
The route name should match the database token purpose.
Route: GET /users/email/:email
Description: Sends an email to :email with all users associated with said :email
Route: POST /users/:username
Description: Add or update a user. All passwords should travel pre-hashed with SHA512.
Parameters: username, password, password_repeat, email
Route: POST /users/:username/newpassword
Description: Sets a new password for a user. All passwords should travel pre-hashed
with SHA512.
Parameters: oldpassword, password_repeat, newpassword
Route: POST /users/:username/resendverification
Description: Resends user verification email.
Route: POST /users/:username/password_reset
Description: Generate a token to reset a user's password.
Route: POST /users/:username/login
Description: Logs a user into the system.
Body: password
Route: POST /logout
Description: Logs out the current user from the system.
Route: DELETE /users/:username
Description: Delete a user.
Projects
========
Route: GET /projects
Description: Get a list of published projects.
Parameters: page, pagesize, matchtext, withthumbnail
Route: GET /projects/:username
Description: Get metadata for a project list by a user.
Response will depend on parameters and query issuer permissions.
Parameters: ispublished, page, pagesize, matchtext, withthumbnail, updatingnotes
Route: GET /projects/:username/:projectname
Description: Get a particular project.
Response will depend on query issuer permissions.
Parameters: delta, ispublic, ispublished
Route: GET /projects/:username/:projectname/metadata
Description: Get a project metadata.
Parameters: projectname, ispublic, ispublished, lastupdated, lastshared
Route: GET /projects/:username/:projectname/versions
Description: Get info about backed up project versions.
Body: versions
Route: GET /projects/:username/:projectname/remixes
Description: Get a list of all published remixes from a project.
Parameters: page, pagesize
Route: GET /projects/:username/:projectname/thumbnail
Description: Get a project thumbnail.
Route: POST /projects/:username/:projectname
Description: Add/update a particular project.
Response will depend on query issuer permissions.
Body: xml, notes, thumbnail
Route: POST /projects/:username/:projectname/metadata
Description: Add/update a project metadata. When admins and moderators unpublish
somebody else's project, they also provide a reason that will be
emailed to the project owner.
Parameters: projectname, ispublic, ispublished, lastupdated, lastshared, reason
Body: notes, projectname
Route: DELETE /projects/:username/:projectname
Description: Delete a particular project. When admins and moderators delete somebody else's
project, they also provide a reason that will be emailed to the project owner.
Parameters: reason
Response will depend on query issuer permissions.
Collections
===========
Route: GET /collections
Description: If requesting user is an admin, get a paginated list of all
collections with name matching matchtext, if provided.
Returns public collections
Parameters: matchtext, page, pagesize
Route: GET /users/:username/collections
Description: Get a paginated list of all a particular user's collections
with name matching matchtext, if provided.
Returns only public collections, if another user.
Parameters: Route: GET: username, matchtext, page, pagesize
Route: GET /users/:username/collections/:collection_slug
Description: Get info about a collection.
Parameters: username, collection_name, ...
Route: GET /users/:username/collections/:collection_slug/items(/:item_id)
Description: Get a paginated list of all items in a collection.
Parameters: username, collection_slug
Route: POST /users/:username/collections/:collection_slug
Description: Create a collection.
Parameters: username, collection_name, ...
Route: POST /users/:username/collections/:collection_slug/items(/:item_id)
Description: Add an item to a collection.
Parameters: username, collection_slug, item_id
Route: DELETE /users/:username/collections/:collection_slug
Description: Delete a particular collection.
Route: DELETE /users/:username/collections/:collection_slug/items(/:item_id)
Description: Remove an item from a collection.
Parameters: username, collection_slug