Skip to content

Commit 9602700

Browse files
authored
Merge pull request #668 from akeneo/API-1867
fix(API-1867): update catalogs doc + update postman api export
2 parents 278f28f + eb2cf14 commit 9602700

File tree

7 files changed

+31
-9
lines changed

7 files changed

+31
-9
lines changed

content/files/Akeneo PIM API.postman_collection.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"header": [
1616
{
1717
"key": "Authorization",
18-
"value": "Bearer {{token}}"
18+
"value": "Bearer {{appToken}}"
1919
}
2020
],
2121
"url": {
@@ -42,7 +42,7 @@
4242
"header": [
4343
{
4444
"key": "Authorization",
45-
"value": "Bearer {{token}}"
45+
"value": "Bearer {{appToken}}"
4646
}
4747
],
4848
"url": {
@@ -67,7 +67,7 @@
6767
"header": [
6868
{
6969
"key": "Authorization",
70-
"value": "Bearer {{token}}"
70+
"value": "Bearer {{appToken}}"
7171
},
7272
{
7373
"key": "Content-Type",
@@ -100,7 +100,7 @@
100100
"header": [
101101
{
102102
"key": "Authorization",
103-
"value": "Bearer {{token}}"
103+
"value": "Bearer {{appToken}}"
104104
},
105105
{
106106
"key": "Content-Type",
@@ -134,7 +134,7 @@
134134
"header": [
135135
{
136136
"key": "Authorization",
137-
"value": "Bearer {{token}}"
137+
"value": "Bearer {{appToken}}"
138138
},
139139
{
140140
"key": "Content-Type",
@@ -164,7 +164,7 @@
164164
"header": [
165165
{
166166
"key": "Authorization",
167-
"value": "Bearer {{token}}"
167+
"value": "Bearer {{appToken}}"
168168
}
169169
],
170170
"url": {
@@ -185,7 +185,8 @@
185185
},
186186
"response": []
187187
}
188-
]
188+
],
189+
"description": "App catalog\" folder: \"Make sure the variable \"appToken\" is completed before calling the API with Catalog endpoints."
189190
},
190191
{
191192
"name": "Association type (>= v2)",
@@ -5093,4 +5094,4 @@
50935094
}
50945095
}
50955096
]
5096-
}
5097+
}

content/swagger/akeneo-web-api.json

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

content/swagger/resources/app_catalogs/routes/app_catalogs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ get:
66
- Catalogs
77
x-versions:
88
- "SaaS"
9+
x-app-token: true
910
parameters:
1011
- $ref: '#/parameters/page'
1112
- name: limit
@@ -73,6 +74,7 @@ post:
7374
- Catalogs
7475
x-versions:
7576
- "SaaS"
77+
x-app-token: true
7678
description: This endpoint allows you to create a new catalog.
7779
parameters:
7880
- name: body

content/swagger/resources/app_catalogs/routes/app_catalogs_id.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ get:
66
- Catalogs
77
x-versions:
88
- "SaaS"
9+
x-app-token: true
910
parameters:
1011
- name: id
1112
in: path
@@ -31,6 +32,7 @@ patch:
3132
- Catalogs
3233
x-versions:
3334
- "SaaS"
35+
x-app-token: true
3436
description: This endpoint allows you to update a catalog.
3537
parameters:
3638
- name: id
@@ -65,6 +67,7 @@ delete:
6567
- Catalog
6668
x-versions:
6769
- "SaaS"
70+
x-app-token: true
6871
description: This endpoint allows you to delete a catalog.
6972
parameters:
7073
- name: id

content/swagger/resources/app_catalogs/routes/app_catalogs_id_product_uuids.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ get:
66
- Catalog products
77
x-versions:
88
- "SaaS"
9+
x-app-token: true
910
parameters:
1011
- name: id
1112
in: path

src/api-reference/reference.handlebars

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@
6565
{{#each categories as |category categoryId|}}
6666
<a class="anchor" id="{{{categoryId}}}"></a>
6767
<h1>{{{categoryName}}}{{#if categoryDeprecated}}<em> - Deprecated</em>{{/if}}</h1>
68+
{{#if isAppCategory}}
69+
<div class="alert alert-warning">
70+
<p>Make sure you have a valid App token with scopes related to catalogs authorized in order to use the following endpoints. You can find information about these scopes in the section <a href="/apps/catalogs.html#step-1-ask-for-catalog-scopes">ask for catalog scopes</a></p>
71+
</div>
72+
{{/if}}
6873
{{#if categoryDeprecated}}
6974
<div class="alert alert-warning">
7075
<p>With the introduction of our new way to handle assets, the Asset Manager, the PAM feature will be removed from the v4.0 of the PIM. As a result, from now on, <b>all the endpoints regarding the PAM assets are deprecated</b>. They will not be available anymore starting from the v4.0.<br/>To understand why, we recommend you to read this <a href="https://medium.com/akeneo-labs/between-stability-and-innovation-c2d2dd61a804">Medium post</a>, we wrote on this special occasion.<br/>Also, don't hesitate to take a look at the <a href="/documentation/asset-manager.html">Asset Manager documentation</a> to discover this new feature and how much more efficient it will be to handle your precious assets.</p>
@@ -148,7 +153,11 @@
148153
<p>
149154
<code>Authorization</code>
150155
<a href="#" data-placement="top" data-toggle="tooltip" title="Required header"> <i class="fa fa-asterisk fa-danger"></i> </a>
156+
{{#if x-app-token}}
157+
<small>&bull; Equal to 'Bearer xxx', 'xxx' being the App authentication token, see <a href="/apps/apps-getting-started.html" target="_blank">documentation for getting an app token</a></small>
158+
{{else}}
151159
<small>&bull; Equal to 'Bearer xxx', `xxx` being the authentication token, see <a href="/documentation/authentication.html">Authentication</a> section</small>
160+
{{/if}}
152161
</p>
153162
{{/unless}}
154163
{{#if x-body-by-line}}

tasks/reference.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ gulp.task('reference', ['clean-dist', 'less'], function() {
137137
if (!data.categories[escapeCategory].resources[escapeTag]) {
138138
data.categories[escapeCategory].resources[escapeTag] = { resourceName: operation.tags[0], operations: {}};
139139
}
140+
if(category.includes('Catalogs for Apps')) {
141+
data.categories[escapeCategory].isAppCategory = true;
142+
}
140143
data.categories[escapeCategory].resources[escapeTag].operations[operation.operationId] = _.extend(operation, {
141144
verb: verb,
142145
path: pathUri
@@ -182,6 +185,9 @@ gulp.task('reference', ['clean-dist', 'less'], function() {
182185
if (!data.categories[escapeCategory].resources[escapeTag]) {
183186
data.categories[escapeCategory].resources[escapeTag] = { resourceName: operation.tags[0], operations: {}};
184187
}
188+
if(category.includes('Catalogs for Apps')) {
189+
data.categories[escapeCategory].isAppCategory = true;
190+
}
185191
var groupedParameters = _.groupBy(operation.parameters, function(parameter) {
186192
return parameter.in;
187193
});

0 commit comments

Comments
 (0)