Skip to content

fix: URL-encode api_key in generic API helpers - #19

Merged
franciscbalint merged 6 commits into
mainfrom
fix/encode-api-key-f10
Oct 23, 2026
Merged

franciscbalint merged 6 commits into
mainfrom
fix/encode-api-key-f10

Conversation

@franciscbalint

@franciscbalint franciscbalint commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • URL-encode API key and query parameters (F-10)

Priority 2 — /v2/scoring (real-time AI scoring)

  • ZbScoreEmail (GET) and ZbScoreEmailPost (form POST) on main API base URL
  • TZbScoreEmailResult (email, score)

Priority 3 — bulk finder, list evaluator, filters, S3

  • ZbPriority3 unit: email finder / domain search, list evaluator, ZbSendEvaluatedFile, filters, S3 validate/score/export
  • Raw JSON helpers for filters and list-evaluator results

Test plan

  • Docker unit_tests_console --all (72 tests passed, incl. TestValidateS3FileOk)

Made with Cursor

franciscbalint and others added 6 commits October 18, 2026 00:36
Use EncodeParam for api_key query values in zbgeneric.pas.

Co-authored-by: Cursor <cursoragent@cursor.com>
Support verify_plus, activity_data, timeouts on validate/validatebatch and parse active_in_days/active_first_seen.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add TZbScoreEmailResult, ZBFormPostRequest, and unit tests aligned with JS scoreEmail parity.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add ZbPriority3 unit with bulkapi parity and FPCUnit coverage for validateS3file.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add form-encoded POST option on single validate (alongside GET) and GET
listS3files on bulkapi root, with unit tests and API parity doc updates.
HTML pages, empty bodies, and account-level batch failures were reaching callers as raw payloads or successes. The offline suite talks to 127.0.0.1 so the default FPCUnit run checks every endpoint without the network.

Co-authored-by: Cursor <cursoragent@cursor.com>
@franciscbalint
franciscbalint merged commit 95d2bdb into main Oct 23, 2026
5 of 6 checks passed
franciscbalint added a commit that referenced this pull request Oct 23, 2026
…TP bulk

Rebuilt on top of main after PR #19 landed, which already brought
TZbValidateOptions, real-time AI scoring, the filters, the list evaluator and
the first four S3 jobs in a ZbPriority3 unit. This branch now adds only what is
still missing, on main's structure, rather than a second copy of that work.

Ports the rest of 407f0a8 and b0444f8 from the Python SDK:

- TZbValidateOptions gains DomainInfo, GreylistProcessing and CallbackUrl. A
  -1 field is not sent; booleans go on the wire as the strings true/false.
  CallbackUrl is where the greylist retry posts its result, so it is rejected
  without GreylistProcessing = 1, and when blank, before any request is sent.
- TZbValidationResult carries DomainWebsiteExists,
  DomainRegistrantCompanyName and Message.
- ZbEmailFinderS3File and ZbDomainSearchS3File, from
  https://www.zerobounce.net/docs/api-integrations/amazon-s3-bulk-api
- ZbValidateSFTPFile, ZbScoreSFTPFile, ZbEmailFinderSFTPFile,
  ZbDomainSearchSFTPFile and ZbExportSFTPFile, from
  https://www.zerobounce.net/docs/api-integrations/sftp_bulk_api
  All six share TZbBulkFileJobOptions and P3BulkRootFileJob.
- The Inbox Placement Tester: the API key goes on the query string, bodies are
  camelCase JSON, and unset fields are left out.

ZbUtility gains ZbListEvaluatorURL and ZbInboxPlacementURL, ZBSendRequest
(explicit method plus optional body, which the Tester's PUT and DELETE need),
EncodePathSegment, and ZbLastRequestMethod / ZbLastRequestBody for the tests.

Changed:
- ZbGetListEvaluatorResult uses ZbListEvaluatorURL, encodes the file id as a
  single path segment, and rejects a blank id before a request is sent.
- ZbExportS3File's ExportBucket is optional, matching the documented endpoint:
  an empty string uses the export bucket from the account's settings. A
  whitespace-only value is still rejected. The new export test caught this.

Fixed:
- A validation response without processed_at no longer raises. The
  greylist-pending response carries Message and no date, and the parser was
  raising "Invalid date/timestamp" on it.
- TTestOffline.TestEndpointsAndOptions was reaching the LIVE API. It points the
  local stub at ZbApiBaseURL, BULK_URI and ZbBulkRootURL, but the list
  evaluator had just moved to its own base URL, which still defaulted to
  bulkapi.zerobounce.net. UseStub now points the two new base URLs at the stub
  as well. Symptom was the whole --all run hanging; the real response was
  {"success":"False","message":["api_key is invalid"]}.

Tests: 91 run, 0 errors, 0 failures — up from 77 on main.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@franciscbalint
franciscbalint deleted the fix/encode-api-key-f10 branch October 24, 2026 19:07
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.

1 participant