Skip to content

Commit 73ea7e1

Browse files
UI Extension - Improve credentials doc (#1127)
1 parent 80dfbe5 commit 73ea7e1

File tree

3 files changed

+78
-3
lines changed

3 files changed

+78
-3
lines changed

content/extensions/api.md

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,9 @@ Note that the token has a lifespan of one hour.
127127
#### 2. Create a UI extension
128128
You can create a UI extension once you have a valid PIM API token.
129129

130-
```bash [snippet:Shell]
131-
curl --request POST "$TARGET_PIM_URL/api/rest/v1/ui-extensions" \
130+
131+
```bash [snippet:Link]
132+
curl --request POST "$TARGET_PIM_URL/api/rest/v1/ui-extensions" \
132133
--header "Authorization: Bearer $PIM_API_TOKEN" \
133134
--header 'Content-Type: application/json' \
134135
--data-raw '{
@@ -145,6 +146,50 @@ You can create a UI extension once you have a valid PIM API token.
145146
}
146147
}'
147148
```
149+
```bash [snippet:Action]
150+
curl --request POST "$TARGET_PIM_URL/api/rest/v1/ui-extensions" \
151+
--header "Authorization: Bearer $PIM_API_TOKEN" \
152+
--header 'Content-Type: application/json' \
153+
--data-raw '{
154+
"name": "my_awesome_extension",
155+
"version": "V1.03",
156+
"type": "action",
157+
"position": "pim.product.header",
158+
"configuration": {
159+
"url": "https://myapp.com/product",
160+
"default_label": "My awesome extension",
161+
"labels": {
162+
"en_US": "My awesome extension"
163+
},
164+
"secret": "the_secret_need_tobe_32_characthers_long"
165+
},
166+
"credentials": [
167+
{
168+
"type": "Bearer Token",
169+
"value": "your_auth_token"
170+
}
171+
]
172+
}'
173+
```
174+
```bash [snippet:Iframe]
175+
curl --request POST "$TARGET_PIM_URL/api/rest/v1/ui-extensions" \
176+
--header "Authorization: Bearer $PIM_API_TOKEN" \
177+
--header 'Content-Type: application/json' \
178+
--data-raw '{
179+
"name": "my_awesome_extension",
180+
"version": "V1.04",
181+
"type": "iframe",
182+
"position": "pim.product.tab",
183+
"configuration": {
184+
"url": "https://myapp.com/product",
185+
"default_label": "My awesome extension",
186+
"labels": {
187+
"en_US": "My awesome extension",
188+
"fr_FR": "Mon extension géniale"
189+
}
190+
}
191+
}'
192+
```
148193

149194
#### 3. Update a UI extension
150195
To update a UI extension, you must have a valid PIM API token and the UUID of the extension you want to update.

content/swagger/akeneo-web-api.json

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

content/swagger/resources/ui_extensions/routes/ui_extensions_uuid.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,36 @@ patch:
2828
$ref: "../definitions/responses/404not_found.yaml"
2929
422:
3030
$ref: "#/responses/422Error"
31+
post:
32+
summary: Update a UI extension
33+
operationId: "post_ui_extension_uuid"
34+
tags:
35+
- UI Extensions
36+
x-versions:
37+
- "SaaS"
38+
x-ee: true
39+
description: This endpoint allows you to update an existing UI extension. You can send only the fields that you want to update. If a field is not sent, the previous value is kept.
40+
parameters:
41+
- $ref: '#/parameters/uuid'
42+
- name: body
43+
in: body
44+
required: true
45+
schema:
46+
$ref: "#/definitions/UiExtensionWithoutRequired"
47+
responses:
48+
200:
49+
description: 'OK'
50+
x-details: Returns a JSON document representing the UI extension updated
51+
x-examples-per-version:
52+
- x-version: 'SaaS'
53+
x-example:
54+
$ref: ../definitions/examples/ui_extension_patch_response.yaml
55+
400:
56+
$ref: "#/responses/400IncorrectUuid"
57+
404:
58+
$ref: "../definitions/responses/404not_found.yaml"
59+
422:
60+
$ref: "#/responses/422Error"
3161
delete:
3262
summary: Delete a UI extension
3363
operationId: "delete_ui_extension_uuid"

0 commit comments

Comments
 (0)