Skip to content

Commit b82d786

Browse files
authored
Merge pull request #618 from akeneo/CXP-1206
CXP-1206: App Catalogs endpoints and scopes
2 parents 4a784ee + e4741ae commit b82d786

12 files changed

+485
-2
lines changed

content/apps/access-scopes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ it's a feature only available in the Enterprise edition.
3333
| `write_channel_settings` | Write channels |
3434
| `read_association_types` | Read association types |
3535
| `write_association_types` | Write association types |
36+
| `read_catalogs` | Read app catalogs |
37+
| `write_catalogs` | Write app catalogs |
38+
| `delete_catalogs` | Remove app catalogs |
3639
| `read_asset_families` <span class="label label-ee">EE</span> | Read asset families |
3740
| `write_asset_families` <span class="label label-ee">EE</span> | Write assets families |
3841
| `read_assets` <span class="label label-ee">EE</span> | Read assets |

content/files/Akeneo PIM API.postman_collection.json

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,188 @@
55
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
66
},
77
"item": [
8+
{
9+
"name": "App Catalogs",
10+
"item": [
11+
{
12+
"name": "catalog",
13+
"request": {
14+
"method": "GET",
15+
"header": [
16+
{
17+
"key": "Authorization",
18+
"value": "Bearer {{token}}"
19+
}
20+
],
21+
"url": {
22+
"raw": "{{url}}/api/rest/v1/catalogs/6c046434-4501-4f85-94b7-d0194b3d9fb1",
23+
"host": [
24+
"{{url}}"
25+
],
26+
"path": [
27+
"api",
28+
"rest",
29+
"v1",
30+
"catalogs",
31+
"6c046434-4501-4f85-94b7-d0194b3d9fb1"
32+
]
33+
},
34+
"description": "Assuming that the given uuid is the unique identifier of an existing catalog"
35+
},
36+
"response": []
37+
},
38+
{
39+
"name": "catalogs",
40+
"request": {
41+
"method": "GET",
42+
"header": [
43+
{
44+
"key": "Authorization",
45+
"value": "Bearer {{token}}"
46+
}
47+
],
48+
"url": {
49+
"raw": "{{url}}/api/rest/v1/catalogs",
50+
"host": [
51+
"{{url}}"
52+
],
53+
"path": [
54+
"api",
55+
"rest",
56+
"v1",
57+
"catalogs"
58+
]
59+
}
60+
},
61+
"response": []
62+
},
63+
{
64+
"name": "catalog",
65+
"request": {
66+
"method": "POST",
67+
"header": [
68+
{
69+
"key": "Authorization",
70+
"value": "Bearer {{token}}"
71+
},
72+
{
73+
"key": "Content-Type",
74+
"value": "application/json"
75+
}
76+
],
77+
"body": {
78+
"mode": "raw",
79+
"raw": "{\n \"name\": \"Store US\"\n}"
80+
},
81+
"url": {
82+
"raw": "{{url}}/api/rest/v1/catalogs",
83+
"host": [
84+
"{{url}}"
85+
],
86+
"path": [
87+
"api",
88+
"rest",
89+
"v1",
90+
"catalogs"
91+
]
92+
}
93+
},
94+
"response": []
95+
},
96+
{
97+
"name": "catalog",
98+
"request": {
99+
"method": "PATCH",
100+
"header": [
101+
{
102+
"key": "Authorization",
103+
"value": "Bearer {{token}}"
104+
},
105+
{
106+
"key": "Content-Type",
107+
"value": "application/json"
108+
}
109+
],
110+
"body": {
111+
"mode": "raw",
112+
"raw": "{\n \"name\": \"New Store US\"\n}"
113+
},
114+
"url": {
115+
"raw": "{{url}}/api/rest/v1/catalogs/6c046434-4501-4f85-94b7-d0194b3d9fb1",
116+
"host": [
117+
"{{url}}"
118+
],
119+
"path": [
120+
"api",
121+
"rest",
122+
"v1",
123+
"catalogs",
124+
"6c046434-4501-4f85-94b7-d0194b3d9fb1"
125+
]
126+
}
127+
},
128+
"response": []
129+
},
130+
{
131+
"name": "catalog",
132+
"request": {
133+
"method": "DELETE",
134+
"header": [
135+
{
136+
"key": "Authorization",
137+
"value": "Bearer {{token}}"
138+
},
139+
{
140+
"key": "Content-Type",
141+
"value": "application/json"
142+
}
143+
],
144+
"url": {
145+
"raw": "{{url}}/api/rest/v1/catalogs/6c046434-4501-4f85-94b7-d0194b3d9fb1",
146+
"host": [
147+
"{{url}}"
148+
],
149+
"path": [
150+
"api",
151+
"rest",
152+
"v1",
153+
"catalogs",
154+
"6c046434-4501-4f85-94b7-d0194b3d9fb1"
155+
]
156+
}
157+
},
158+
"response": []
159+
},
160+
{
161+
"name": "catalog product uuids",
162+
"request": {
163+
"method": "GET",
164+
"header": [
165+
{
166+
"key": "Authorization",
167+
"value": "Bearer {{token}}"
168+
}
169+
],
170+
"url": {
171+
"raw": "{{url}}/api/rest/v1/catalogs/6c046434-4501-4f85-94b7-d0194b3d9fb1/product-uuids",
172+
"host": [
173+
"{{url}}"
174+
],
175+
"path": [
176+
"api",
177+
"rest",
178+
"v1",
179+
"catalogs",
180+
"6c046434-4501-4f85-94b7-d0194b3d9fb1",
181+
"product-uuids"
182+
]
183+
},
184+
"description": "Assuming that the given uuid is the unique identifier of an existing catalog"
185+
},
186+
"response": []
187+
}
188+
]
189+
},
8190
{
9191
"name": "Association type (>= v2)",
10192
"item": [

content/swagger/akeneo-web-api.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

content/swagger/definitions.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ProductExamples:
55
ProductList:
66
type: object
77
allOf:
8-
- $ref: '#/definitions/ItemList'
8+
- $ref: '#/definitions/ItemList'
99
- $ref: '#/definitions/Product'
1010

1111
ProductModel:
@@ -235,6 +235,12 @@ AssetItemList:
235235
type: string
236236
description: URI of the resource
237237

238+
AppCatalogList:
239+
type: object
240+
allOf:
241+
- $ref: '#/definitions/ItemList'
242+
- $ref: ./resources/app_catalogs/definitions/app_catalog.yaml
243+
238244
Error:
239245
type: object
240246
properties:

content/swagger/paths.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,13 @@
152152
/api/rest/v1/asset-tags/{code}:
153153
$ref: ./resources/deprecated/asset_tags/routes/asset_tags_code.yaml
154154

155+
/api/rest/v1/catalogs:
156+
$ref: ./resources/app_catalogs/routes/app_catalogs.yaml
157+
/api/rest/v1/catalogs/{id}:
158+
$ref: ./resources/app_catalogs/routes/app_catalogs_id.yaml
159+
/api/rest/v1/catalogs/{id}/product-uuids:
160+
$ref: ./resources/app_catalogs/routes/app_catalogs_id_product_uuids.yaml
161+
155162
/api/rest/v1:
156163
$ref: ./resources/list_endpoints.yaml
157164

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
type: object
2+
properties:
3+
id:
4+
type: string
5+
description: App catalog id
6+
x-immutable: true
7+
name:
8+
type: string
9+
description: App catalog name
10+
enabled:
11+
type: boolean
12+
description: Whether the app catalog is enabled or not
13+
default: false
14+
example: {
15+
"id": "12351d98-200e-4bbc-aa19-7fdda1bd14f2",
16+
"name": "My app catalog",
17+
"enabled": false
18+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
type: object
2+
required: ["name"]
3+
properties:
4+
name:
5+
type: string
6+
description: App catalog name
7+
example: {
8+
"name": "My app catalog"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
type: object
2+
required: ["name"]
3+
properties:
4+
name:
5+
type: string
6+
description: App catalog name
7+
example: {
8+
"name": "My app catalog"
9+
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
get:
2+
summary: Get the list of owned catalogs
3+
operationId: "get_app_catalogs"
4+
description: This endpoint allows you to get the list of catalogs you owned.
5+
tags:
6+
- App catalog
7+
x-versions:
8+
- "SaaS"
9+
parameters:
10+
- $ref: '#/parameters/page'
11+
- name: limit
12+
in: query
13+
description: Number of results by page, see <a href="/documentation/pagination.html">Pagination</a> section
14+
required: false
15+
type: integer
16+
minimum: 1
17+
maximum: 100
18+
default: 100
19+
responses:
20+
200:
21+
description: Return the paginated catalogs owned by the user making the request
22+
schema:
23+
title: Catalogs
24+
type: object
25+
allOf:
26+
- $ref: '#/definitions/Pagination'
27+
- properties:
28+
_embedded:
29+
type: object
30+
properties:
31+
items:
32+
type: array
33+
items:
34+
$ref: '#/definitions/AppCatalogList'
35+
x-examples: {
36+
_links: {
37+
self: {
38+
href: "https://demo.akeneo.com/api/rest/v1/catalogs?page=3&limit=2"
39+
},
40+
first: {
41+
href: "https://demo.akeneo.com/api/rest/v1/catalogs?page=1&limit=2"
42+
},
43+
previous: {
44+
href: "https://demo.akeneo.com/api/rest/v1/catalogs?page=2&limit=2"
45+
},
46+
next: {
47+
href: "https://demo.akeneo.com/api/rest/v1/catalogs?page=4&limit=2"
48+
}
49+
},
50+
current_page: 3,
51+
_embedded: {
52+
items: [
53+
{
54+
"id": "12351d98-200e-4bbc-aa19-7fdda1bd14f2",
55+
"name": "Store FR",
56+
"enabled": false
57+
},{
58+
"id": "092c5f22-ecd8-485f-97e9-3b78098e1386",
59+
"name": "Store US",
60+
"enabled": true
61+
}
62+
]
63+
}
64+
}
65+
401:
66+
$ref: "#/responses/401Error"
67+
403:
68+
$ref: "#/responses/403Error"
69+
post:
70+
summary: Create a new catalog
71+
operationId: "post_app_catalog"
72+
tags:
73+
- App catalog
74+
x-versions:
75+
- "SaaS"
76+
description: This endpoint allows you to create a new catalog.
77+
parameters:
78+
- name: body
79+
in: body
80+
schema:
81+
$ref: ../definitions/app_catalog_creation.yaml
82+
responses:
83+
201:
84+
description: Created
85+
x-details: Means that the creation was successful
86+
schema:
87+
$ref: ../definitions/app_catalog.yaml
88+
401:
89+
$ref: "#/responses/401Error"
90+
403:
91+
$ref: "#/responses/403Error"
92+
415:
93+
$ref: "#/responses/415Error"
94+
422:
95+
$ref: "#/responses/422Error"

0 commit comments

Comments
 (0)