Creating an Indexing Pipeline Extension With the API
Creating an Indexing Pipeline Extension With the API
The following procedure describes how to create an indexing pipeline extension (IPE) for a Coveo organization using the Extension API.
On the Coveo Administration Console API Keys (platform-ca | platform-eu | platform-au) page, add an API key to which you grant the privilege to edit extensions (that is, the Edit access level for the Extensions domain) (see Manage privileges).
Create an extension for your organization.
-
Use the following API call:
POST https://platform.cloud.coveo.com/rest/organizations/<ORGANIZATION_ID>/extensions HTTP/1.1
where you replace
<ORGANIZATION_ID>
with its corresponding value. -
Your call must include the following HTTP headers:
Key Value Authorization
Bearer <VALID_API_KEY>
Content-Type
application/json
-
The body configures the extension, and it must include a name and description (see Create extension).
ExampleThe following JSON adds metadata:
{ "content": "document.add_meta_data({'userId':'YOUR_USER_ID'})", "description": "This extension adds metadata...", "name": "Adding the userId metadata" }
where the
content
value is the body of your extension (user script), written in Python using thedocument
object (see Document Object Python API Reference).NoteChoose a meaningful name (such as the name of the task that you want to perform) to identify your extension.
-
Send your request. It returns something like this:
{ "content": "document.add_meta_data({'userId':'YOUR_USER_ID'})", "description": "This extension adds metadata...", "enabled": true, "id": "coveosearch-rlic35pr6jhvtx84ta855bdj5j", "lastModified": 2588768294677, "name": "Adding the userId metadata", "versionId": "e3AOSVbGdwYus82z3gduTVPRqbXzidJg", "status": { "durationHealth": { "healthIndicator": "UNKNOWN" }, "dailyStatistics": { "averageDurationInSeconds": 0, "numberOfExecutions": 0, "numberOfSkips": 0, "numberOfTimeouts": 0 }, "disabledStatus": {}, "timeoutHealth": { "healthIndicator": "UNKNOWN" } } }
where the
id
value is your unique extension identifier (extensionId
).
On the Administration Console Activity Browser (platform-ca | platform-eu | platform-au) page, validate that your extension was successfully created.
-
In the Sections facet, select Content.
-
In the Resource Types facet that appears, select Extensions.
-
In the Resources facet, select your extension ID.
-
In the Result column, validate that your operation is successful.