APIs & Integrations

Jaycee_Lewis
Community Manager
Community Manager

Migration guide — Migrate an API key integration to a private app

Hey, HubSpot Developers! There are plenty of questions about the upcoming sunset and how to migrate your apps using API keys to use Private Apps.

 

Luckily, our amazing team put together this guide, Migrate an API key integration to a private app 

 

Changelog information here — Upcoming: API Key Sunset

 

If you have questions about the guide or the information included, please leave your feedback in the comments. If you have specific questions about migration of your app, please consider starting a new thread. This will help make sure your request gets the attention it deserves from our community. 

 

Have fun coding! — Jaycee 🧡

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

33 Replies 33
Jaycee_Lewis
Community Manager
Community Manager

Migration guide — Migrate an API key integration to a private app

Hey, @GustavoOliveira 👋 I am happy to check for us.

 

Can you tell me specifically which v1 API you are referring to? For example, the Get a contact by vid endpoint works with private apps.

 

Thank you! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
GustavoOliveira
Participant

Migration guide — Migrate an API key integration to a private app

Thanks!

 

It's the Get all deals (hubspot.com) or Get a deal | Deals API (hubspot.com) enpoints. But specifcally the parameters to get all version of a property ("Properties with History" and "Include property versions", respectively), which is something the newer APIs don't seem to provide.

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Migration guide — Migrate an API key integration to a private app

Hey, @GustavoOliveira 👋 Thank you very much for clarifying. I successfully ran quick tests of both v1 endpoints using Postman and included the additional params:

Get all deals

  • Endpoint 
    GET https://api.hubapi.com/deals/v1/deal/paged?propertiesWithHistory=dealname​
  • Response (edited to only include the relevant Deal)
    {
                "portalId": 22245342,
                "dealId": 9669508372,
                "isDeleted": false,
                "associations": null,
                "properties": {
                    "dealname": {
                        "value": "Changer v2",
                        "timestamp": 1659390587045,
                        "source": "CRM_UI",
                        "sourceId": "userId:10233975",
                        "updatedByUserId": 10233975,
                        "versions": [
                            {
                                "name": "dealname",
                                "value": "Changer v2",
                                "timestamp": 1659390587045,
                                "sourceId": "userId:10233975",
                                "source": "CRM_UI",
                                "sourceVid": [],
                                "updatedByUserId": 10233975
                            },
                            {
                                "name": "dealname",
                                "value": "Changer v1",
                                "timestamp": 1659390567632,
                                "source": "CRM_UI",
                                "sourceVid": [],
                                "updatedByUserId": 10233975
                            }
                        ]
                    }
                },
                "stateChanges": []
            }
        ],
        "hasMore": false,
        "offset": 9669508373​

Get a deal

  • Endpoint 
    GET https://api.hubapi.com/deals/v1/deal/9669508372?includePropertyVersions=true​
  • Response (edited to include only the relevant deal property)
    "dealname": {
                "value": "Changer v2",
                "timestamp": 1659390587045,
                "source": "CRM_UI",
                "sourceId": "userId:10233975",
                "updatedByUserId": 10233975,
                "versions": [
                    {
                        "name": "dealname",
                        "value": "Changer v2",
                        "timestamp": 1659390587045,
                        "sourceId": "userId:10233975",
                        "source": "CRM_UI",
                        "sourceVid": [],
                        "updatedByUserId": 10233975
                    },
                    {
                        "name": "dealname",
                        "value": "Changer v1",
                        "timestamp": 1659390567632,
                        "source": "CRM_UI",
                        "sourceVid": [],
                        "updatedByUserId": 10233975
                    }
                ]
            },​

Thank you for asking this question. It helps other community members as well as helping us identify areas where more clarity is needed.

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

GustavoOliveira
Participant

Migration guide — Migrate an API key integration to a private app

Thank you so much for the answer, it's really thorough.

 

Now it's clear that I can make this change.

Jaycee_Lewis
Community Manager
Community Manager

Migration guide — Migrate an API key integration to a private app

I forgot the most important detail 🙃 Both of these requests were made using a Private App I created in my app testing account. — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

GDell
Member

Migration guide — Migrate an API key integration to a private app

Hi, we've moved to the new method, but we can't get the Blog Author Name and Blog Author Image and these aren't mentioned in the documentation. Can you advise?

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Migration guide — Migrate an API key integration to a private app

Hey, @GDell 👋 Which endpoint are you referring to? I am happy to take a brief look.

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
GDell
Member

Migration guide — Migrate an API key integration to a private app

https://api.hubapi.com/blogs/v3/blog-authors/

 

It's this one. Just need the equivalent for both Blog Author Name and associated image.

 

The new API is returning the user who created the post rather than the user the post is assigned to

0 Upvotes
GDell
Member

Migration guide — Migrate an API key integration to a private app

Just more info:

 

We are using the Blog endpoints here https://developers.hubspot.com/docs/api/cms/blog-post, see Endpoints tab. The "authorName": "string" seems to return the name of the user creating the post, rather than the Author assigned to it. And there is no endpoint for Author image in this list. Hope this helps.

0 Upvotes
MWeddup
Participant

Migration guide — Migrate an API key integration to a private app

I've been attempting to migrate from API KEY auth to Private App using the guide, but the scopes on the Private App were causing difficulty, the e-commerce scope had been added to the Private App ( and the key rotated ) but the calls to the API using the Private App are still giving "One or more of the following scopes are required." requiredScopes":["e-commerce"]  turned out to be attempting to use the e-commerce on the Products on a non-enterprise/non-professional account, would be handy if the guide had a reminder or the api message was more specific

Jaycee_Lewis
Community Manager
Community Manager

Migration guide — Migrate an API key integration to a private app

Thanks for your feedback, @MWeddup 🙌 I'll pass it along to my team. — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
Agilx
Member

Migration guide — Migrate an API key integration to a private app

Any update on this?  I'm getting the same error using a developer account that was just renewed.  Created a Private APP with the e-commerce scope and I can't create Projects.

0 Upvotes
Agilx
Member

Migration guide — Migrate an API key integration to a private app

Sorry I just noticed this detail " turned out to be attempting to use the e-commerce on the Products on a non-enterprise/non-professional account,"  Can we not create projects through the API if we are using a free developer account?  What is the minimum we need to properly test?  Do we need to pay for 2 accounts?  One for production data and one for testing?