CompanionCompanion
Companion for Delivery
Companion for Business
Companion for Integration
Contact us
Companion for Delivery
Companion for Business
Companion for Integration
Contact us
  • Companion for Integration

    • Introduction
    • Getting Started
    • Configuration
    • Excel templating
    • How it works
  • YAML Configuration

    • Principles
    • Syntax
    • Validation
  • Custom Functions

    • Summary
    • arrayToJSON
    • bool
    • concatValueAndUnit
    • convertUnit
    • currentContextId
    • exportTime
    • eval
    • firstNonEmpty
    • getContextName
    • getEvents
    • getLastEventTime
    • getReferencesByAttributeGroup
    • getStoredValue
    • getWorkspaceId
    • hash
    • hasStoreKey
    • if
    • integer
    • join
    • mergeInheritedValues
    • multiValuesToJSON
    • number
    • nodeList
    • order
    • resolveUnitLabel
    • serializeAssetPushLocationsToJSON
    • serializeAttributeLinksToJSON
    • serializeContextReferenceToJSON
    • serializeContextReferencesToJSON
    • serializeContextValuesToJSON
    • serializeDataContainerToJSON
    • serializeDataContainersToJSON
    • serializeListOfValueValuesToJSON
    • serializeReferencesToJSON
    • serializeReferenceToJSON
    • serializeValuesToJSON
    • store
    • toXML
    • uppercase
  • Execution

    • Summary
    • Composite
    • From STEP
    • Standalone
    • Performance statistics
  • Configuration

    • ActiveMQ extension
    • Amazon AWS extension (SNS, SQS, Kinesis, S3)
    • ElasticSearch/OpenSearch extension
    • File extension (Excel, CSV, JSON, XML, JSONL, XMLL)
    • Kafka extension
    • Kafka Core extension
    • MongoDB/Cosmos DB extension
    • SQL extension
    • REST extension
    • Google Pub/Sub extension
  • c4i SaaS

    • Introduction
    • Managing jobs
    • Managing executions
    • Managing users
    • Changelog
  • Changelog

    • Core features changelog
    • ActiveMQ extension changelog
    • Amazon AWS extension changelog
    • Composite extension changelog
    • ElasticSearch extension changelog
    • File extension changelog
    • Kafka extension changelog
    • Kafka Core extension changelog
    • MongoDB/Cosmos DB extension changelog
    • SQL extension changelog
    • REST extension changelog
    • Google Pub/Sub extension changelog

REST extension

Plugin ID

The plugin ID for REST API is fr.cantor.c4i.RESTDelivery.

Properties

Environment independent parameters (set in extension configuration or properties file)

Property keyDescriptionMandatoryDefault value
configAssetIdThe ID of the asset containing the YAML mappingsYes
connectionThe name of the connection in the c4i.properties fileYes
isKeyInURLtrue to send each object in a single request with the object ID in the URL, false otherwise. Use {id} in URL templateYes
batchSizeThe maximum number of elements to send in a single queryYes
authenticationModeNONE, BASIC_AUTH, API_KEY_TOKEN, API_KEY_BEARER, X_API_KEY, OAUTH2_CLIENT_CREDENTIALS or CUSTOM_TOKENNoNONE
contentTypeContent-Type header value. Authorized values are APPLICATION_JSON (application/json) and TEXT_PLAIN (text/plain;charset=UTF-8)Yes
outputFormatCSV, EXCEL, JSON, JSONL, XML or XMLLYes
headers.{headerName}Any additional header to send in the HTTP call. See section "Headers templating" for more infoNo
lastBatchHeaderIf a value is provided, then the last batch for an object type will have this value as a header. It may produce an additional REST call with an empty bodyNo
cacheConfigThe ID of the asset containing the JCS configurationNo
displayPerfStattrue to display performance statistics (see Performance statistics dedicated page)Nofalse

Environment dependent parameters (set in centralized c4i.properties file)

Property keyDescriptionMandatoryDefault value
destinationURLURL of the target REST API. See section "URL templating" for more infoYes
authenticationModeNONE, BASIC_AUTH, API_KEY_TOKEN, API_KEY_BEARER, X_API_KEY, OAUTH2_CLIENT_CREDENTIALS or CUSTOM_TOKENNoNONE
usernameThe username (Basic Auth) or Client ID (OAuth2)No
passwordThe password (Basic Auth), API Key or Client Secret (OAuth2) in standalone mode onlyNo
readTimeoutThe maximum time of inactivity between two data packets when waiting for the server's response in secondsNo
oAuth2TokenEndpointThe endpoint to retrieve the OAuth2 tokenIf authenticationMode is OAUTH2_CLIENT_CREDENTIALS or CUSTOM_TOKEN
oAuth2ScopeThe OAuth2 token scopeNo
loginQueryScriptThe Asset ID/File path of the script to use to build the custom token callIf authenticationMode is CUSTOM_TOKEN
tokenExtractorScriptThe Asset ID/File path of the script to use to extract the token from the custom token call responseIf authenticationMode is CUSTOM_TOKEN
tokenHeaders.{headerName}Any additional header to send in the custom HTTP token request call.No

Notes

All HTTP queries are performed using the POST method.

Configuration example

URL templating

The target URL can be templated with :

  1. Context ID using the variable {contextId}
  2. Destination name from YAML configuration file using the variable {destination}
  3. Object ID using the variable {id}

For instance, given the following URL tempate : http://my-web-server.com/{destination}?lang={contextId},

And using the following YAML configuration file :

- Product:
    products[id]:
      ...

- Entity:
    entities[id]:
      ...

While parsing a file in the context fr_FR,

Products will be sent to the following URL : http://my-web-server.com/products?lang=fr_FR.

Entities will be sent to the following URL : http://my-web-server.com/entities?lang=fr_FR.

Using the following URL template : http://my-web-server.com/{destination}/{id}?lang={contextId},

The product with ID PRD0001 will be sent to the following URL : http://my-web-server.com/products/PRD0001?lang=fr_FR.

Header templating

The headers can be templated with the following values :

  • {uuid} : Will generate a unique ID to link all the batches of the same execution

Custom token authentication

When using CUSTOM_TOKEN authentication, you must provide two additional Javascript script parameters, loginQueryScript and tokenExtractorScript.

The first one is used to construct the body of the authentication request. It accepts the following parameters : endpoint, username, password, scope

Example :

function getLoginQueryBody(username, password)
{
    return {
        "username": username,
        "password": password
    };
}
getLoginQueryBody(username, password);

The second one is used to extract the token from the authentication request response. It accepts a single JSON parameter.

Example :

function extractToken(token)
{
    return token.token_type + " " + token.access_token;
}

extractToken(token);
Last Updated: 9/17/25, 2:49 PM
Prev
SQL extension
Next
Google Pub/Sub extension