A Newbie’s Perspective on Becoming a HubSpot CRM developer | HubSpot.Extend() 2022

Hannah Seligson, a HubSpot developer advocate, walks through the basics for new developers: API fundamentals, the HubSpot Objects API, how associations work in the CRM, and GraphQL. She points to resources to get started building with HubSpot.
Hi everyone. My name is Hannah Seligson and my pronouns are she and her. I'm wearing a black sweater and I have brown hair and glasses. I'm super excited to be here with you all today at HubSpot. Extend today I'm going to be hosting a session that's perfect for those of you who are new to the HubSpot CRM and are unsure where to start with your development journey. My presentation is going to highlight some important tips to kickstart a newbie's perspective on becoming a HubSpot CRM developer. First, I'd like to share with you all a little bit about myself. I'm a developer advocate here at HubSpot and I started in June of 2022, so my perspective is truly a newbies. However, prior to my advocacy efforts, I spent time as an engineer focusing on API development. Now let's review what we're going to be discussing during this session. During today's session, I want to review some API basics with you and how this can be applied to the HubSpot Objects API. I'm also going to review the Objects API and what object associations are. This will follow with a GraphQL explanation and sharing some of its capabilities. In addition, I also want to point to you how you can connect with other developers like yourself, especially as you begin learning about the HubSpot CRM. So to begin our session, I'm going to take some time to review what I believe is a critical step when beginning your development journey with the HubSpot CRM. I'm going to explain to you why I think it's important to become familiar with the HubSpot APIs. When you first start, you want to make sure that you know how to use these APIs, how to test them, and along with just a general overview of what an API is and how they work. I believe by understanding first what an API is and how they work, it'll help you succeed with your CRM initiatives, especially for your clients. But most importantly, it will help support your development journey. Now, I'm going to assume that some of you are well versed in APIs and understand how they work and use them daily. But perhaps there are those of you that don't know what an API is or how they work. For those of you who are new, I want to explain a little bit about what an API is. First, a simple way to explain what an API is is Think of it as a set of defined rules. These rules explain how a computer or or an application can communicate with one another. So an API sits between an application and the web server, acting as an intermediary layer that processes data transfer between those two systems. Within this slide, I'm walking you through essentially just the lifecycle of a traditional REST API request. It starts first with a client application initiating an API call to retrieve information. This is also known as your API request. This request is processed from an application to the web server via an API's URI or a uniformed resource identifier, and this can include a request verb, headers, and even sometimes a request body. Next, after receiving a valid request, the API makes a call to the external program or the web server. And then lastly, the server sends a response to the API with that requested information that you've made, as long as everything is successful and you don't receive any errors. Now, you're probably wondering, what does this have to do with the CRM? Let me get there. The HubSpot CRM for those of you who are brand new, a CRM is a customer relationship management platform. And as a developer, you're going to use the HubSpot APIs to interact, integrate, customize, and extend that CRM platform. For this presentation, I'm going to be focusing more on the objects API. HubSpot objects are categorized into two main categories, standard and custom. The APIs contain objects and properties that are used to manage an organization's data, and this enables folks to use this data to execute their initiatives effectively for their business needs. So, back to our objects. Standard HubSpot objects are contacts, companies, deals, or tickets. But then there is also a Custom object. Custom HubSpot objects. Objects that represent your business data. You can create and manage custom objects through a custom Objects API. And you can do this by defining an object schema or utilizing the HubSpot app and using the UI. Now, I'm not going to get too into the weeds about how to create custom objects. Thanks to HubSpot, we already have the resources available to guide you through that process. But instead I'm going to share why Using a tool like Postman used to test APIs with our standard objects in the CRM can help kickstart your development journey with the CRM by simply learning how to interact with the platform and using the Objects API endpoint for those objects. So when you begin testing and you're getting familiar with HubSpot APIs, you can do this quickly by first creating a HubSpot developer account. You can do this for free on our website. Next, you want to utilize some sort of API testing tools like Postman or something similar. And also you want to make sure that you have a good foundation of knowledge about APIs and how to test them and just understand the architecture of an API. Okay, when you begin testing HubSpot APIs, you first need to identify which API you want to test. Then you need to identify what the URI is you want to request. Data from. This can be identified within the HubSpot API documentation where you can reference the API endpoints. Next, you can create a developer account to authenticate your Postman request. However, this step, it's not a requirement, but it's definitely a quick way to get started testing our APIs. Then, when you're creating a test account with a private app, you can actually authenticate with the system by leveraging a HubSpot access token. So in testing, you can use the access token to authenticate your API call. It could be a public or private app token, just as long as the app has the necessary scopes for the endpoint that you're testing. So when it comes to authentication, you can do this with Postman by requesting data, setting your authorization type to your bearer token, and then enter the token into the token field. Or you can set up authentication using OAuth and you can create an environment within your Postman tool. Next, you want to make sure that when you're authenticating with the system that you definitely define your scopes for the data that you need. You can do this in your app settings of your developer account within HubSpot. Okay, so now that we've done an API refresher, I'm going to do a quick introduction to Postman and its capabilities when you begin testing APIs, but specifically our HubSpot APIs. Postman is a tool that you can use to interact with web based APIs, but it also allows us to request and send data really easily. I'm going to show you an example of creating a HubSpot app for testing in Postman with OAuth. I believe by knowing how to interact and test HubSpot APIs will be crucial to your CRM development. And once you understand how our APIs operate, it enables so many opportunities. So also instead of an unpredictable live demo, I did a recording previously using OAuth 2.0 to make a GET request to our contact endpoint to request all contacts for a private app that I created within a test portal on HubSpot. Here is a simple example of me fetching a GET request, but first referencing our API documentation so that I understand what the necessary URI Information is needed to execute the request and and test the HubSpot Objects API. Our documentation provides the necessary URI that I then copy and paste into Postman. Then, as I mentioned before, I did set up OAuth 2.0 with my access token and I'm just ensuring that I have the proper authorization put in place so that I can make my request in Postman. And now I should be ready to send my request. And there we go. I got a 200 response and I'm able to view the data within my HubSpot account utilizing the Contacts endpoint. So once you've got a good idea of how to test our APIs and see what data is returned and how to work with it, it's crucial to understand what are HubSpot objects when it comes to a business context and the organization's data that you're handling, along with what associations are and how they can be applied to the data and the CRM. So let's dive into associations. From a developer's perspective, it's important to understand how your users will be interacting with the CRM and what data is critical to their workflows, but most importantly their processes and how users can execute their business needs easily. The CRM enables users to leverage their data in a way that supports their business. That said, I'm going to circle back to the standard CRM objects. Company contact, deal, and tickets. These objects have relationships with one another, and these are called associations. For example, you won't get too far without a contact pursuing a deal when it comes to our CRM. But this is also an association, or better known as a relationship within the CRM. So a way to better understand these associations can start from an object's record within the CRM. Within this record is where we store the properties for that particular object, but also its associations. In order to view an object's current associations on a record, you can do so by viewing on the right hand side of the record where you see a company, a deal, and ticket associations. However, you can customize these views on the record and the associations. Now let's dive more into what the association is, and also some customizable attributes you might find helpful. Okay, so when needing to associate an object with other CRM objects like your contacts, companies, deals, and tickets, an association can be created and applied with or without a label. So within this example that I'm sharing with you all, I'm actually pointing out an object, and that object is our contact, and the contact can be associated with a custom object as well. In this case, our custom object is a summer camp. I can also use a label to create an association between that contact object and the custom object. Summer camp this association could be mentioned as a campers, but I want to use a label. Labels come in handy when you need to associate records to specify a relationship between associated standard objects. You can also use primary labels or create custom association labels to define your object and record relationships. Labels are always encouraged, so even if an object only has one association, using labels to define the relationship between those objects really eliminates any sort of confusion amongst anyone. So anyone utilizing the system is aware of this association. I should also note that HubSpot does automatically create associations for custom objects. Those are associations with emails, notes, meetings, calls, tasks, and even conversation objects, which is super helpful. You can also create custom associations on top of these default associations. For example, you've got a contact and a company. Those two have a default association, but you can create a custom association between the two, such as an association to track a CEO of a company. That would be helpful. So if you ever need to associate an object with another object different from any of the ones that I just listed for you, you can do so with a schema request, or you can actually do it directly within the HubSpot app in the UI. Another way that you can visualize data associations to your objects within the CRM is is by utilizing a HubSpot beta feature called the Data Model Overview. So if you're a HubSpot Enterprise user and you're new and you want to be able to visualize your data, make sure to check out the beta for the data model, enroll in this, and take advantage of this tool. You can also access this tool within OpsHub. So as you can imagine, this tool is a great way to visualize your business data, and also it allows you to understand how this data is represented within the CRM platform itself. So this is awesome. For developers who are beginning their HubSpot development journey, or those of you who are just starting to import data into the CRM and you want to better understand it and utilize that data better. So now that you have a good idea of what associations are and also just how important they are in relation to our objects, I want to dive into a topic that's a little bit more advanced. But what I believe is super helpful as you continue your onboarding as a CRM developer for HubSpot, and that advanced topic is GraphQL. GraphQL is something I have to admit, I didn't learn much about until I joined HubSpot prior when I was an API developer, we never utilized GraphQL and I'm truly unaware of its capabilities. I've been telling all of my developer friends now, but because of this I do recognize how helpful it is for our developers here at HubSpot, but more importantly for our external developers, just because of how much it can help you as you work with the CRM and and especially for those of you who are working to build custom solutions for the CRM for your customer and their business needs. So traditionally with a REST API, you have a URL or server where your data entities live, and when an API request is made and then received, the API responds with your data payload of that request. However, this might not be useful, but you need to make more multiple requests, especially at the same time. Imagine if with all of your CRM objects, perhaps you want to make additional requests and not just requests for contacts or companies, any of your other standard objects. But since GraphQL is essentially what is a query language, you can use it to make multiple requests with the API. So you're never over fetching or under fetching data. Instead you're relying on REST APIs and their endpoints for each service. GraphQL allows you to create a single endpoint that accepts the multiple queries for the multiple requests, and this enables you to make those multiple requests at once. And you can access data for CRM objects and data for associated objects all at once. So that's what's so great about GraphQL. You're going to get the exact data that you want, no more, no less. And it does this by describing the requested data with a syntax and it mirrors its return in JSON. So let's say you have a front end dev and they're describing the data that they need to request, and then you have your back end device who will write the code to resolve this request. Well, the Query syntax for GraphQL works with several different types of programming languages. It's awesome. And since GraphQL isn't tied to a specific type of database or storage entity, it's just backed by your existing code and data. So you can start by using GraphQL by first defining your schema for your own objects. However, I should note that GraphQL helps more than just this. It enables not just our CRM developers, but also our CMS developers to utilize a single query across CMS sites. Also, with custom coded workflow actions, integrations, and a lot more, it allows developers to build purpose built solutions such as a customer Portal or custom quotes, a content library, commerce portals, and it offers customization to developers who want to take these features further for their clients and their business needs. So within HubSpot, the GraphQL schema is what describes your data source that you're fetching data from, and it includes the data types available to your HubSpot account. The schema is auto generated and will update if you add any custom properties, custom objects, or even associated object types. A GraphQL query consists of a tree of nested fields. So let's break down this query that we're looking at and its syntax. The operation type is either query, mutation or subscription, and it describes what type of operation you want to execute. The operation name is meaningful and an explicit name specific to your operation. And in this case, in this query that we're looking at, our operation type is query and our operation name is my query and the root query field is what's your data Source? So for HubSpot, this could either be your CRM or HubDB. This query also specifies the data that you wish to fetch, and in this case it's a collection of contacts with the associated properties, email, first name and last name as a list. So take a look at that collection data type. This asks to retrieve a list of objects that type. You can provide arguments to a query field to fetch just a single object or filter a collection of objects. You can even add arguments to your collection field within your query, or if you need to filter, paginate, or even the order of response, you can do so. You can also add a filter and combine multiple of them in your query by groups. This is pretty awesome when it comes to a search functionality. So instead of using a single search endpoint, you can actually query and get the exact result that you need for your search by using GraphQL. Now there are a ton of additional use cases GraphQL could be used for and its capability with the HubSpot CMS, but I'm going to stop myself there. I definitely suggest you reference our current documentation for GraphQL to learn more about it and also how you can utilize it to upload your GraphQL files within your HubSpot account. Did I also mention that you can use the HubSpot CLI with GraphQL? The capabilities are endless and once you overcome the Complexities with the GraphQL syntax, you'll realize the clean approach that enables when you need to make data requests. I honestly can't wait to start learning more about how I can utilize this tool and I'm super excited to see how you do too, or how you already have. So real quick, I want to point out something if you haven't been introduced to it yet. So currently, once you've figured out the GraphQL syntax and you're ready to test your GraphQL query, there's actually an open source tool that allows you to run your queries interactively within your HubSpot account, and that's GraphQL. It's pretty amazing how it allows you to build and edit your queries just by choosing your object and also its associated field for the data that you need. You can specify which properties you want, you can add this to your query, you can also add necessary arguments to your fields. Then, whenever you're ready, you can test your query by clicking on the Play icon within the explorer and the response for the query will generate and appear on the right side of your screen. The HubSpot development team implemented this open source GraphQL explorer directly in the HubSpot app, and it makes getting started and composing queries really easy, especially when you need to make API calls Simple. So you can also reference this tool. Oh, before I mention, before I forget, you can also reference a cheat sheet on the right side of the explorer and it explains each field and its values within the schema. So this way you truly understand the data within your Response to your GraphQL query. This tool is also available amongst your CRM development tools, so if you have access to these tools, make sure you check this out and utilize it. And also before I move on, I want to note that GraphQL is not a replacement for APIs. It's not. Not even Hubble. But it should be thought of as an additional tool in the developer toolbox that that helps you. Especially when we have tons of data, querying and traversing relationships of data is required. I also like to note that GraphQL should be live in all CMS Pro portals for you to start using, so please be sure to check this out. All right, so now that I've given you a little direction about where to start when developing with the CRM, perhaps you still have questions or you've discovered a solution during your onboarding and you want to be able to share that with developers, I don't blame you. Well, when beginning any new project or really learning any new platform or tech stack, it's important to identify and connect with others who are doing the same as you, but also those connect with those who have more experience. So make sure that you connect with the HubSpot Developer Community, I'm going to share with you some resources and also show you where you can connect with other devs like yourself. All right, so if you haven't already, please, you need to check out the HubSpot developer community forum. Because if you want to connect with other developers and have API questions or or you're learning GraphQL and you have a question about the syntax, make sure to check the Community forums. Here's where you can access also a section called Developer Discussions and you can also post your questions there. You can contribute to discussions, you can even share resources. Or maybe you identified a roadblock. I just can't stress enough to you how important it is to to connect with other developers. When you're a newbie, but also a newbie to the CRM, it's great to just start asking questions if something isn't making sense, and also just to help others. So now I'm going to share with you some really helpful resources that you can reference as you ramp up and start working with the CRM. Here I've listed some key resources that I use regularly and also I'm going to point out where you can find them. So feel free to take a screenshot or if you don't already, just make sure to bookmark these first. It's the HubSpot API docs. This is where you can learn about Anything and everything HubSpot APIs. If you need to reference and understand an endpoint, you need access to a URI. Go there the HubSpot developer change log. Make sure to subscribe to this newsletter. It'll tell you about any breaking changes and also let you know if there's any platform updates or features or new functionalities. There's also the blog I contribute to this, but you can make sure to check this for to learn about best practices and any specific use cases. Then there's the Academy. You can learn all about HubSpot products and how to use them. Then last but not least is the Knowledge Blaze. This is Anything and everything HubSpot. Whether you need to learn about a product from a technical standpoint or a business standpoint and need the extra context, all of these are intended to help you succeed with your development journey with HubSpot. Okay, so now that you've been given this roadmap about where you can start with your CRM development, maybe you know, it's likely that you might face some challenges. And especially when you're a newbie in tech and there's a learning curve you're learning about a new product and how to develop with it. Sometimes during this learning curve, you can experience something called imposter syndrome. Well, let me reassure you that you're not alone. Myself and my colleagues here with you today have all faced imposter syndrome at some point in our careers, or honestly, even regularly during periods of time. But the important thing to remember is when you feel this way, ask questions. There really is no such thing as a stupid question. I'm always relieved when someone has the courage to speak up and ask something that I've been scared to ask. Also, don't be afraid to ask for help. There's no shame in needing a little extra guidance or needing to see an example. Depending on your learning style, you may need something explained in a different way just in order for it to make sense. And click it doesn't mean you're any less smart than someone else. And then also be vulnerable. Folks often mistake vulnerability for weakness, and I truly think that vulnerability, it takes courage. And also, do not hesitate to reach out to your fellow hubspotters. You can reach out to us via our Ideas website through Slack just anytime. If there's a documentation or an API functionality that doesn't make sense, let us know. We want to be able to fix it and make your development experience easier. And I also want to note that no one is an expert when they begin working with something new. It takes a lot of time and patience. Oftentimes I learn most from my mistakes, but this enables me to help others who might be experiencing the same sort of challenges. So being a noob isn't so bad. It allows you to help others more and be humble and empathetic to others. This way you can learn more and most importantly, you can learn together and we can help build the best solution for the CRM for our customers. So I just want to take a moment now to thank you for joining my session. And I hope if you're a new developer or or you're a veteran and you have some new developers joining your team that this creates essentially a path for them to begin learning about the CRM and how to work with it best. And also it just points out some helpful resources to let you know that we're always here to help you out. All right, Please feel free to reach out to me with any questions or any concerns. Or if you run into a roadblock, we'll see if we can figure it out together. Thanks everyone. Enjoy. Extend.










