diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/POST/SegmentGroup.json.example b/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/POST/SegmentGroup.json.example new file mode 100644 index 0000000000..c45b5fc507 --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/POST/SegmentGroup.json.example @@ -0,0 +1,9 @@ +{ + "SegmentGroup": { + "_media-type": "application/vnd.ibexa.api.SegmentGroup+json", + "_href": "/api/ibexa/v2/segment_groups/segment_group_identifier", + "id": 3, + "identifier": "segment_group_identifier", + "name": "Segment Group Name" + } +} diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/POST/SegmentGroup.xml.example b/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/POST/SegmentGroup.xml.example new file mode 100644 index 0000000000..d9479b3cde --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/POST/SegmentGroup.xml.example @@ -0,0 +1,6 @@ + + + 3 + segment_group_identifier + Segment Group Name + diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/POST/SegmentGroupCreate.json.example b/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/POST/SegmentGroupCreate.json.example new file mode 100644 index 0000000000..490884c75e --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/POST/SegmentGroupCreate.json.example @@ -0,0 +1,6 @@ +{ + "SegmentGroupCreate": { + "identifier": "segment_group_identifier", + "name": "Segment Group Name" + } +} diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/POST/SegmentGroupCreate.xml.example b/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/POST/SegmentGroupCreate.xml.example new file mode 100644 index 0000000000..6ec4f7b1fb --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/POST/SegmentGroupCreate.xml.example @@ -0,0 +1,5 @@ + + + segment_group_identifier + Segment Group Name + diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/identifier/PATCH/SegmentGroup.json.example b/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/identifier/PATCH/SegmentGroup.json.example new file mode 100644 index 0000000000..1387f42194 --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/identifier/PATCH/SegmentGroup.json.example @@ -0,0 +1,9 @@ +{ + "SegmentGroup": { + "_media-type": "application/vnd.ibexa.api.SegmentGroup+json", + "_href": "/api/ibexa/v2/segment_groups/modified_segment_group_identifier", + "id": 3, + "identifier": "modified_segment_group_identifier", + "name": "Modified Segment Group Name" + } +} diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/identifier/PATCH/SegmentGroup.xml.example b/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/identifier/PATCH/SegmentGroup.xml.example new file mode 100644 index 0000000000..0eccf613f0 --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/identifier/PATCH/SegmentGroup.xml.example @@ -0,0 +1,6 @@ + + + 4 + modified_segment_group_identifier + Modified Segment Group Name + diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/identifier/PATCH/SegmentGroupUpdate.json.example b/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/identifier/PATCH/SegmentGroupUpdate.json.example new file mode 100644 index 0000000000..577efddba5 --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/identifier/PATCH/SegmentGroupUpdate.json.example @@ -0,0 +1,6 @@ +{ + "SegmentGroupUpdate": { + "identifier": "modified_segment_group_identifier", + "name": "Modified Segment Group Name" + } +} diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/identifier/PATCH/SegmentGroupUpdate.xml.example b/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/identifier/PATCH/SegmentGroupUpdate.xml.example new file mode 100644 index 0000000000..d33951e128 --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/identifier/PATCH/SegmentGroupUpdate.xml.example @@ -0,0 +1,5 @@ + + + modified_segment_group_identifier + Modified Segment Group Name + diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/identifier/segments/GET/SegmentList.json.example b/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/identifier/segments/GET/SegmentList.json.example index 436d9631e3..69a5bb7e79 100644 --- a/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/identifier/segments/GET/SegmentList.json.example +++ b/docs/api/rest_api/rest_api_reference/input/examples/segment_groups/identifier/segments/GET/SegmentList.json.example @@ -4,4 +4,4 @@ "_href": "\/api\/ibexa\/v2\/segment_groups\/corporate_accounts\/segments", "Segment": [] } -} \ No newline at end of file +} diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segments/POST/Segment.json.example b/docs/api/rest_api/rest_api_reference/input/examples/segments/POST/Segment.json.example new file mode 100644 index 0000000000..05aca5a79c --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/segments/POST/Segment.json.example @@ -0,0 +1,13 @@ +{ + "Segment": { + "_media-type": "application/vnd.ibexa.api.Segment+json", + "_href": "/api/ibexa/v2/segments/segment_identifier", + "id": 3, + "identifier": "segment_identifier", + "name": "Segment Name", + "SegmentGroup": { + "_media-type": "application/vnd.ibexa.api.SegmentGroup+json", + "_href": "/api/ibexa/v2/segment_groups/corporate_accounts" + } + } +} diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segments/POST/Segment.xml.example b/docs/api/rest_api/rest_api_reference/input/examples/segments/POST/Segment.xml.example new file mode 100644 index 0000000000..826c30fa69 --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/segments/POST/Segment.xml.example @@ -0,0 +1,7 @@ + + + 3 + segment_identifier + Segment Name + + diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segments/POST/SegmentCreate.json.example b/docs/api/rest_api/rest_api_reference/input/examples/segments/POST/SegmentCreate.json.example new file mode 100644 index 0000000000..fd2300337b --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/segments/POST/SegmentCreate.json.example @@ -0,0 +1,7 @@ +{ + "SegmentCreate": { + "identifier": "segment_identifier", + "name": "Segment Name", + "group": "corporate_accounts" + } +} diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segments/POST/SegmentCreate.xml.example b/docs/api/rest_api/rest_api_reference/input/examples/segments/POST/SegmentCreate.xml.example new file mode 100644 index 0000000000..e5f1619fea --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/segments/POST/SegmentCreate.xml.example @@ -0,0 +1,6 @@ + + + segment_identifier + Segment Name + corporate_accounts + diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segments/identifier/GET/Segment.json.example b/docs/api/rest_api/rest_api_reference/input/examples/segments/identifier/GET/Segment.json.example new file mode 100644 index 0000000000..05aca5a79c --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/segments/identifier/GET/Segment.json.example @@ -0,0 +1,13 @@ +{ + "Segment": { + "_media-type": "application/vnd.ibexa.api.Segment+json", + "_href": "/api/ibexa/v2/segments/segment_identifier", + "id": 3, + "identifier": "segment_identifier", + "name": "Segment Name", + "SegmentGroup": { + "_media-type": "application/vnd.ibexa.api.SegmentGroup+json", + "_href": "/api/ibexa/v2/segment_groups/corporate_accounts" + } + } +} diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segments/identifier/GET/Segment.xml.example b/docs/api/rest_api/rest_api_reference/input/examples/segments/identifier/GET/Segment.xml.example new file mode 100644 index 0000000000..826c30fa69 --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/segments/identifier/GET/Segment.xml.example @@ -0,0 +1,7 @@ + + + 3 + segment_identifier + Segment Name + + diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segments/identifier/PATCH/Segment.json.example b/docs/api/rest_api/rest_api_reference/input/examples/segments/identifier/PATCH/Segment.json.example new file mode 100644 index 0000000000..64d2dee742 --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/segments/identifier/PATCH/Segment.json.example @@ -0,0 +1,13 @@ +{ + "Segment": { + "_media-type": "application/vnd.ibexa.api.Segment+json", + "_href": "/api/ibexa/v2/segments/modified_segment_identifier", + "id": 3, + "identifier": "modified_segment_identifier", + "name": "Modified Segment Name", + "SegmentGroup": { + "_media-type": "application/vnd.ibexa.api.SegmentGroup+json", + "_href": "/api/ibexa/v2/segment_groups/small_companies" + } + } +} diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segments/identifier/PATCH/Segment.xml.example b/docs/api/rest_api/rest_api_reference/input/examples/segments/identifier/PATCH/Segment.xml.example new file mode 100644 index 0000000000..09ddf82293 --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/segments/identifier/PATCH/Segment.xml.example @@ -0,0 +1,7 @@ + + + 3 + modified_segment_identifier + Modified Segment Name + + diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segments/identifier/PATCH/SegmentUpdate.json.example b/docs/api/rest_api/rest_api_reference/input/examples/segments/identifier/PATCH/SegmentUpdate.json.example new file mode 100644 index 0000000000..de9d512ac5 --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/segments/identifier/PATCH/SegmentUpdate.json.example @@ -0,0 +1,7 @@ +{ + "SegmentUpdate": { + "identifier": "modified_segment_identifier", + "name": "Modified Segment Name", + "group": "small_companies" + } +} diff --git a/docs/api/rest_api/rest_api_reference/input/examples/segments/identifier/PATCH/SegmentUpdate.xml.example b/docs/api/rest_api/rest_api_reference/input/examples/segments/identifier/PATCH/SegmentUpdate.xml.example new file mode 100644 index 0000000000..7547d7f123 --- /dev/null +++ b/docs/api/rest_api/rest_api_reference/input/examples/segments/identifier/PATCH/SegmentUpdate.xml.example @@ -0,0 +1,6 @@ + + + modified_segment_identifier + Modified Segment Name + small_companies + diff --git a/docs/api/rest_api/rest_api_reference/input/ibexa-segment-groups.raml b/docs/api/rest_api/rest_api_reference/input/ibexa-segment-groups.raml index 1c5f223ee4..9f46a7476b 100644 --- a/docs/api/rest_api/rest_api_reference/input/ibexa-segment-groups.raml +++ b/docs/api/rest_api/rest_api_reference/input/ibexa-segment-groups.raml @@ -25,6 +25,58 @@ get: type: ErrorMessage application/vnd.ibexa.api.ErrorMessage+json: type: ErrorMessage +post: + displayName: Create a segment group + description: Creates a segment group. + headers: + Content-Type: + description: A SegmentGroupCreate schema encoded in XML or JSON format. + example: | + application/vnd.ibexa.api.SegmentGroupCreate+xml + application/vnd.ibexa.api.SegmentGroupCreate+json + Accept: + description: A segment group is returned in XML or JSON format. + example: | + application/vnd.ibexa.api.SegmentGroup+xml + application/vnd.ibexa.api.SegmentGroup+json + body: + application/vnd.ibexa.api.SegmentGroupCreate+xml: + type: SegmentGroupCreate + example: !include examples/segment_groups/POST/SegmentGroupCreate.xml.example + application/vnd.ibexa.api.SegmentGroupCreate+json: + type: SegmentGroupCreateWrapper + example: !include examples/segment_groups/POST/SegmentGroupCreate.json.example + responses: + 200: + description: OK - list the segment groups. + body: + application/vnd.ibexa.api.SegmentGroup+xml: + type: SegmentGroup + example: !include examples/segment_groups/POST/SegmentGroup.xml.example + application/vnd.ibexa.api.SegmentGroup+json: + type: SegmentGroupWrapper + example: !include examples/segment_groups/POST/SegmentGroup.json.example + 400: + description: Error - input data validation failed. + body: + application/vnd.ibexa.api.ErrorMessage+xml: + type: ErrorMessage + application/vnd.ibexa.api.ErrorMessage+json: + type: ErrorMessage + 401: + description: Error - the user is not authorized to list segment groups. + body: + application/vnd.ibexa.api.ErrorMessage+xml: + type: ErrorMessage + application/vnd.ibexa.api.ErrorMessage+json: + type: ErrorMessage + 406: + description: Error - input data is not acceptable, for example, segment group identifier is not unique. + body: + application/vnd.ibexa.api.ErrorMessage+xml: + type: ErrorMessage + application/vnd.ibexa.api.ErrorMessage+json: + type: ErrorMessage /{identifier}: get: displayName: Load segment group @@ -33,8 +85,8 @@ get: Accept: description: If set, the segment group is returned in XML or JSON format. example: | - vnd.ibexa.api.SegmentGroup+xml - vnd.ibexa.api.SegmentGroup+json + application/vnd.ibexa.api.SegmentGroup+xml + application/vnd.ibexa.api.SegmentGroup+json responses: 200: description: OK - return the segment group. @@ -49,6 +101,57 @@ get: description: Error - the user is not authorized to load this segment group. 404: description: Error - the identifier doesn't match any segment group. + patch: + displayName: Update segment group data + description: Updates the segment group's data. + headers: + Content-Type: + description: The SegmentGroupUpdate schema encoded in XML or JSON format. + example: | + application/vnd.ibexa.api.SegmentGroupUpdate+xml + application/vnd.ibexa.api.SegmentGroupUpdate+json + Accept: + description: A segment group is returned in XML or JSON format. + example: | + application/vnd.ibexa.api.SegmentGroup+xml + application/vnd.ibexa.api.SegmentGroup+json + body: + application/vnd.ibexa.api.SegmentGroupUpdate+xml: + type: SegmentGroupUpdate + example: !include examples/segment_groups/identifier/PATCH/SegmentGroupUpdate.xml.example + application/vnd.ibexa.api.SegmentGroupUpdate+json: + type: SegmentGroupUpdateWrapper + example: !include examples/segment_groups/identifier/PATCH/SegmentGroupUpdate.json.example + responses: + 200: + description: OK - returns updated segment group's data. + body: + application/vnd.ibexa.api.SegmentGroup+xml: + type: SegmentGroup + example: !include examples/segment_groups/identifier/PATCH/SegmentGroup.xml.example + application/vnd.ibexa.api.SegmentGroup+json: + type: SegmentGroupWrapper + example: !include examples/segment_groups/identifier/PATCH/SegmentGroup.json.example + delete: + displayName: Delete a segment group + description: Deletes the segment group. + responses: + 204: + description: Segment group deleted. + 401: + description: Error - the user is not authorized to delete segment groups. + body: + application/vnd.ibexa.api.ErrorMessage+xml: + type: ErrorMessage + application/vnd.ibexa.api.ErrorMessage+json: + type: ErrorMessage + 404: + description: Error - the identifier doesn't match any segment group. + body: + application/vnd.ibexa.api.ErrorMessage+xml: + type: ErrorMessage + application/vnd.ibexa.api.ErrorMessage+json: + type: ErrorMessage /segments: get: displayName: List segment group's segments @@ -57,8 +160,8 @@ get: Accept: description: If set, the segment group is returned in XML or JSON format. example: | - vnd.ibexa.api.SegmentList+xml - vnd.ibexa.api.SegmentList+json + application/vnd.ibexa.api.SegmentList+xml + application/vnd.ibexa.api.SegmentList+json responses: 200: description: OK - list the group's segments. diff --git a/docs/api/rest_api/rest_api_reference/input/ibexa-segments.raml b/docs/api/rest_api/rest_api_reference/input/ibexa-segments.raml index c9c8b86c2b..6898be18e7 100644 --- a/docs/api/rest_api/rest_api_reference/input/ibexa-segments.raml +++ b/docs/api/rest_api/rest_api_reference/input/ibexa-segments.raml @@ -1,4 +1,63 @@ displayName: Segments +post: + displayName: Create a segment + description: Creates a segment. + headers: + Content-Type: + description: A SegmentCreate schema encoded in XML or JSON format. + example: | + application/vnd.ibexa.api.SegmentCreate+xml + application/vnd.ibexa.api.SegmentCreate+json + Accept: + description: A segment is returned in XML or JSON format. + example: | + application/vnd.ibexa.api.Segment+xml + application/vnd.ibexa.api.Segment+json + body: + application/vnd.ibexa.api.SegmentCreate+xml: + type: SegmentCreate + example: !include examples/segments/POST/SegmentCreate.xml.example + application/vnd.ibexa.api.SegmentCreate+json: + type: SegmentCreateWrapper + example: !include examples/segments/POST/SegmentCreate.json.example + responses: + 200: + description: OK - returns new segment's data. + body: + application/vnd.ibexa.api.Segment+xml: + type: Segment + example: !include examples/segments/POST/Segment.xml.example + application/vnd.ibexa.api.Segment+json: + type: SegmentWrapper + example: !include examples/segments/POST/Segment.json.example + 400: + description: Error - input data validation failed. + body: + application/vnd.ibexa.api.ErrorMessage+xml: + type: ErrorMessage + application/vnd.ibexa.api.ErrorMessage+json: + type: ErrorMessage + 401: + description: Error - the user is not authorized to create segments. + body: + application/vnd.ibexa.api.ErrorMessage+xml: + type: ErrorMessage + application/vnd.ibexa.api.ErrorMessage+json: + type: ErrorMessage + 404: + description: Error - segment group with given identifier does not exist. + body: + application/vnd.ibexa.api.ErrorMessage+xml: + type: ErrorMessage + application/vnd.ibexa.api.ErrorMessage+json: + type: ErrorMessage + 406: + description: Error - input data is not acceptable, for example segment identifier is not unique. + body: + application/vnd.ibexa.api.ErrorMessage+xml: + type: ErrorMessage + application/vnd.ibexa.api.ErrorMessage+json: + type: ErrorMessage /{identifier}: get: displayName: Load segment @@ -15,9 +74,90 @@ displayName: Segments body: application/vnd.ibexa.api.Segment+xml: type: Segment + example: !include examples/segments/identifier/GET/Segment.xml.example application/vnd.ibexa.api.Segment+json: type: SegmentWrapper + example: !include examples/segments/identifier/GET/Segment.json.example 401: - description: Error - the user is not authorized to load this group's segments. + description: Error - the user is not authorized to load this segment. 404: - description: Error - the identifier doesn't match any segment group. + description: Error - the identifier doesn't match any segment. + patch: + displayName: Update segment data + description: Updates the segment's data. + headers: + Content-Type: + description: The SegmentUpdate schema encoded in XML or JSON format. + example: | + application/vnd.ibexa.api.SegmentUpdate+xml + application/vnd.ibexa.api.SegmentUpdate+json + Accept: + description: A segment is returned in XML or JSON format. + example: | + application/vnd.ibexa.api.Segment+xml + application/vnd.ibexa.api.Segment+json + body: + application/vnd.ibexa.api.SegmentUpdate+xml: + type: SegmentUpdate + example: !include examples/segments/identifier/PATCH/SegmentUpdate.xml.example + application/vnd.ibexa.api.SegmentUpdate+json: + type: SegmentUpdateWrapper + example: !include examples/segments/identifier/PATCH/SegmentUpdate.json.example + responses: + 200: + description: OK - returns updated segment's data. + body: + application/vnd.ibexa.api.Segment+xml: + type: Segment + example: !include examples/segments/identifier/PATCH/Segment.xml.example + application/vnd.ibexa.api.Segment+json: + type: SegmentWrapper + example: !include examples/segments/identifier/PATCH/Segment.json.example + 400: + description: Error - input data validation failed. + body: + application/vnd.ibexa.api.ErrorMessage+xml: + type: ErrorMessage + application/vnd.ibexa.api.ErrorMessage+json: + type: ErrorMessage + 401: + description: Error - the user is not authorized to create segments. + body: + application/vnd.ibexa.api.ErrorMessage+xml: + type: ErrorMessage + application/vnd.ibexa.api.ErrorMessage+json: + type: ErrorMessage + 404: + description: Error - segment or segment group with given identifier does not exist. + body: + application/vnd.ibexa.api.ErrorMessage+xml: + type: ErrorMessage + application/vnd.ibexa.api.ErrorMessage+json: + type: ErrorMessage + 406: + description: Error - input data is not acceptable, for example segment identifier is not unique. + body: + application/vnd.ibexa.api.ErrorMessage+xml: + type: ErrorMessage + application/vnd.ibexa.api.ErrorMessage+json: + type: ErrorMessage + delete: + displayName: Delete a segment + description: Deletes the segment. + responses: + 204: + description: Segment deleted. + 401: + description: Error - the user is not authorized to delete segments. + body: + application/vnd.ibexa.api.ErrorMessage+xml: + type: ErrorMessage + application/vnd.ibexa.api.ErrorMessage+json: + type: ErrorMessage + 404: + description: Error - the identifier doesn't match any segment. + body: + application/vnd.ibexa.api.ErrorMessage+xml: + type: ErrorMessage + application/vnd.ibexa.api.ErrorMessage+json: + type: ErrorMessage \ No newline at end of file diff --git a/docs/api/rest_api/rest_api_reference/input/ibexa-types.raml b/docs/api/rest_api/rest_api_reference/input/ibexa-types.raml index bc9d3398af..8640e047ad 100644 --- a/docs/api/rest_api/rest_api_reference/input/ibexa-types.raml +++ b/docs/api/rest_api/rest_api_reference/input/ibexa-types.raml @@ -2147,6 +2147,44 @@ Session: description: 'User.' type: BaseObject +SegmentGroupCreate: + description: 'This class represents a new segment group to create.' + type: object + properties: + identifier: + description: 'A unique string identifier for the segment group.' + type: string + required: true + name: + description: 'A name for the segment group.' + type: string + required: true + +SegmentGroupCreateWrapper: + description: 'JSON object with only a SegmentGroupCreate property.' + type: object + properties: + SegmentGroupCreate: SegmentGroupCreate + +SegmentGroupUpdate: + description: 'This class represents an update to an existing segment group.' + type: object + properties: + identifier: + description: 'A unique string identifier for the segment group.' + type: string + required: true + name: + description: 'A new name for the segment group.' + type: string + required: true + +SegmentGroupUpdateWrapper: + description: 'JSON object with only a SegmentGroupUpdate property.' + type: object + properties: + SegmentGroupUpdate: SegmentGroupUpdate + SegmentGroupListWrapper: description: 'JSON object with only a SegmentGroupList property.' type: object @@ -2169,9 +2207,15 @@ SegmentGroup: description: 'This class represents a segment group.' type: BaseObject properties: - id: integer - identifier: string - name: string + id: + description: 'A unique numeric identifier of the segment group.' + type: integer + identifier: + description: 'A unique string identifier of the segment group.' + type: string + name: + description: 'A name of the segment group.' + type: string SegmentListWrapper: description: 'JSON object with only a SegmentList property.' @@ -2195,10 +2239,71 @@ Segment: description: 'This class represents a segment.' type: BaseObject properties: - id: integer - identifier: string - name: string - SegmentGroup: SegmentGroup + id: + description: 'A unique numeric identifier of the segment.' + type: integer + identifier: + description: 'A unique string identifier of the segment.' + type: string + name: + description: 'A name of the segment.' + type: string + SegmentGroup: + description: 'A reference to the segment group to which this segment belongs.' + type: object + properties: + _media-type: + description: 'Media type of the segment group resource.' + type: string + _href: + description: 'A URL reference to the segment group resource.' + type: string + +SegmentCreate: + description: 'This class represents a new segment to create.' + type: object + properties: + identifier: + description: 'A unique string identifier for the segment.' + type: string + required: true + name: + description: 'A name for the segment.' + type: string + required: true + group: + description: 'A string identifier of a segment group to which the segment belongs.' + type: string + required: true + +SegmentCreateWrapper: + description: 'JSON object with only a SegmentCreate property.' + type: object + properties: + SegmentCreate: SegmentCreate + +SegmentUpdate: + description: 'This class represents an update to an existing segment.' + type: object + properties: + identifier: + description: 'A unique string identifier for the segment.' + type: string + required: true + name: + description: 'A new name for the segment.' + type: string + required: true + group: + description: 'A string identifier of a segment group to which the segment belongs.' + type: string + required: true + +SegmentUpdateWrapper: + description: 'JSON object with only a SegmentUpdate property.' + type: object + properties: + SegmentCreate: SegmentUpdate SortClause: description: 'This class is the base for SortClause classes, used to set sorting of content queries.' diff --git a/docs/api/rest_api/rest_api_reference/rest_api_reference.html b/docs/api/rest_api/rest_api_reference/rest_api_reference.html index 0426f217d6..2080240780 100644 --- a/docs/api/rest_api/rest_api_reference/rest_api_reference.html +++ b/docs/api/rest_api/rest_api_reference/rest_api_reference.html @@ -66143,43 +66143,43 @@

