Skip to main content

Connect to Conscia DX Graph APIs

You can follow these instructions to access Conscia DX Graph APIs.

Determine the DX Graph API Endpoint

Determine a DX Graph API endpoint and generate an API Token for that endpoint.

Review available API endpoint options for DX Graph:

Choose a DX Graph API endpoint, typically one of:

  • https://io-staging.conscia.ai/vue/_api/v1
  • https://io.conscia.ai/vue/_api/v1

Choose a DX Engine API endpoint, typically one of:

  • https://engine-staging.conscia.io/api
  • https://engine.conscia.io/api

Generate an API Token

To generate an API Token to access DX Graph Webservice APIs:

Post the following HTTP headers to https://{host}/graphql, replacing {host} in the URL with the value from the DX Graph API endpoint, {customer-code} in the HTTP header, and {email} and {password} in the following payload:

  • X-Customer-Code: {customer-code}
  • Content-Type: application/json
  • X-Request-Type: GraphQL
query ($input: GenerateOfflineAPIKeyFromCredentialsInput) {
generateOfflineAPIKeyFromCredentials(input: $input)
}

{
"input": {
"username": "{email}",
"password": "{password}"
}
}

Remember to avoid recording an actual DX Graph user email address or password anywhere.

Using https://www.postman.com:

Using Postman to Generate a DX Graph API Token

Configure Your Workstation

Update ~/.profile to set some environment variables to Conscia endpoints. Assuming Conscia staging infrastructure:

export DXG_HOST=io-staging.conscia.ai
export DXG_BASE=https://$DXG_HOST/vue/_api/v1
export DXE_HOST=engine-staging.conscia.ai
export DXE_BASE=https://$DXE_HOST/api

To define these environment varialbes, start a new shell or run these export commands in your shell or source ~/.profile.

Create or update ~/bin/.dxcurlrc, replacing {customer-code} and {token}:

-H "X-Customer-Code: {customer-code}"
-H "Authorization: Bearer {token}"

Confirm that you can invoke DX Graph APIs, retrieve the list of Collections.

curl -X GET -K ~/bin/.dxcurlrc $DXG_BASE/collections