Skip to content

Add App API customer & object methods#228

Merged
mike-engel merged 3 commits into
mainfrom
cdp-6265
Jul 6, 2026
Merged

Add App API customer & object methods#228
mike-engel merged 3 commits into
mainfrom
cdp-6265

Conversation

@mike-engel

@mike-engel mike-engel commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Batch 1 of the App API backfill. Adds twelve read/query methods to APIClient:

  • getCustomerActivities / getCustomerMessages / getCustomerRelationships / getCustomerSegments / getCustomerSubscriptionPreferences
  • searchCustomers (POST /customers) and getCustomersAttributes (bulk lookup)
  • getObjectAttributes / getObjectRelationships / findObjects
  • listObjectTypes / listActivities

Introduces a shared buildQueryString() helper in utils for the pagination and filter query params (start/limit/id_type/etc.) that the rest of the App API list endpoints will reuse.


Note

Low Risk
Additive read-only SDK methods with consistent validation patterns; no changes to sends, auth, or existing method behavior.

Overview
Expands APIClient with twelve read/query App API methods (batch 1 of the backfill): person lookups (getCustomerActivities, getCustomerMessages, getCustomerRelationships, getCustomerSegments, getCustomerSubscriptionPreferences), audience search (searchCustomers, getCustomersAttributes), object APIs (getObjectAttributes, getObjectRelationships, findObjects, listObjectTypes), and workspace-wide listActivities.

Shared buildQueryString and isObjectIdType in utils centralize optional query params and object id validation; new option types (PaginationOptions, etc.) document pagination and filters. findObjects intentionally types filters as Record<string, any> until a dedicated object filter type lands.

docs/app.md documents all new methods. Unit tests in test/api.ts assert URLs, validation, and query serialization; test/integration/live.ts adds live smoke tests plus optional CIO_TEST_OBJECT_TYPE_ID / CIO_TEST_OBJECT_ID env vars.

Reviewed by Cursor Bugbot for commit d08aec5. Bugbot is set up for automated code reviews on this repo. Configure here.

Batch 1 of the App API backfill. Adds twelve read/query methods to APIClient:

- getCustomerActivities / getCustomerMessages / getCustomerRelationships /
  getCustomerSegments / getCustomerSubscriptionPreferences
- searchCustomers (POST /customers) and getCustomersAttributes (bulk lookup)
- getObjectAttributes / getObjectRelationships / findObjects
- listObjectTypes / listActivities

Introduces a shared buildQueryString() helper in utils for the pagination and
filter query params (start/limit/id_type/etc.) that the rest of the App API
list endpoints will reuse.

Includes unit tests (100% coverage), live integration coverage, and docs in
docs/app.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mike-engel mike-engel self-assigned this Jul 3, 2026
…ce Filter (CDP-6265 review)

Addresses review feedback on the customers/objects batch:

- getObjectAttributes/getObjectRelationships now validate id_type at runtime
  via a new isObjectIdType guard (object_id | cio_object_id), matching the
  isIdentifierType checks used for customer id types. Previously an invalid
  value like 'id' was sent silently.
- findObjects no longer types its filter as the audience Filter (which allowed
  segment conditions the objects API rejects and lacked top-level not). It is
  typed loosely for now with a doc note; a dedicated ObjectFilter type and
  top-level not support are tracked as a follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread lib/api.ts
Comment thread lib/api.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d08aec5. Configure here.

Comment thread lib/api.ts
@mike-engel mike-engel merged commit 407ed45 into main Jul 6, 2026
11 checks passed
@mike-engel mike-engel deleted the cdp-6265 branch July 6, 2026 14:17

@sydneycollins-cio sydneycollins-cio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait i reviewed thie one alreadyu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants