APIs & Integrations

dmattauch
Top Contributor

Mandatory Property when Creating an Object Through API

Hi,

 

I have a custom object that i created in hubspot, called "shops"

 

I create shops through the API.

 

I went into hubspot and put some properties mandatory for "shop" creation.

 

But its only working when creating a shop manually in hubspot.

 

Is there a way to make properties mandatory when creating a shop through API?

 

Many thanks

David

0 Upvotes
4 Replies 4
webdew
Guide | Diamond Partner
Guide | Diamond Partner

Mandatory Property when Creating an Object Through API

Hi @dmattauch ,

In your API calling function you can check the body that either it have the required mandatory fields or not , and proceed accordingly.

Hope this helps!
If we were able to answer your query, kindly help the community by marking it as a solution.
Thanks and Regard.

0 Upvotes
dmattauch
Top Contributor

Mandatory Property when Creating an Object Through API

Hey @Kevin-C thanks for the answer.

 

Yes but once the object created, is there a way to modify mandatory properties? Or do i need to delete the object and re-create it again?

 

Thanks 

David

0 Upvotes
Kevin-C
Recognized Expert | Partner
Recognized Expert | Partner

Mandatory Property when Creating an Object Through API

Hey @dmattauch 

 

I believe you can create new required properties, but to remove any property you must make sure that the property is not being used by any object instances.

Whenever I run into this, say I set  up the object schema incorrectly I typically remove everything and start from scratch.

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
0 Upvotes
Kevin-C
Recognized Expert | Partner
Recognized Expert | Partner

Mandatory Property when Creating an Object Through API

Hey @dmattauch 

 

I haven't dug into this too deep. But if you're creating records via an API, with a serverless or other function you could check that the body conatinas the required property "manually" before subitting to the api.

Kevin Cornett - Sr. Solutions Architect @ BridgeRev