APIs & Integrations

KMartinez82
Participant

V1 Contacts Api endpoint equivalents not in CRM Api V3

Due to the deprecation of Hubspot Api Keys, I'm switching my app to a private app. My website updates my hubspot apps contact list on registration, however this no longer works now that I'm using the private app token as a header instead of passing the apiKey as a parameter. Looking at the documentation here https://developers.hubspot.com/docs/api/crm/contacts there doesn't seem to be equivalent parity with the old api here https://legacydocs.hubspot.com/docs/methods/contacts/create_or_update and the old api doesn't seem to support private app token. Will there be support for private app token in the legacy api? Or will I have to switch to the new api? Will the new api support the old apis endpoints?

0 Upvotes
4 Replies 4
Jaycee_Lewis
Community Manager
Community Manager

V1 Contacts Api endpoint equivalents not in CRM Api V3

Hey @KMartinez82 👋 I want to clarify my understanding. Are you asking if we can use the bearer token from a Private App when using this endpoint? Create or update a contact:

POST /contacts/v1/contact/createOrUpdate/email/:contact_email

 

If so, I ran a quick test using Postman and received an HTTP 200 response when using the token from a Private App. Here's what I did:

  • Created a Private App in my App Test Account
  • Set up the Authorization in Postman to Type = Bearer Token
    token-me-bro.png
    Request Headers:
    Authorization: Bearer NOPE
    Content-Type: application/json
    User-Agent: PostmanRuntime/7.29.0
    Accept: */*
    Postman-Token: NOPE
    Host: api.hubapi.com
    Accept-Encoding: gzip, deflate, br
    Connection: keep-alive
    Content-Length: 819
    
    Request Body:
    {
        "properties": [
            {
                "property": "firstname",
                "value": "HubSpot"
            },
            {
                "property": "lastname",
                "value": "Test"
            },
            {
                "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"
            }
        ]
    }​
  • Which returns 
    Response Body
    {"vid":351,"isNew":true}
    ​

If I misunderstood or there is a follow-up question, please let us know.

 

Have fun coding! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
KMartinez82
Participant

V1 Contacts Api endpoint equivalents not in CRM Api V3

Hi Jaycee,
This answers my question. I was under the impression that the createOrUpdate endpoint wouldn't work with the privateAppToken. Originally I had received a property values were not valid error and thought that perhaps the auth token didn't work. It seems that my properties are set as:

{
  "name": "propertyName,
  "value": "propertyValue"
}

Which is odd since I had no trouble with this format when using apiKey. Strange

0 Upvotes
KMartinez82
Participant

V1 Contacts Api endpoint equivalents not in CRM Api V3

Weird now I'm getting a "property cannot be missing or null error"

 

0 Upvotes
Craig
Top Contributor

V1 Contacts Api endpoint equivalents not in CRM Api V3

Did you ever solve this? I am hoping to be able to still use the createOrUpdate v1 endpoint rather than having to transition to v3 endpoints!

0 Upvotes