Cornice RESTful services¶
Routes begin with /api/v1/
and correspond to assembl.views.api
.
Each of these routes and the code they contain are
designed manually and have been written with performance in mind, as
they are the most critical ones (they are the first ones called by the
front-end side of the application, or are called often, or require heavy
database work).
Discussion service at /api/v1/discussion/{discussion_id:\d+}¶
Manipulate a single Discussion object
GET¶
Response: json
PUT¶
Response: json
DELETE¶
Response: json
Etalab_Discussions service at /instances¶
Etalab endpoint to GET the list of existing Discussion objects, and to POST a new discussion
GET¶
Response: json
POST¶
Response: json
Etalab_Discussion service at /instances/{discussion_id:\d+}¶
Etalab endpoint to GET or DELETE an existing Discussion object
GET¶
Response: json
DELETE¶
Response: json
Agents service at /api/v1/discussion/{discussion_id:\d+}/agents/¶
Retrieve a discussion’s agents.
GET¶
Response: json
Agent service at /api/v1/discussion/{discussion_id:\d+}/agents/{id:.+}¶
Retrieve a single agent
GET¶
Response: json
Permissions service at /api/v1/discussion/{discussion_id:\d+}/permissions¶
The permissions for a given discussion
GET¶
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
Response: json
Permissions_For_Role service at /api/v1/discussion/{discussion_id:\d+}/permissions/r/{role_name}¶
The permissions for a single role
GET¶
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
Response: json
Roles service at /api/v1/discussion/{discussion_id:\d+}/roles¶
The roles defined in the system
GET¶
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
Response: json
Generic_Roles_For_User service at /api/v1/discussion/{discussion_id:\d+}/roles/globalfor/{user_id:.+}¶
The universal roles of a given user
GET¶
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
Response: json
Discussion_Roles_For_User service at /api/v1/discussion/{discussion_id:\d+}/roles/localfor/{user_id:.+}¶
The per-discussion roles of a given user
GET¶
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
Response: json
All_Roles_For_User service at /api/v1/discussion/{discussion_id:\d+}/roles/allfor/{user_id:.+}¶
The per-discussion and global roles of a given user
GET¶
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
Response: json
Permissions_For_User service at /api/v1/discussion/{discussion_id:\d+}/permissions/u/{user_id:.+}¶
The per-discussion permissions of a given user
GET¶
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
Response: json
User_Has_Permission service at /api/v1/discussion/{discussion_id:\d+}/permissions/{permission}/u/{user_id:.+}¶
Whether a given user has a specific permission
GET¶
Response: json
Users_With_Permission service at /api/v1/discussion/{discussion_id:\d+}/permissions/{permission}/u/¶
Which users have a specific permission
GET¶
Response: json
Extracts service at /api/v1/discussion/{discussion_id:\d+}/extracts¶
An extract from Content that is an expression of an Idea
GET¶
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
Response: json
Extract service at /api/v1/discussion/{discussion_id:\d+}/extracts/{id:.+}¶
Manipulate a single extract
GET¶
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
Response: json
PUT¶
Updating an Extract partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
Response: json
Search_Extracts service at /api/v1/discussion/{discussion_id:\d+}/search_extracts¶
search for extracts matching a URL
GET¶
partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.
Response: json
Generic service at /api/v1/discussion/{discussion_id:\d+}/generic/{cls}/{id}{view:(/[^/]+)?}¶
Retrieve an arbitrary object.
GET¶
Response: json
Ideas service at /api/v1/discussion/{discussion_id:\d+}/ideas¶
The ideas collection
POST¶
Response: json
GET¶
Response: json
Idea service at /api/v1/discussion/{discussion_id:\d+}/ideas/{id:.+}¶
Manipulate a single idea
GET¶
Response: json
Idea_Extracts service at /api/v1/discussion/{discussion_id:\d+}/ideas_extracts/{id:.+}¶
Get the extracts of a single idea
GET¶
Response: cornicejson
Posts service at /api/v1/discussion/{discussion_id:\d+}/posts¶
Post API following SIOC vocabulary as much as possible
GET¶
Query interface on posts Filters have two forms: only_*, is for filters that cannot be reversed (ex: only_synthesis, only_orphan) is_*, is for filters that can be reversed (ex:is_unread=true returns only unread message, is_unread=false returns only read messages) order: can be chronological, reverse_chronological, popularity root_post_id: all posts below the one specified. family_post_id: all posts below the one specified, and all its ancestors. post_reply_to: replies to a given post root_idea_id: all posts associated with the given idea ids: explicit message ids. posted_after_date, posted_before_date: date selection (ISO format) post_author: filter by author keyword: use full-text search locale: restrict to locale
Response: json
POST¶
Create a new post in this discussion.
We use post, not put, because we don’t know the id of the post
Response: json
Post service at /api/v1/discussion/{discussion_id:\d+}/posts/{id:.+}¶
Manipulate a single post
GET¶
Response: json
Post_Read service at /api/v1/discussion/{discussion_id:\d+}/post_read/{id:.+}¶
Signal that a post was read
Sources service at /api/v1/discussion/{discussion_id:\d+}/sources/¶
Manipulate a discussion’s sources.
GET¶
Response: json