Mastering HubSpot APIs with Postman: Comprehensive Demo

A technical walkthrough on using Postman with HubSpot APIs. The demo covers authentication setup, forking API collections, making API calls, and using code generation and environment configurations for integration work.
We've been making a lot of noise recently about using Postman with HubSpot APIs. Hannah's been instrumental in making Postman and HubSpot go together as well as well, peanut butter and Jelly. She put together a demo showcasing what all you can do with it now, ranging from authentication, forking API collections, making API calls, and getting code samples. This is a pretty comprehensive demo. You go check it out while I, while I eat this. PB and J.
If all of you haven't seen this yet, this is the HubSpot Public API workspace. So this is a centralized location where we keep most of our API schemas and collections that you can leverage for your own testing purposes. So when you access the workspace, you just have an introduction as far as giving you guidance on how to use it, some tips when it comes to authentication and scopes, and then just some direction if you ever get stuck and you need a little bit of help within the workspace. There's two primary aspects of it that I think you're going to find the most valuable. This is our collections and our API tab. So within the collections, we've grouped these based on essentially HubSpot's different products or features. So. So, for example, this is a CRM API collection and it actually contains collections for any API associated to the CRM. And you actually have the ability by clicking on this Run and Postman button, to fork all of these collections, API collections, otherwise you can fork them individually as well. And what's nice about this is that it contains most of the documentation that we already have within our HubSpot API documentation site. However, the documentation site will be a little bit more robust. And then on the API tab, this is where you can actually take a look at an API schema. So I don't know about you, but before I became an advocate, I was a. NET developer. I used to build and design APIs, and I use Postman more from an engineering perspective. But this is meant to essentially just enable our end users with our APIs. So I like having, for me, I like to be able to look at an entire scope. I think it's just easier for me to understand what its capabilities are as opposed to just looking at individual endpoints. But essentially what you can do is you can fork these collections and these schemas into your own Postman workspace and you can create a Postman account for free. So it doesn't cost you anything. There's nothing that should get in your way with this. And as far as what you can do is you can. Let's see, I'm going to use the contact definition API definition, and then I'm going to look at the recent versions of this API spec and I'm going to click on this version and then I want to be able to fork this. And then I'm going to fork this into my own personal workspace. And something also important to note is that it's. I would click on this little checkbox saying, watch original collection. What this does is it actually will let you know and provide you notifications via email when a collection has been updated. And then you're actually able to pull those updates applicable to the collection right within your workspace. So if there's been an endpoint change, if there's been some sort of response change, you're able to pull that in directly in your workspace. So I'm going to forecast collection and now we're going to be in my personal workspace. And then, awesome. Now I have access to this. So let's say that I want to make. I want to make a call to one of these endpoints first. What I need to do is I need to set up my authentication. And for this demonstration, I'm just going to utilize or. And first and foremost I need to create a public app. So for a developer's account that I've already created, I'm going to go to apps. I'm going to create an app. I'm going to go, that's not how you would normally name an app, but just for this purpose. And then I'm going to go into the AUTH settings and then something important is that you're going to be leveraging your client id, your client secret, your redirect URL and your scopes within Postman. So just for this, I'll do local host and then for the scope, since we're going to be utilizing contacts, grab those contact scopes, I'm going to create app. Awesome. Okay, different side of the. So now I'm going to set up my authentication from the collection level of this, of the collection that I just forked and select OAuth 2.0 for request headers. I'm going to keep that as is. And then we're going to make sure the prefix is bearer token and we're going to name this so you can give it a unique name so you know exactly when like X reference exactly when you created this token. So we'll do that. And then interesting enough with Postman for their callback URL, which is similar to Our redirect URL, they when I'm utilizing the web version as opposed to their desktop version of their application, I have to leverage this callback. So that's easy to fix. I can just go back here, update this. I'm going to save those changes and then for the AUTH and Access token URL, you can actually reference our API documentation and it contains those URLs. I'm just copying them on a notepad that I prepped before this demo. And so we're going to copy the access token URL. Now I need to grab my client id. We're going to get the secret. Okay, all right, now I need to copy my scopes down here. Allow me to pull this data. Oh, and then important, when you are adding these scopes in Postman, all you need to do is just add a space. This. All right. And then when it comes to the client authentication, I wanted to send the credentials in the body. And then you also have the option to set up your refresh token as well. All right, so get new access token. Then you're going to utilize a test account. Great. So now it's been complete. I'm going to press proceed. And then it's nice, it creates this access token. It also provides you a fresh token. And then I've named this Ignite token. So I'm going to say, okay, use token. Awesome. Going to save this information. Now let's go back to my endpoint. Okay, I want to get a list of contacts, move these params because I don't need them right now. Then I'm going to go to Authorization Available tokens, Ignite token, see how that's available. Lets you know that It'll expire at 11:45 Eastern today. And then let's try sending this. There we go. Sorry about that. And so you're able to utilize that now within the different endpoints of this collection that I just forked. So that makes things a lot easier. Another really helpful tool is that it also provides documentation. So remember those params or any sort of information that you want to look in References endpoint, you can actually click on this documentation tab and it'll explain what those are and how they're used. So that's really helpful. There's also this code generation feature that I really like. So what you want to, if you want, you could have the option to look at different languages and frameworks and say, oh, okay, I have a Node JS app and I want to be able to make this request within my app. You can actually copy and paste the source code directly into your source code of your app. So I think that's also really helpful. There's also environments that you can set up, and these environments are, they're customized based on whether you're working in QA or Prod or what have you. Maybe it's based on regions, US or Europe. So I think that's also a really nice feature that you can utilize. And that environment essentially provides authentication and just a set of rules and permissions for that type of specific environment you want to test for. Okay, so that is that just as far as the demo for postmorn.
Bye bye.










