APIs & Integrations

rlong30
Member

Version 3 of the api not working as expected.

SOLVE

Hello, I am having an issue with the Version 3 API. 

 https://api.hubapi.com/crm/v3/objects/contacts/batch/create and https://api.hubapi.com/crm/v3/objects/contacts/batch/update  Each worked once for me and inserted/updated new contacts.  Now it is not updating or creating any new contacts after the first try.  I am receiving a 201 response for each request I do and this json comes back as complete, but nothing happens to the contacts in the dashboard.

{
"status": "COMPLETE",
"results": [],
"startedAt": "2022-01-21T15:02:39.819Z",
"completedAt": "2022-01-21T15:02:39.819Z"
}    The audit log is showing a successful call.  Why would it only work once?   I switched ip addresses and it worked one time again and then nothing would update or create for contacts anymore.   Here is the body json request body:  {
    "email": "newtestsf@yahoo.com",
    "properties": [
      {
        "property": "firstname",
        "value": "Harper"
      },
      {
        "property": "lastname",
        "value": "Wolfbergs"
      },
      {
        "property": "website",
        "value": "http://hubspot.com"
      },
      {
        "property": "company",
        "value": "HubSpot"
      },
      {
        "property": "phone",
        "value": "555-122-2323"
      },
      {
        "property": "address",
        "value": "25 First Street"
      },
      {
        "property": "city",
        "value": "Cambridge"
      },
      {
        "property": "state",
        "value": "MA"
      },
      {
        "property": "zip",
        "value": "02139"
      }
    ]
  },
  {
    "email": "testingapifs@hubspot.com",
    "properties": [
      {
        "property": "firstname",
        "value": "Codeys"
      },
      {
        "property": "lastname",
        "value": "Huang"
      },
      {
        "property": "website",
        "value": "http://hubspot.com"
      },
      {
        "property": "company",
        "value": "HubSpot"
      },
      {
        "property": "phone",
        "value": "555-122-2323"
      },
      {
        "property": "address",
        "value": "25 First Street"
      },
      {
        "property": "city",
        "value": "Cambridge"
      },
      {
        "property": "state",
        "value": "MA"
      },
      {
        "property": "zip",
        "value": "02139"
      }
    ]
  }


Is Version 3 buggy?   Version 1 works every time for me for batch updating and creating.   Where can I go for help with this?  It is acting like it is working, but nothing changes in the dashboard unless I change my IP address then it works one time and then not again after.

 

Thank you,

Ryan

0 Upvotes
1 Accepted solution
himanshurauthan
Solution
Thought Leader | Elite Partner
Thought Leader | Elite Partner

Version 3 of the api not working as expected.

SOLVE

Hello @TiphaineCuisset, thank you for tagging me in. 🙂

 

So @rlong30The issue is in your JSON body. In v3 API the contact updates on the basis of VID and not the email ID.

 

As I can see you are using email ID to update the contact but you have to use HubSpot's user ID to update the contact.

 

Please visit the below API and proceed with this way and let me know if you are still facing any issues:

 

https://developers.hubspot.com/docs/api/crm/contacts

 

And in the above link open:

open the above link and search the below API on that page

/crm/v3/objects/contacts/batch/update

 

Hope it will help you out

 

Regards,

Digital Marketing & Inbound Expert In Growth Hacking Technology

View solution in original post

3 Replies 3
TiphaineCuisset
Community Manager
Community Manager

Version 3 of the api not working as expected.

SOLVE

Hi @rlong30 

 

Thank you for reaching out.

 

I want to tag some of our experts on this - @himanshurauthan @miljkovicmisa @JBeatty do you know what could be happening here? 

 

Thank you!

Best

Tiphaine


Saviez vous que la Communauté est disponible en français?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !


0 Upvotes
himanshurauthan
Solution
Thought Leader | Elite Partner
Thought Leader | Elite Partner

Version 3 of the api not working as expected.

SOLVE

Hello @TiphaineCuisset, thank you for tagging me in. 🙂

 

So @rlong30The issue is in your JSON body. In v3 API the contact updates on the basis of VID and not the email ID.

 

As I can see you are using email ID to update the contact but you have to use HubSpot's user ID to update the contact.

 

Please visit the below API and proceed with this way and let me know if you are still facing any issues:

 

https://developers.hubspot.com/docs/api/crm/contacts

 

And in the above link open:

open the above link and search the below API on that page

/crm/v3/objects/contacts/batch/update

 

Hope it will help you out

 

Regards,

Digital Marketing & Inbound Expert In Growth Hacking Technology
rlong30
Member

Version 3 of the api not working as expected.

SOLVE

This worked for me, but I had to change the JSON to this format as well as change email to id.

The example in the docs works.  The id has to match a user though.  This works for update.  I still can't get batch create to work.

{
"inputs": [
{
"id": "1",
"properties": {
"company": "Biglytics",
"email": "bcooper@biglytics.net",
"firstname": "Bryan",
"lastname": "Cooper",
"phone": "(877) 929-0687",
"website": "biglytics.net"
}
}
]
}