APIs & Integrations

KPadhiyar
参加者

I got error while creating ENUM type property for contact object.

解決

Can anyone tell me if HubSpot has made any changes related to creating properties of type ENUM? From yesterday, I’ve been getting an error while creating a property in HubSpot for the contact object.

I’m creating the property with empty options, and the error I got:
{"status":"error","message":"Property 'test_property' of object type ' 0- 1' has no options but options are re (truncated...)

KPadhiyar_0-1737710625056.png

 

 

1件の承認済みベストアンサー
zach_threadint
解決策
ガイド役

I got error while creating ENUM type property for contact object.

解決

Hi @KPadhiyar 👋

 

For most integration use cases, I generally recommend avoiding HubSpot's API Client Libraries in favour of interacting with HubSpot APIs via a dedicated HTTP request package. Regardless, based on your example request, I'd recommend [1] making sure the Contact property group name "test" exists in the given HubSpot Portal and [2] defining at least 1 option when creating properties of "enumeration" type.

 

I hope that proves helpful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


元の投稿で解決策を見る

0 いいね!
6件の返信
EJames4
メンバー

I got error while creating ENUM type property for contact object.

解決

It looks like the issue is that, HubSpot requires at least one option for ENUM-type properties. Try modifying your request like this:
"name" => "test"
"label" => "Test",
"description" => "Test",
"group_name" => "test",
"type" => "enumeration",
"field_type" => "checkbox",
"form_field" => true,
"options" => [
[
"label" => "Option 1",
"value" => "option_1",
"displayOrder" => 0
]
]
]);
Adding at least one option should help resolve the error 

0 いいね!
KJames77
メンバー

I got error while creating ENUM type property for contact object.

解決

@KPadhiyar wrote:

Can anyone tell me if HubSpot has made any changes related to creating properties of type ENUM? From yesterday, I’ve been getting an error while creating a property in HubSpot for the contact object.

I’m creating the property with empty options, and the error I got:
{"status":"error","message":"Property 'test_property' of object type ' 0- 1' has no options but options are re (truncated...)

KPadhiyar_0-1737710625056.png

 

 


It looks like the issue is due to the options array being empty. HubSpot requires at least one option for ENUM-type properties. Try adding options like this:

"options" => [

    ["label" => "Option 1", "value" => "option_1", "displayOrder" => 0]

],

0 いいね!
AliFawadHassan
参加者

I got error while creating ENUM type property for contact object.

解決

Could you please share the complete cURL request?
Additionally, please ensure that there are no spaces in the object type, such as '0-1'.

0 いいね!
KPadhiyar
参加者

I got error while creating ENUM type property for contact object.

解決

This is the error that I got from HubSpot package.
KPadhiyar_0-1737713294620.png

 

0 いいね!
KPadhiyar
参加者

I got error while creating ENUM type property for contact object.

解決

@AliFawadHassan Thanks for the reply.

I'm using PHP package for create property.(https://github.com/HubSpot/hubspot-api-php)

$request = new HubSpot\Client\Crm\Properties\Model\PropertyCreate\PropertyCreate([
"name" => "test"
  "label" => "Test"
  "description" => "Test"
  "group_name" => "test"
  "type" => "enumeration"
  "field_type" => "checkbox"
  "form_field" => true
  "options" => [],
]);

$service = $hubspot->crm()->properties()->coreApi()->create('contact', $request);

 

0 いいね!
zach_threadint
解決策
ガイド役

I got error while creating ENUM type property for contact object.

解決

Hi @KPadhiyar 👋

 

For most integration use cases, I generally recommend avoiding HubSpot's API Client Libraries in favour of interacting with HubSpot APIs via a dedicated HTTP request package. Regardless, based on your example request, I'd recommend [1] making sure the Contact property group name "test" exists in the given HubSpot Portal and [2] defining at least 1 option when creating properties of "enumeration" type.

 

I hope that proves helpful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


0 いいね!