Skip to content

Commit f7fb81d

Browse files
committed
REST API: Continue user/users/{userId}/segments responses
1 parent 6f9daa7 commit f7fb81d

File tree

6 files changed

+79
-0
lines changed

6 files changed

+79
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"UserSegmentAssignInput": {
3+
"segments": ["corporate_account"]
4+
}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<UserSegmentAssignInput>
2+
<segments>corporate_account</segments>
3+
</UserSegmentAssignInput>
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+
}
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-types.raml

+16
Original file line numberDiff line numberDiff line change
@@ -2306,6 +2306,7 @@ SegmentUpdateWrapper:
23062306
SegmentCreate: SegmentUpdate
23072307

23082308
UserSegmentList:
2309+
description: 'This class lists segment assignements.'
23092310
type: object
23102311
properties:
23112312
UserSegment:
@@ -2318,6 +2319,7 @@ UserSegmentListWrapper:
23182319
UserSegmentList: UserSegmentList
23192320

23202321
UserSegment:
2322+
description: 'This class reprensents a segment assigned to a user'
23212323
type: object
23222324
properties:
23232325
id: integer
@@ -2328,6 +2330,20 @@ UserSegment:
23282330
User:
23292331
type: Ref
23302332

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+
23312347
SortClause:
23322348
description: 'This class is the base for SortClause classes, used to set sorting of content queries.'
23332349
type: object

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

+23
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,10 @@ head:
342342
body:
343343
application/vnd.ibexa.api.UserSegmentList+xml:
344344
type: UserSegmentList
345+
example: !include examples/user/users/user_id/segments/UserSegmentList.xml.example
345346
application/vnd.ibexa.api.UserSegmentList+json:
346347
type: UserSegmentListWrapper
348+
example: !include examples/user/users/user_id/segments/UserSegmentList.json.example
347349
404:
348350
description: Error - the user doesn't exist.
349351
post:
@@ -355,10 +357,31 @@ head:
355357
example: |
356358
application/vnd.ibexa.api.UserSegmentAssignInput+xml
357359
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.
358374
/{segmentIdentifier}:
359375
delete:
360376
displayName: Unassign Segment from User
361377
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.
362385
/drafts:
363386
get:
364387
displayName: Load user drafts

0 commit comments

Comments
 (0)