APIs & Integrations

KLockhart
Member

Private app and v1/contacts/batch

Do we need to change from POST v1/contacts/batch endpoint when migrating from api key to private app? I made changes to the python script we were using, but when I run the script I get results of 202 and the contacts do not get updated.  Do private apps not work with that endpoint? 

0 Upvotes
2 Replies 2
KLockhart
Member

Private app and v1/contacts/batch

I am pretty new to python and inherited the file from a previous coworker. I read through the documentation about migration to private app and through many other posts regarding different issues they were having. I made changes like commenting out where the api key is being used and added in the private app token teh best I could for now at least. Since then, any time I run the script I do get the 202 message like what is yours and thought that it is an error  - especially since no changes are being posted to the contacts file.  The file does not just auto run right now for multiple reasons 
1) have not deleted api key since it is currently still working with the older way of api key until I get this sorted
2) I am just using a copy of the original script and manually run to see if it works. It does update the csv file on our end just doesn't push it to Hubspot
3) I have been concerned that we may need to also migrate to vs and do it differently including using things like the hubspot import api and stuff that we have no been using - especaially since I have not found any examples out there in people's posts about the migration using the v1 endpoint

 

Here are snips of the code shopwing where I commented out api key and inserted access token. I do not even know how to get this to run in postman so I can see how it will work (again newbie here) 

KLockhart_1-1670611335133.png

KLockhart_2-1670611482580.png

KLockhart_4-1670611756730.png

 

 

 

KLockhart_5-1670611839811.png

 

KLockhart_0-1670611171575.png

 

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Private app and v1/contacts/batch

Hey, @KLockhart 👋 The endpoint you referenced is working as expected using a Private App. Here's a quick test using Postman.

Request:

 

POST https://api.hubapi.com/contacts/v1/contact/batch/

[
    {
        "vid": "1001",
        "properties": [
            {
                "property": "bff",
                "value": "Jericho"
            }
        ]
    },

    {
        "vid": "801",
        "properties": [
            {
                "property": "bff",
                "value": "Kuchi Kopi"
            }
        ]
    }
]

 

Response:
202 Accepted
Screenshots of updated records:

bb-batch.png

bb-batch2.png

If you continue to have issues, can you share a simple request and response example, please? Having details can help the community understand how they can assist or troubleshoot.

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes