Skip to content

Commit 883432f

Browse files
julitafalconduszajuskora
authored andcommitted
Collaboration - REST API
1 parent 3b01b78 commit 883432f

File tree

6 files changed

+248
-0
lines changed

6 files changed

+248
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"ParticipantListCreate": {
3+
"ParticipantCreate": [
4+
{
5+
"_media-type": "application\/vnd.ibexa.api.InternalParticipantCreate+json",
6+
"User": {
7+
"_media-type": "application/vnd.ibexa.api.User+json",
8+
"_href": "/api/ibexa/v2/user/users/14"
9+
},
10+
"scope": "view"
11+
},
12+
{
13+
"_media-type": "application\/vnd.ibexa.api.ExternalParticipantCreate+json",
14+
"email": "[email protected]",
15+
"scope": "view"
16+
}
17+
]
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"ParticipantList": {
3+
"Participants": [
4+
{
5+
"User": {
6+
"_href": "/api/ibexa/v2/user/users/__FIXED_ID__",
7+
"_media-type": "application/vnd.ibexa.api.User+json"
8+
},
9+
"_media-type": "application/vnd.ibexa.api.InternalParticipant+json",
10+
"createdAt": "__CREATED_AT__",
11+
"id": "__FIXED_ID__",
12+
"name": "Anonymous User",
13+
"scope": "edit",
14+
"updatedAt": "__UPDATED_AT__"
15+
},
16+
{
17+
"_media-type": "application/vnd.ibexa.api.ExternalParticipant+json",
18+
"createdAt": "__CREATED_AT__",
19+
"email": "[email protected]",
20+
"id": "__FIXED_ID__",
21+
"name": "[email protected]",
22+
"scope": "view",
23+
"updatedAt": "__UPDATED_AT__"
24+
}
25+
],
26+
"_media-type": "application/vnd.ibexa.api.ParticipantList+json"
27+
}
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0"?>
2+
<ParticipantList media-type="application/vnd.ibexa.api.ParticipantList+xml">
3+
<Participant media-type="application/vnd.ibexa.api.InternalParticipant+xml">
4+
<id>__FIXED_ID__</id>
5+
<name>Anonymous User</name>
6+
<scope>edit</scope>
7+
<User href="/api/ibexa/v2/user/users/__FIXED_ID__" media-type="application/vnd.ibexa.api.User+xml"/>
8+
<createdAt>__CREATED_AT__</createdAt>
9+
<updatedAt>__UPDATED_AT__</updatedAt>
10+
</Participant>
11+
<Participant media-type="application/vnd.ibexa.api.ExternalParticipant+xml">
12+
<id>__FIXED_ID__</id>
13+
<name>[email protected]</name>
14+
<scope>view</scope>
15+
<email>[email protected]</email>
16+
<createdAt>__CREATED_AT__</createdAt>
17+
<updatedAt>__UPDATED_AT__</updatedAt>
18+
</Participant>
19+
</ParticipantList>

docs/api/rest_api/rest_api_reference/input/examples/collaborative_editing/session/create/POST/CollaborationSessionCreate.json.example

Whitespace-only changes.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
/collaboration/session/{sessionID}/participant/list:
2+
get:
3+
displayName: Load participant list
4+
description: Load participant list.
5+
queryParameters:
6+
sessionId:
7+
description: Retrieves the participant list for a given collaboration session ID (e.g. GET /collaboration/session/1234).
8+
headers:
9+
Accept:
10+
description: ParticipantList - If set, the participant list is returned in XML or JSON format.
11+
application/vnd.ibexa.api.ParticipantList+xml
12+
application/vnd.ibexa.api.ParticipantList+json
13+
responses:
14+
200:
15+
description: OK - Loads participants for a given collaboration session ID.
16+
body:
17+
application/vnd.ibexa.api.ParticipantList+xml:
18+
type: ParticipantList
19+
example: !include examples/collaborative_editing/participant/list/GET/ParticipantList.xml.example
20+
application/vnd.ibexa.api.ParticipantList+json:
21+
type: ParticipantList
22+
example: !include examples/collaborative_editing/participant/list/GET/ParticipantList.json.example
23+
404:
24+
description: If there are no visibile participants matching the filter.
25+
26+
/collaboration/session/{sessionId}/participant/add:
27+
post:
28+
displayName: Add participant
29+
description: Adds new participant.
30+
headers:
31+
Accept:
32+
description: If set, the new participant is returned in XML or JSON format.
33+
example:
34+
application/vnd.ibexa.api.ParticipantList+json
35+
Content-Type:
36+
description: The participant schema encoded in XML or JSON format.
37+
example:
38+
application/vnd.ibexa.api.ParticipantListCreate+xml
39+
body:
40+
application/vnd.ibexa.api.ParticipantList+json:
41+
type: ProductList
42+
example: !include examples/collaborative_editing/participant/add/PATCH/ParticipantListCreate.json.example
43+
responses:
44+
201:
45+
body:
46+
application/vnd.ibexa.api.ParticipantList+json:
47+
type: ProductList
48+
example: !include examples/
49+
400:
50+
description: Error - the input does not match the input schema definition.
51+
401:
52+
description: Error - the user is not authorized to update this product.
53+
403:
54+
description: Error - a participant with the same name already exists.
55+
404:
56+
description: Error - no participant with the given ID exists.
57+
58+
/collaboration/session/{sessionId}/participant/{participantId}/update
59+
patch:
60+
displayName: Update participant
61+
description: Updates a participant.
62+
headers:
63+
Accept:
64+
description: If set, the updated participant is returned in XML or JSON format.
65+
example: |
66+
application/vnd.ibexa.api.<Discriminator>Participant+json
67+
application/vnd.ibexa.api.<Discriminator>Participant+xml
68+
Content-Type:
69+
description: The ParticipantUpdate schema encoded in XML or JSON format.
70+
example: |
71+
application/vnd.ibexa.api.<Discriminator>ParticipantUpdate+json
72+
application/vnd.ibexa.api.<Discriminator>ParticipantUpdate+xml
73+
If-Match:
74+
description: Performs a PATCH only if the specified ETag is the current one.
75+
example: ETag
76+
body:
77+
application/vnd.ibexa.api.ParticipantUpdate+xml:
78+
type: ParticipantUpdate
79+
example: !include examples/
80+
responses:
81+
200:
82+
description: OK - participant updated.
83+
body:
84+
application/vnd.ibexa.api.participant+xml:
85+
type: Participant
86+
example: !include examples/
87+
400:
88+
description: Error - the input does not match the input schema definition.
89+
401:
90+
description: Error - the user is not authorized to update the User.
91+
404:
92+
description: Error - the User does not exist.
93+
412:
94+
description: Error - the current ETag does not match with the provided one in the If-Match header.
95+
96+
/collaboration/session/{sessionId}/participant/{participantId}/remove:
97+
delete:
98+
displayName: Delete participant
99+
description: Deletes the given participant.
100+
responses:
101+
204:
102+
description: No Content.
103+
401:
104+
description: Error - the user is not authorized to delete this participant.
105+
403:
106+
description: Error - the user is the same as the authenticated participant.
107+
404:
108+
description: Error - the participant does not exist.
109+
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/collaboration/session/create:
2+
post:
3+
displayName: Add participant
4+
description: Adds new participant.
5+
headers:
6+
Accept:
7+
description: If set, the new participant is returned in XML or JSON format.
8+
example:
9+
application/vnd.ibexa.api.CollaborationSession+json
10+
application/vnd.ibexa.api.CollaborationSession+xml
11+
Content-Type:
12+
description: The participant schema encoded in XML or JSON format.
13+
example:
14+
application/vnd.ibexa.api.CollaborationSessionCreate+json
15+
application/vnd.ibexa.api.CollaborationSessionCreate+xml
16+
body:
17+
application/vnd.ibexa.api.ParticipantList+json:
18+
type: ProductList
19+
example: !include examples/collaborative_editing/session/create/POST/CollaborationSessionCreate.json.example
20+
responses:
21+
201:
22+
body:
23+
application/vnd.ibexa.api.ParticipantList+json:
24+
type: ProductList
25+
example: !include examples/
26+
400:
27+
description: Error - the input does not match the input schema definition.
28+
401:
29+
description: Error - the user is not authorized to update this product.
30+
403:
31+
description: Error - a participant with the same name already exists.
32+
404:
33+
description: Error - no participant with the given ID exists.
34+
35+
/collaboration/session/{sessionId}/delete:
36+
delete:
37+
displayName: Delete session (collaboration)
38+
description: The collaboration session is removed.
39+
headers:
40+
Cookie:
41+
description: "{sessionName}={sessionID}"
42+
X-CSRF-Token:
43+
description: The {csrfToken} needed on all unsafe HTTP methods with session.
44+
responses:
45+
204:
46+
description: OK - session deleted.
47+
404:
48+
description: Error - the session does not exist.
49+
50+
/collaboration/session/{sessionId}/retrieve:
51+
get:
52+
displayName: Retrieve session
53+
description: Get the collaboration session's information.
54+
headers:
55+
Cookie:
56+
description: "{sessionName}={sessionID}"
57+
X-CSRF-Token:
58+
description: The {csrfToken} needed on all unsafe HTTP methods with session.
59+
Accept:
60+
example: |
61+
application/vnd.ibexa.api.CollaborationSession+<xml
62+
application/vnd.ibexa.api.CollaborationSession+json
63+
responses:
64+
200:
65+
body:
66+
application/vnd.ibexa.api.CollaborationSession+xml:
67+
type: CollaborationSession
68+
example: !include examples/
69+
application/vnd.ibexa.api.CollaborationSession+json:
70+
type: CollaborationSession
71+
example: !include examples/
72+
404:
73+
description: Error - the session does not exist.

0 commit comments

Comments
 (0)