Building A Custom Object Schema

This is a YouTube video titled "Building A Custom Object Schema" created on August 10, 2022. The content is a detailed tutorial explaining how to create a custom object schema in a CRM system using API calls, specifically with the Postman application. It guides viewers through the process of setting up authentication, defining schema properties, and associating the custom object with other CRM objects, using a fictional car dealership example. The tutorial is instructional and technical in nature, aimed at developers or users familiar with CRM customization.
You let's learn how to create your own custom object Custom objects are created through an API call. In this tutorial, we're using the API testing application Postman to make the call. API calls can also be created through the developer documentation or the HubSpot CLI. Please check the documentation if you want to build your custom object using a different method. Let's start by creating a custom object for a fictional car dealership. The car dealership wants to create a page on their CMS hub that lists the cars in their inventory. They've decided a custom object is the perfect fit for them, since they want their car data to be associated with their contacts and deals records. To create a new custom object, you have to define your object by building the schema for it. The custom object you're going to build is a custom object called car, and the schema you'll create will define the properties of the car object, like the make and model. First, you need to create a private app. To authenticate this API call in your account, click on the Gear Settings icon in the main menu. In the left hand sidebar, click on Integrations, and then choose Private Apps. Then click Create a Private App. Name this app Custom Object Authentication. Next, click on the Scopes tab. Click the standard dropdown. Scroll down until you find CRM Objects, Custom Read and CRM Objects Custom Write. Click the checkboxes beside them. Now you can view and create custom object records in the CRM. You also need the ability to read and write custom object schemas, so continue to scroll down until you find CRM Schemas Custom Read and CRM Schemas Custom Write. Click the checkboxes beside them as well. You're now granting this private app access to both reading and writing custom object schemas. Next, in the right hand corner, click Create App. In the Popup window, click Continue Creating. Next, in the new Pop up window, click on Show Token and then Copy to copy your private app's Personal access token, you now have the authentication needed to use the API call. Finally, click Skip for Now to go to the main Private App page. Now that you have your Personal access token, let's open Postman. Click the plus button in the Collections tab to add a new collection and name it CRM Object Schemas. First, set the authorization for this collection. In the Type dropdown, choose Bearer Token. Then in the Token field, paste in your Personal Access Token. Then click on the Variables tab to set the base URL. Add a new variable called baseURL. Then set the initial value to the current value will default to this now it's time to create a call. Click the three dots beside your CRM Custom Object Schemas collection and choose Add Request. Name this new request Custom Object Schema New Requests default to HTTP get request, but you need to use HTTP Post to create a new custom object. Click Git to open the dropdown. Choose Post and type your request URL Base URL CRM now it's time to build your Custom Object schema and paste it into the Body. Custom Object schemas are quite complex and have several required properties. If you would like to gain a deeper understanding, please make sure to check the developer documentation for this example. We'll keep our schema as simple as possible. The main three sections of a Custom Object schema are the Custom object name properties, and associations to other CRM objects. Keep in mind that the object's name and label can't be changed after its creation. In the Body tab, choose the Raw option and make sure the language is set to JSON. Since your schema will be inside one large JSON object with several key value pairs, we won't discuss every key value pair, but we'll highlight the required ones needed to make a successful call. The name is the internal label for the custom object and should be written in lowercase without spaces. You can add dashes between words if your name is longer than one word. The labels are the human readable versions of the custom object name and will appear in your account. You'll create both a singular and plural version. The primary display property is the property used for naming individual custom object records. The secondary display properties are the properties that appear on individual records under the primary display property. The required properties are the properties required when building a new custom object record. The searchable properties are the properties indexed for searching in HubSpot. Each custom object must have at least one property inside of the properties key. Create an array that contains the different properties. Each property must include a name, a label, a type, and field type. You must include values to choose from. If the type is enumeration, find the list of these properties in the Custom Object Developer Documentation example. Please reference this if you want to follow along. You'll also need one unique property. A unique property is not required to create a custom object, but it is required for you to be able to use your custom object records in dynamic pages. You cannot change the setting once you build the custom object, so you have to set it now. The way to do this is to use the special sub property called hasuniquevalue this property is a boolean, so so set its value to true. For this example, set the car's vehicle identification number or VIN as the unique property. A note about Properties if you forget to create a property through the API, you can create new properties for the custom object inside of your HubSpot account. In properties, refer to the Resources section to learn how to create new custom properties in your HubSpot account. The last required section is the associated object's key value pair. This value is also an array, and it can include the standard objects inside the CRM, as well as connections to any other custom objects you've created. Your Associated Objects array should include both Contact and Deal. Your custom object schema is now complete. Click the blue Send button. You'll receive a 201 created status and a message confirming the custom object has been created if your call was successful. If you want to add records to your custom object, you can. You can go back into your HubSpot account. Custom objects live in the same place as the other CRM objects. Click Contacts in the main navigation on this page. Click Contacts again to open a dropdown menu. Here you'll see a list of the CRM objects your account currently has. Scroll up to click Cars, the new object you just created. Custom objects work in the same way as any other CRM object. You can use the Import button to add data in bulk, or the Create Cars button to add a record one at a time. The great thing about custom objects is that they can be used in workflows and automations as well as inside of cms Hunt.










