question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Contacts.createOrUpdate data object issue

See original GitHub issue

This may be a typscript specific issue. When i try to use the contacts.createOrUpdate method i get an error. It requires two inputs into it. a string which would be the email and a data object. All the other methods like create require a JSON object but when i try to use it like this: const contact_data = { 'properties': [ { "property": "email", "value": postData.email }, { "property": "firstname", "value": postData.f_name }, { "property": "lastname", "value": postData.l_name }, { "property": "company", "value": postData.company }, { "property": "phone", "value": postData.phone }, { "property": "state", "value": postData.state } ] };

it gives me this error: [ts] Argument of type '{ 'properties': { "property": string; "value": any; }[]; }' is not assignable to parameter of type '{}[]'. Property 'length' is missing in type '{ 'properties': { "property": string; "value": any; }[]; }'.

i make the call like this: return hubspot.contacts.createOrUpdate(postData.email, contact_data)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Hideman85commented, May 22, 2019

I have the same issue, according to the doc (https://developers.hubspot.com/docs/methods/contacts/create_or_update) data should createOrUpdate(email: string, data: {}): RequestPromise like: create(data: {}): RequestPromise instead of createOrUpdate(email: string, data: any[]): RequestPromise. Maybe it’s also impact others API routes that you modify in #112

0reactions
pcothenetcommented, Aug 23, 2019

@Elyx0 which version are you using?

2.2 incorporates the fix described above: https://github.com/MadKudu/node-hubspot/blob/master/lib/typescript/contact.ts#L29

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create or update a contact - HubSpot API
The create or update a contact endpoint is used to create a new HubSpot contact or update an existing one. Use case for...
Read more >
Very generic CreateOrUpdate method with Entity Framework
This question handles that topic better: An object with the same key already exists in the ObjectStateManager. The ObjectStateManager cannot track multiple ...
Read more >
How to create or update list of contacts in xdb?
What I am trying to do is: get or create a contact in xDB by identifier; update its facets; save the contact to...
Read more >
Set up rules to automatically create or update records ...
You can now direct this data from various applications and external sources into Dataverse with the help of record creation and update rules....
Read more >
View Elevate-NPSP Integration Errors - Salesforce Help
NPSP then processes those records using NPSP Data Importer and Advanced Mapping to create or update Accounts, Contacts, Opportunities, Payments as well as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found