POST /extensions
Create a new Extension in a provided project
Servers
- https://api.optimizely.com/v2
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
| Name | Type | Required | Description |
|---|---|---|---|
id |
Integer | No |
The unique identifier for the extension |
implementation |
Object | Yes | |
implementation.reset_js |
String | No |
Reset JS is used to "clean up" after a extension. It's used in the editor, when changing field values or removing an existing extension. Reset JS should remove the element and any other side-effects |
implementation.html |
String | No |
The html implementation of the field |
implementation.css |
String | No |
Some extensions may not need any CSS because they inherit styles from the page itself. However, you can add additional styling here. This will be injected on the page through a |
implementation.apply_js |
String | No |
The Apply JS code is used to inject the extension onto the page |
project_id |
Integer | Yes |
The project the extension is in |
created |
String | No |
The time when the extension was initially created |
name |
String | Yes |
Name of the extension |
archived |
Boolean | No |
Whether the extension is archived |
description |
String | No |
The description for the extension |
last_modified |
String | No |
The last time when the extension was modified |
enabled |
Boolean | No |
Whether the extension is enabled. A disabled extension won't appear in the editor and won't be built into the snippet |
fields[] |
Array | No |
Array of editable fields in the extension |
fields[].default_value |
String | Yes |
A string in JSON format that corresponds to the default_value of the field |
fields[].api_name |
String | Yes |
The API name of the field |
fields[].options |
Object | No | |
fields[].options.choices[] |
Array | No |
The choices for a field |
fields[].options.choices[].label |
String | No |
label of the choice |
fields[].options.choices[].value |
String | No |
value of the choice |
fields[].field_type |
String | Yes |
The type of the field Valid values:
|
fields[].label |
String | Yes |
The label of the field |
edit_url |
String | Yes |
The URL to load when editing the extension |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.