Skip to content

no transform_keys for bulk import contacts#87

Open
aurorareachire wants to merge 4 commits intomhenrixon:masterfrom
aurorareachire:master
Open

no transform_keys for bulk import contacts#87
aurorareachire wants to merge 4 commits intomhenrixon:masterfrom
aurorareachire:master

Conversation

@aurorareachire
Copy link

@aurorareachire aurorareachire commented May 2, 2022

There is no direct/explicit support for bulk import in the SDK, but it can nontheless be invoked with:
res = client.post('import/bulk_import', data)

This mostly works but not quite. Bulk import requests use snake_case keys, not camelCase, unlike most of the rest of the API, and the normalize_body processing breaks it.

client.post('import/bulk_import', data)
data should not have all its keys mapped to camelCase, this API will simply ignore e.g firstName, lastName.

This API call, uniquely, uses the keys contacts and callback. With this PR, the normalize_body method now leaves the body alone, in the presence of those keys, as it already did in select other cases.

REQUEST_BODY: #{env.request_body}\n\n"
RESPONSE_BODY: #{response.body}\n\n"
MESSAGE
rescue StandardError => e

Choose a reason for hiding this comment

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

ActiveCampaign::Error#message has the variable name 'e'

@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit 9f52d04 and detected 3 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 3

View more on Code Climate.

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