Skip to content

Rework Optable Real-time APIs configuration and request forming #33

@ValentinPostindustria

Description

@ValentinPostindustria

Motivation

The API configuration and call pattern in the SDK is outdated and needs to be brought into correspondence with the current Optable Real-time APIs.

Details

Docs

The documentation for the Optable Real-time APIs is available here: https://docs.optable.co/optable-documentation/admin/real-time-api/api-integrations-guide.

URL components

For the SDK we need to implement the proper configuration - i.e. update the Config class by adding components to it (some may already exist):

  • host (na.edge.optable.co by default)
  • path (v2 by default)
  • endpoint (actual API s.a. identify, targeting, witness, profile, tokenize, but other verbs may be added later - so no need to create a enum for now, especially given there is a wrapper class for each API call anyway)
  • tenant
  • originSlug

The currently existing app component should be removed. This is a breaking change so will require a major release of the SDK.

Authentication

The APIs can be exposed publicly or privately, for the latter case the apiKey parameter is needed on the Config object. If it is set it should add a header Authorization: Bearer {{API_KEY}} header needs to the API call.

Objectives

  1. Update the configuration and request forming for the above mentioned API calls
  2. Make sure unit tests cover request forming
  3. Ideally there should be unit tests against mock server to verify the API request / response end-to-end.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions