Skip to content

Commit beb1778

Browse files
committed
IBX-9058: Complete REST API Reference (#2674)
(cherry picked from commit 0ca6945)
1 parent b9e963f commit beb1778

File tree

9 files changed

+1534
-39
lines changed

9 files changed

+1534
-39
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"UserSegmentAssignInput": {
3+
"segments": ["corporate_account"]
4+
}
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<UserSegmentAssignInput>
2+
<segments>corporate_account</segments>
3+
</UserSegmentAssignInput>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"UserSegmentList": {
3+
"_media-type": "application\/vnd.ibexa.api.UserSegmentList+json",
4+
"_href": "\/api\/ibexa\/v2\/user\/users\/14\/segments",
5+
"UserSegment": [
6+
{
7+
"_media-type": "application\/vnd.ibexa.api.UserSegment+json",
8+
"id": 1,
9+
"identifier": "corporate_account",
10+
"name": "Corporate Account",
11+
"SegmentGroup": {
12+
"_media-type": "application\/vnd.ibexa.api.SegmentGroup+json",
13+
"_href": "\/api\/ibexa\/v2\/segment_groups\/corporate_accounts"
14+
},
15+
"User": {
16+
"_media-type": "application\/vnd.ibexa.api.User+json",
17+
"_href": "\/api\/ibexa\/v2\/user\/users\/14"
18+
}
19+
}
20+
]
21+
}
22+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<UserSegmentList media-type="application/vnd.ibexa.api.UserSegmentList+xml" href="/api/ibexa/v2/user/users/14/segments">
3+
<UserSegment media-type="application/vnd.ibexa.api.UserSegment+xml">
4+
<id>1</id>
5+
<identifier>corporate_account</identifier>
6+
<name>Corporate Account</name>
7+
<SegmentGroup media-type="application/vnd.ibexa.api.SegmentGroup+xml" href="/api/ibexa/v2/segment_groups/corporate_accounts"/>
8+
<User media-type="application/vnd.ibexa.api.User+xml" href="/api/ibexa/v2/user/users/14"/>
9+
</UserSegment>
10+
</UserSegmentList>

docs/api/rest_api/rest_api_reference/input/ibexa-cart.raml

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ post:
8585
401:
8686
description: Error - the user is not authorized to get this cart.
8787
404:
88-
description: Error - The identifier do not match any Cart.
88+
description: Error - the identifier do not match any cart.
8989
delete:
9090
displayName: Delete Cart
9191
description: Deletes Cart by its identifier.
@@ -98,11 +98,30 @@ post:
9898
example: |
9999
application/vnd.ibexa.api.CartMetadataUpdate+xml
100100
application/vnd.ibexa.api.CartMetadataUpdate+json
101+
Accept:
102+
description: The updated Cart is returned in XML or JSON format.
103+
example: |
104+
application/vnd.ibexa.api.Cart+xml
105+
application/vnd.ibexa.api.Cart+json
101106
body:
102107
application/vnd.ibexa.api.CartMetadataUpdate+xml:
103108
type: CartMetadataUpdate
104109
application/vnd.ibexa.api.CartMetadataUpdate+json:
105110
type: CartMetadataUpdateWrapper
111+
responses:
112+
200:
113+
description: OK - return the updated cart
114+
body:
115+
application/vnd.ibexa.api.Cart+xml:
116+
type: Cart
117+
application/vnd.ibexa.api.Cart+json:
118+
type: CartWrapper
119+
400:
120+
description: Error - the input doesn't match the input schema definition.
121+
401:
122+
description: Error - the user is not authorized to update this cart.
123+
404:
124+
description: Error - the identifier doesn't match any cart.
106125
/entry:
107126
post:
108127
displayName: Add Entry to Cart
@@ -113,16 +132,58 @@ post:
113132
example: |
114133
application/vnd.ibexa.api.CartEntryAdd+xml
115134
application/vnd.ibexa.api.CartEntryAdd+json
135+
Accept:
136+
description: The updated Cart is returned in XML or JSON format.
137+
example: |
138+
application/vnd.ibexa.api.Cart+xml
139+
application/vnd.ibexa.api.Cart+json
116140
body:
117141
application/vnd.ibexa.api.CartEntryAdd+xml:
118142
type: CartEntryAdd
119143
application/vnd.ibexa.api.CartEntryAdd+json:
120144
type: CartEntryAddWrapper
121145
example: !include examples/cart/entry/POST/CartEntryAdd.json.example
146+
responses:
147+
200:
148+
description: OK - return the updated cart
149+
body:
150+
application/vnd.ibexa.api.Cart+xml:
151+
type: Cart
152+
application/vnd.ibexa.api.Cart+json:
153+
type: CartWrapper
154+
400:
155+
description: Error - the input doesn't match the input schema definition.
156+
401:
157+
description: Error - the user is not authorized to add an entry to this cart.
158+
404:
159+
description: Error - the identifier doesn't match any cart.
122160
/{entryId}:
123161
delete:
124162
displayName: Remove Entry from Cart
125163
description: Removes the given entry from the given Cart.
164+
headers:
165+
Accept:
166+
description: The updated Cart is returned in XML or JSON format.
167+
example: |
168+
application/vnd.ibexa.api.Cart+xml
169+
application/vnd.ibexa.api.Cart+json
170+
body:
171+
application/vnd.ibexa.api.CartEntryUpdate+xml:
172+
type: CartEntryUpdate
173+
application/vnd.ibexa.api.CartEntryUpdate+json:
174+
type: CartEntryUpdateWrapper
175+
responses:
176+
200:
177+
description: OK - return the updated cart
178+
body:
179+
application/vnd.ibexa.api.Cart+xml:
180+
type: Cart
181+
application/vnd.ibexa.api.Cart+json:
182+
type: CartWrapper
183+
401:
184+
description: Error - the user is not authorized to remove an entry from this cart.
185+
404:
186+
description: Error - the identifiers don't match any cart or entry.
126187
patch:
127188
displayName: Update Entry from Cart
128189
description: Updates the given entry from the given Cart.
@@ -132,11 +193,30 @@ post:
132193
example: |
133194
application/vnd.ibexa.api.CartEntryUpdate+xml
134195
application/vnd.ibexa.api.CartEntryUpdate+json
196+
Accept:
197+
description: The updated Cart is returned in XML or JSON format.
198+
example: |
199+
application/vnd.ibexa.api.Cart+xml
200+
application/vnd.ibexa.api.Cart+json
135201
body:
136202
application/vnd.ibexa.api.CartEntryUpdate+xml:
137203
type: CartEntryUpdate
138204
application/vnd.ibexa.api.CartEntryUpdate+json:
139205
type: CartEntryUpdateWrapper
206+
responses:
207+
200:
208+
description: OK - return the updated cart
209+
body:
210+
application/vnd.ibexa.api.Cart+xml:
211+
type: Cart
212+
application/vnd.ibexa.api.Cart+json:
213+
type: CartWrapper
214+
400:
215+
description: Error - the input doesn't match the input schema definition.
216+
401:
217+
description: Error - the user is not authorized to update an entry of this cart.
218+
404:
219+
description: Error - the identifiers don't match any cart or entry.
140220
/empty:
141221
post:
142222
displayName: Empty Cart

docs/api/rest_api/rest_api_reference/input/ibexa-corporate.raml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,10 @@ get:
235235
type: MemberListWrapper
236236
example: !include examples/corporate/companies/company_id/members/GET/MemberList.json.example
237237
400:
238+
description: Returned when invalid Criterion or Sort clause is used.
238239
body:
239240
application/vnd.ibexa.api.ErrorMessage:
240241
type: ErrorMessage
241-
description: Returned when invalid Criterion or Sort clause is used.
242242
post:
243243
displayName: Create a company member
244244
description: Creates a company member.

docs/api/rest_api/rest_api_reference/input/ibexa-types.raml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ LocationList:
13881388

13891389
LocationQuery:
13901390
description: 'This class is used to perform a Location query.'
1391-
type: object
1391+
type: Query
13921392

13931393
LocationUpdateWrapper:
13941394
description: 'JSON object with only a LocationUpdate property.'
@@ -2305,6 +2305,45 @@ SegmentUpdateWrapper:
23052305
properties:
23062306
SegmentCreate: SegmentUpdate
23072307

2308+
UserSegmentList:
2309+
description: 'This class lists segment assignements.'
2310+
type: object
2311+
properties:
2312+
UserSegment:
2313+
type: UserSegment[]
2314+
2315+
UserSegmentListWrapper:
2316+
description: 'JSON object with only a UserSegmentList property'
2317+
type: object
2318+
properties:
2319+
UserSegmentList: UserSegmentList
2320+
2321+
UserSegment:
2322+
description: 'This class reprensents a segment assigned to a user'
2323+
type: object
2324+
properties:
2325+
id: integer
2326+
identifier: string
2327+
name: string
2328+
SegmentGroup:
2329+
type: Ref
2330+
User:
2331+
type: Ref
2332+
2333+
UserSegmentAssignInput:
2334+
description: 'This class represents a segment assignment input.'
2335+
type: object
2336+
properties:
2337+
segments:
2338+
type: array
2339+
items: string
2340+
2341+
UserSegmentAssignInputWrapper:
2342+
description: 'JSON object with only a UserSegmentAssignInput property.'
2343+
type: object
2344+
properties:
2345+
UserSegmentAssignInput: UserSegmentAssignInput
2346+
23082347
SortClause:
23092348
description: 'This class is the base for SortClause classes, used to set sorting of content queries.'
23102349
type: object
@@ -6274,4 +6313,3 @@ ActionConfiguration:
62746313
updatedAt:
62756314
type: datetime
62766315
description: 'Timestamp indicating when the action configuration was last updated.'
6277-

docs/api/rest_api/rest_api_reference/input/ibexa-user-users.raml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ get:
3333
application/vnd.ibexa.api.UserRefList+json:
3434
type: UserRefListWrapper
3535
404:
36-
description: If there are no visibile Users matching the filter.
36+
description: If there are no visible Users matching the filter.
3737
head:
3838
displayName: Verify Users
3939
description: Verifies if there are Users matching given filter.
@@ -50,7 +50,7 @@ head:
5050
200:
5151
description: OK - verifies if there are Users matching the given filter.
5252
404:
53-
description: Error - there are no visibile Users matching the filter.
53+
description: Error - there are no visible Users matching the filter.
5454
/current:
5555
get:
5656
displayName: Load current User
@@ -330,13 +330,24 @@ head:
330330
/segments:
331331
get:
332332
displayName: View user segments
333-
description: TODO
333+
description: Return user's segment list.
334334
headers:
335335
Accept:
336336
description: If set, the user's segment list is returned in XML or JSON format.
337337
example: |
338338
application/vnd.ibexa.api.UserSegmentList+xml
339339
application/vnd.ibexa.api.UserSegmentList+json
340+
responses:
341+
200:
342+
body:
343+
application/vnd.ibexa.api.UserSegmentList+xml:
344+
type: UserSegmentList
345+
example: !include examples/user/users/user_id/segments/UserSegmentList.xml.example
346+
application/vnd.ibexa.api.UserSegmentList+json:
347+
type: UserSegmentListWrapper
348+
example: !include examples/user/users/user_id/segments/UserSegmentList.json.example
349+
404:
350+
description: Error - the user doesn't exist.
340351
post:
341352
displayName: Assign Segments to User
342353
description: Assigns Segments from payload to User given by ID.
@@ -346,10 +357,31 @@ head:
346357
example: |
347358
application/vnd.ibexa.api.UserSegmentAssignInput+xml
348359
application/vnd.ibexa.api.UserSegmentAssignInput+json
360+
body:
361+
application/vnd.ibexa.api.UserSegmentAssignInput+xml:
362+
type: UserSegmentAssignInput
363+
example: !include examples/user/users/user_id/segments/UserSegmentAssignInput.xml.example
364+
application/vnd.ibexa.api.UserSegmentAssignInput+json:
365+
type: UserSegmentAssignInputWrapper
366+
example: !include examples/user/users/user_id/segments/UserSegmentAssignInput.json.example
367+
responses:
368+
204:
369+
description: No Content - segments assigned to user.
370+
401:
371+
description: Error - the requesting user is not authorized to assign this segment to the given user.
372+
404:
373+
description: Error - the user doesn't exist.
349374
/{segmentIdentifier}:
350375
delete:
351376
displayName: Unassign Segment from User
352377
description: The Segment designated by its identifier is unassigned from the User given by ID.
378+
responses:
379+
204:
380+
description: No Content - segments unassigned from user.
381+
401:
382+
description: Error - the requesting user is not authorized to unassign this segment from the given user.
383+
404:
384+
description: Error - the segment or the user doesn't exist.
353385
/drafts:
354386
get:
355387
displayName: Load user drafts

0 commit comments

Comments
 (0)