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, create 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 for details.
Create an extension for your organization.
-
Use the following API call:
POST https://platform.cloud.coveo.com/rest/organizations/<ORGANIZATION_ID>/extensions HTTP/1.1where you replace
<ORGANIZATION_ID>with its corresponding value. -
Your call must include the following HTTP headers:
Key Value AuthorizationBearer <VALID_API_KEY>Content-Typeapplication/json -
The request body configures the extension, and it must include a name and description. See Create extension for details on the accepted body parameters. For example:
{ "apiVersion": "v2","content": "document.add_meta_data({'userId':'YOUR_USER_ID'})",
"description": "This extension adds metadata...", "name": "Adding the userId metadata"
}
The apiVersionkey specifies the version of the API to use.The contentkey specifies the body of your extension (user script), written in Python using thedocumentobject.Choose a meaningful name for your extension, such as the name of the task that you want to perform. -
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
idvalue 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.