API Source

Loading data from any system

API sources are used to represent various systems contributing data to your DCN. Examples of systems from which you may be sourcing data into an API source include DMPs, CDPs, CRMs, and private databases.

Creating an API Source

You can create a new API source from your DCN UI or using the CLI by running optable-cli source create api <name>, for example:

$ optable-cli source create api my-example-source
  "id":  5,
  "name":  "my-example-source",
  "kind": "SOURCE_KIND_API",
  "created_at": "2021-05-17T16:53:39.985326671Z",
  "updated_at": "2021-05-17T16:53:39.985326671Z",
  "expiry": "0s",
  "insights_history": {}

On success, the CLI displays a description of the newly created API source in JSON. You can then push data into the source referring to its displayed id as described below.

Specifying Data Expiry

You can specify a data expiry time when creating the API source with the --expiry option. The default is that loaded data should never expire. Otherwise the option accepts a positive integer suffixed with either s, m, or h to indicate the amount of time elapsed since the last record update (in seconds, minutes, or hours, respectively) until loaded data is automatically purged.

You can also update the --expiry value by updating your API source with the optable-cli source update api command.

Listing API Sources

You can list all API sources with the CLI by running the optable-cli source list command. The command returns a list of sources encoded in JSON. You can use the excellent jq utility to parse and manipulate JSON from the command line. For example, to list just the names of all API sources:

$ optable-cli source list | jq 'select(.kind == "SOURCE_KIND_API") | .name'

Loading ID Profiles

You can push ID profile data into an existing API source using the CLI by running optable-cli source push <id> --format=<format> where <format> can be id, jsonl or csv.

Examples of how you can structure and load ID profile data through the CLI command can be found in the Identifier Profiles reference page here.

Last updated