Use cURL to Change the Type of an Orchestration Component in the DX Engine

  • You can use the cURL command line tool to invoke the Conscia Webservice API that updates the definition of an Orchestration Component in the DX Engine. This allows you to update the Component definition, including changing the Type of a Component.

Determine an Endpoint and Obtain an Access Token

Determine an API endpoint and obtain an access token as described here:

Create the Replacement Component

Use DX Studio to create a Component of any type that will replace the existing Component. Alternatively, use the definition of an existing Component to define a new Component. Use the following instructions to obtain the JSON representation of this Component.

Get the Component Codes

You can use a command such as the following to retrieve all existing Component definitions.

curl -X GET -H 'X-Customer-Code: {customer-code}' -H 'Authorization: Bearer {token}' https://engine-staging.conscia.io/api/experience/components

Get Individual Component Definition

You can use a command such as the following to retrieve an existing Component definition.

curl -X PUT -H 'X-Customer-Code: ' -H 'Authorization: Bearer {token}' https://engine-staging.conscia.io/api/experience/components/{component-code}

You can redirect the output of this to a file:

curl -X PUT -H 'X-Customer-Code: ' -H 'Authorization: Bearer {token}' https://engine-staging.conscia.io/api/experience/components/{component-code}

Update Component Definition

You can use a command such as the following to update an existing Component definition, where {component-definition} is the JSON representation of a Component as returned by the previous APIs.

curl -X PUT -H 'X-Customer-Code: {customer-code}' -H 'Authorization: Bearer {token}' https://engine-staging.conscia.io/api/experience/components/{component-code} -H 'Content-type: application/json' -d '{"component": {component-definition}}'

To change the Type of an existing Component:

  • Retrieve the definition of another existing component of the Component Type to use in the existing Component.
  • Replace the value of componentCode in that JSON with the Component code of the existing Component.
  • Use the the Component code of the existing Component as {component-code} in the URL and pass that JSON as {component-definition} on the command line above. This replaces all data within the Component without breaking dependencies between Components.

One thought on “Use cURL to Change the Type of an Orchestration Component in the DX Engine

Leave a comment