Best way to populate a development sandbox account with data
Hi,
The project I’m working on makes extensive use of the HubSpot APIs, and I want to be able to test it with a data set more robust than the “demo” data you guys provide. To that end, I want to setup a development sandbox account populated with data that can be returned when I make various API calls. I’ve got a HubSpot customer willing to export their data for me, but I’m not sure what the best way to import their data to my sandbox is. Looking over the HubSpot Academy documentation, I see that I can import Contacts and a Wordpress Blog using the HubSpot GUI. Is there any other support for imports through the GUI? Or will I have to use the API endpoints / manual insertion through the GUI to get my sandbox setup?
Best way to populate a development sandbox account with data
Hi All,
I was frustrated by the lack of a scalable solution here, so I wrote an open source Python utility to migrate data from a Hubspot Production Instance to a Hubspot Sandbox Instance using only your Production and Sandbox API Keys.
I mean export the data I get back when I use the ‘hapikey=demo’ access token. If it was possible to get all the contacts associated with the demo account as a CSV for example, I could use the built-in contacts import tool to get the data into my sandbox.
Best way to populate a development sandbox account with data
@Adam similar to my response to James above, you can pretty much just use the response from the get all contacts endpoint as the payload to create contacts in your demo portal.
You’ll either need to write a script to extract the properties you want to keep, or you can use a JSON to CSV converter to convert the response into a CSV if that’s easier to edit.
Best way to populate a development sandbox account with data
In this regard, I really miss a ‘delete all’ API command for contacts, companies and deals. I know, in a live environment this will only do harm, but in order to set up automated tests it would really come in handy.
I can also not find the csv import possibility via API. So I go for a script that prepares data in json and put them into the test portal.
Probably there will be no way to get the test run to less than 30 secs per test, but hey, I can have automated tests for my intergration
Best way to populate a development sandbox account with data
This really seems like a request that makes sense to accommodate. Having to write a script to import all the settings into a sandbox seems like overkill and should be included out of the box.
You can pretty much just request all custom properties from your current portal then POST the response to the test portal. You’ll just want to filter out any properties that have the hubspotDefined flag set to true. Note that custom properties don’t have a HubSpotDefined param.
It is possible to create new Deal pipelines by posting to deals/v1/pipelines. I’m going to have that added to the Developers docs.