Segments

-
+
-

/segments/{identifier}

+

/segments

-
+
-
- Load segment - + data-search="create-a-segment"> + Create a segment +

- GET - /segments/{identifier} + POST + /segments

-

Loads the identified segment.

+

Creates a segment.

Header parameters
-

Accept

-

If set, the segment is returned in XML or JSON

+

Content-Type

+

A SegmentCreate schema encoded in XML or JSON format.

@@ -66204,8 +66204,8 @@
Header parameters
@@ -66213,143 +66213,9 @@
Header parameters
Examples - application/vnd.ibexa.api.Segment+xml -application/vnd.ibexa.api.Segment+json + application/vnd.ibexa.api.SegmentCreate+xml +application/vnd.ibexa.api.SegmentCreate+json
-
- - -
-
Possible responses
-
- - - - - - - - - - - - - - - - - - - - - -
CodeDescription
- - 200 - - -

OK - Return the segment.

-
- 401 - -

Error - the user is not authorized to load this group's segments.

-
- 404 - -

Error - the identifier doesn't match any segment group.

-
-
-
- -
-
Types
-
- - - - - - - - - - - - - - - - - -
TypeDescription
- - Segment - - This class represents a segment.
- - SegmentWrapper - - JSON object with only a Segment property.
-
-
- -
-
- -
-
-
-
-
- -
-
-
-
-
-
- -
-

- Segment groups - -

-
-
-

/segment_groups

- -
-
-
-
-
-
- List segment groups - -
-
-
-

- GET - /segment_groups -

-

Lists segment groups.

-

-
-
Header parameters

Accept

-

If set, the list of segment groups is returned in XML or JSON format.

+

A segment is returned in XML or JSON format.

@@ -66374,8 +66240,8 @@
Header parameters
@@ -66399,24 +66265,57 @@
Possible responses
+ + + + + + + + + + + + @@ -66437,19 +66336,35 @@
Types
- + - + + + + + + + + +
Examples - vnd.ibexa.api.SegmentGroupList+xml -vnd.ibexa.api.SegmentGroupList+json + application/vnd.ibexa.api.Segment+xml +application/vnd.ibexa.api.Segment+json
- 200 -

OK - list the segment groups.

+

OK - returns new segment's data.

- + 400 + + +

Error - input data validation failed.

+
+ 401 -

Error - the user is not authorized to list segment groups.

+

Error - the user is not authorized to create segments.

+
+ + 404 + + +

Error - segment group with given identifier does not exist.

+
+ + 406 + + +

Error - input data is not acceptable, for example segment identifier is not unique.

- - SegmentGroupList + + SegmentCreate This class lists segment groups.This class represents a new segment to create.
- - SegmentGroupListWrapper + + SegmentCreateWrapper JSON object with only a SegmentGroupList property.JSON object with only a SegmentCreate property.
+ + Segment + + This class represents a segment.
+ + SegmentWrapper + + JSON object with only a Segment property.
@@ -66468,30 +66383,213 @@
Types
+
+
+ +
+
+
+
+
+

+ file_copy + +

+
+                                <?xml version="1.0" encoding="UTF-8"?>
+<SegmentCreate>
+  <identifier>segment_identifier</identifier>
+  <name>Segment Name</name>
+  <group>corporate_accounts</group>
+</SegmentCreate>
+
+                            
+
+ View more +
+
+
+

+ file_copy + +

+
+                                {
+    "SegmentCreate": {
+        "identifier": "segment_identifier",
+        "name": "Segment Name",
+        "group": "corporate_accounts"
+    }
+}
+
+                            
+
+ View more +
+
+
+ +
-
+
-
-
-
+
+

file_copy

-
+                            
                                 <?xml version="1.0" encoding="UTF-8"?>
-<SegmentGroupList media-type="application/vnd.ibexa.api.SegmentGroupList+xml" href="/api/ibexa/v2/segment_groups">
- <SegmentGroup media-type="application/vnd.ibexa.api.SegmentGroup+xml" href="/api/ibexa/v2/segment_groups/corporate_accounts">
-  <id>1</id>
-  <identifier>corporate_accounts</identifier>
-  <name>Corporate Accounts</name>
- </SegmentGroup>
-</SegmentGroupList>
+<Segment media-type="application/vnd.ibexa.api.Segment+xml" href="/api/ibexa/v2/segments/segment_identifier">
+    <id>3</id>
+    <identifier>segment_identifier</identifier>
+    <name>Segment Name</name>
+    <SegmentGroup media-type="application/vnd.ibexa.api.SegmentGroup+xml" href="/api/ibexa/v2/segment_groups/corporate_accounts"/>
+</Segment>
 
                             
- View more + View more
-
+

file_copy

-
+                            
                                 {
-    "SegmentGroupList": {
-        "_media-type": "application\/vnd.ibexa.api.SegmentGroupList+json",
-        "_href": "\/api\/ibexa\/v2\/segment_groups",
-        "SegmentGroup": [
-            {
-                "_media-type": "application\/vnd.ibexa.api.SegmentGroup+json",
-                "_href": "\/api\/ibexa\/v2\/segment_groups\/corporate_accounts",
-                "id": 1,
-                "identifier": "corporate_accounts",
-                "name": "Corporate Accounts"
-            }
-        ]
+    "Segment": {
+        "_media-type": "application/vnd.ibexa.api.Segment+json",
+        "_href": "/api/ibexa/v2/segments/segment_identifier",
+        "id": 3,
+        "identifier": "segment_identifier",
+        "name": "Segment Name",
+        "SegmentGroup": {
+            "_media-type": "application/vnd.ibexa.api.SegmentGroup+json",
+            "_href": "/api/ibexa/v2/segment_groups/corporate_accounts"
+        }
     }
-}
+}
+
                             
- View more + View more
-