neclimdul/coveo-field-api

API for Coveo Platform

2.0.0-alpha1 2024-10-21 14:15 UTC

This package is auto-updated.

Last update: 2024-10-22 18:32:36 UTC


README

API for Coveo Platform

For more information, please visit https://connect.coveo.com/s/discussions.

Installation & Usage

Requirements

PHP 8.1 and later.

Composer

To install the bindings via Composer, add the following to composer.json:

composer require neclimdul/coveo-field-api

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

use NecLimDul\Coveo\FieldApi\ApiException;

// Configure OAuth2 access token for authorization: oauth2
$config = \NecLimDul\Coveo\FieldApi\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new \NecLimDul\Coveo\FieldApi\Api\FieldsApi(
    // If you want to use custom http client, pass your client which implements `\GuzzleHttp\ClientInterface`.
    // This is optional, `\GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$organization_id = 'organization_id_example'; // string | The unique identifier of the target [organization](https://docs.coveo.com/en/185/).<br /><b>Example:</b> `mycoveocloudv2organizationg8tp8wu3`
$field_model = new \NecLimDul\Coveo\FieldApi\Model\FieldModel(); // \NecLimDul\Coveo\FieldApi\Model\FieldModel

try {
    $apiInstance->createField($organization_id, $field_model);
} catch (ApiException $e) {
    echo 'Exception when calling FieldsApi->createField: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://platform.cloud.coveo.com

ClassMethodHTTP requestDescription
FieldsApicreateFieldPOST /rest/organizations/{organizationId}/indexes/fieldsCreate field
FieldsApicreateFieldsPOST /rest/organizations/{organizationId}/indexes/fields/batch/createCreate fields
FieldsApicreateFieldsBatchPOST /rest/organizations/{organizationId}/indexes/fields/batch/create/resultsCreate fields with individual results
FieldsApigetFieldGET /rest/organizations/{organizationId}/indexes/fields/{fieldId}Show field
FieldsApigetFieldsPOST /rest/organizations/{organizationId}/indexes/fields/searchList fields
FieldsApiremoveFieldDELETE /rest/organizations/{organizationId}/indexes/fields/{fieldId}Delete field
FieldsApiremoveFieldsDELETE /rest/organizations/{organizationId}/indexes/fields/batch/deleteDelete fields
FieldsApiremoveFieldsBatchDELETE /rest/organizations/{organizationId}/indexes/fields/batch/delete/resultsDelete fields with individual results
FieldsApiupdateFieldPUT /rest/organizations/{organizationId}/indexes/fields/{fieldId}Update field
FieldsApiupdateFieldsPUT /rest/organizations/{organizationId}/indexes/fields/batch/updateUpdate fields
FieldsApiupdateFieldsBatchPUT /rest/organizations/{organizationId}/indexes/fields/batch/update/resultsUpdate fields with individual results

Models

Authorization

oauth2

  • Type: OAuth
  • Flow: implicit
  • Authorization URL: https://platform.cloud.coveo.com/oauth/authorize
  • Scopes:
    • full: required

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen