カスタムオブジェクト

APPLICABLE PRODUCTS
  • Marketing Hub
    • Enterprise
  • Sales Hub
    • Enterprise
  • Service Hub
    • Enterprise
  • CMS Hub
    • Enterprise
  • Operations Hub
    • Enterprise

In each HubSpot account, there are the standard CRM objects: contacts, companies, deals, and tickets. To represent and organize your CRM data based on your business needs, you can also create custom objects. You can create a custom object in HubSpot, or use the custom objects API to define custom objects, properties, and associations to other CRM objects. 

Below, learn how to create and manage custom objects through the API, and see a walkthrough of creating an example custom object.

To learn more about creating custom objects, check out the following posts on the HubSpot developer blog:

Please note: custom objects are specific to each account, and depending on your subscription, there are limits on the number of custom objects you can create. Learn more about your limits in the HubSpot Products & Services catalog.

認証方法

次の認証方法のいずれかを使用して、カスタムオブジェクトの作成、読み取り、更新を行うことができます。

Please note: as of November 30, 2022, HubSpot API Keys are being deprecated and are no longer supported. Continued use of HubSpot API Keys is a security risk to your account and data. During this deprecation phase, HubSpot may deactivate your key at any time.

You should instead authenticate using a private app access token or OAuth. Learn more about this change and how to migrate an API key integration to use a private app instead.

カスタムオブジェクトを作成する

カスタムオブジェクトを作成するには、まず、オブジェクトスキーマを定義する必要があります。スキーマには、オブジェクトの名前、プロパティー、および他のCRMオブジェクトとの関連付けを含めます。この記事の上部にある[オブジェクトスキーマ]タブで、スキーマリクエストの詳細を確認できます以下のサンプルチュートリアルで、リクエストの例を確認することもできます。

カスタム オブジェクト スキーマを作成するには、crm/v3/schemasに対してPOSTリクエストを行います。リクエスト本文に、オブジェクトスキーマの定義(オブジェクトの名前、プロパティー、関連付け)を含めます。

カスタムオブジェクトに名前を付けるときは、次の点に留意してください。

  • オブジェクトを作成した後に、オブジェクトの名前とラベルを変更することはできません。
  • 名前には、文字、数字、アンダースコア、ハイフンのみを使用できます。
  • 名前は文字で始める必要があります。
  • 製品の特定の部分では、長いラベルが切り詰められる場合があります。

オブジェクトのプロパティーと関連付けに必要な定義については、以下の説明をお読みください。 

プロパティー

リクエスト本文で定義したプロパティーは、個々のカスタム オブジェクト レコードに情報を格納するために使用されます。

Please note: you can have up to 10 unique value properties for each custom object in your HubSpot account.

定義したプロパティーを使用して、以下のプロパティーベースのフィールドに値を入力します。

  • requiredProperties:新しいカスタム オブジェクト レコードを作成するときに必要なプロパティー。
  • searchableProperties:HubSpotでの検索に使用するためにインデックス付けされるプロパティー。
  • primaryDisplayProperty:個々のカスタム オブジェクト レコードに名前を付けるために使用されるプロパティー。
  • secondaryDisplayProperties:primaryDisplayPropertyに属する個々のレコードに表示されるプロパティー。
    custom-object-secondary-display-properties0
    • secondaryDisplayPropertiesにリストされる最初のプロパティーは、そのタイプが以下のいずれかの場合、オブジェクト インデックス ページにも4つ目のフィルターとして追加されます。
      • string
      • number
      • enumeration
      • boolean
      • datetime
        custom-object-dashboard-filter0
    • UIから表示プロパティーを削除するには、まず、プロパティーを削除してから再作成する必要があります。

デフォルトでは、スキーマリクエストによってプロパティーを作成する際に、typeプロパティーはstringに設定され、fieldTypeプロパティーはtextに設定されます。以下の値を使用して、さまざまな型のプロパティーを作成できます。

有効なtypeの値
type 説明 有効なfieldTypeの値
enumeration 一連のオプションを表す文字列。各オプションをセミコロンで区切って入力します。  booleancheckboxcheckboxradioselect
date 特定の年、月、日を表すISO 8601形式の値 date
dateTime 特定の年、月、日、時刻を表すISO 8601形式の値。HubSpotアプリ上には時刻は表示されません。 date
string プレーンテキスト文字列。文字数の上限は65,536文字です。 filetexttextarea
number 数値。小数の桁数は最大1つまで。 number
有効なfieldTypeの値 
fieldType 説明
booleancheckbox ユーザーが「はい」または「いいえ」のいずれかを選択できる入力。フォーム内で使用する場合、1つのチェックボックスとして表示されます。
checkbox プロパティー内で使用可能な選択肢の中からユーザーが複数選択できるチェックボックスのリスト。
date 日付値。日付入力として表示されます。
file ファイルのフォームへのアップロードが可能。ファイルへのURLリンクとして格納および表示されます。
number 一連の数字。10進数または指数表記として記述。
radio プロパティーで許容される選択肢の中からユーザーがいずれか1つを選択できる入力。フォーム内で使用する場合、一連のラジオボタンとして表示されます。
select プロパティーで許容される選択肢の中からユーザーがいずれか1つを選択できるドロップダウンの入力。
text プレーンテキスト文字列。単行テキスト入力として表示されます。
textarea プレーンテキスト文字列。複数行テキスト入力として表示されます。

関連付け

HubSpotは、カスタムオブジェクトに自動的にEメール、ミーティング、メモ、タスク、コール、コミュニケーションオブジェクトを関連付けます。さらに、カスタムオブジェクトに他の標準的なHubSpotオブジェクトや他のカスタムオブジェクトを関連付けることもできます。

スキーマ作成リクエストによって関連付けを作成する場合は、以下の例に示すように、名前を使用して標準のオブジェクトを識別し、objectTypeIdを使用してカスタムオブジェクトを識別します。

// Example associatedObjects array "associatedObjects": [ "CONTACT", "COMPANY", "TICKET", "DEAL", "2-3453932" ]

既存のカスタムオブジェクトを取得する

全てのカスタムオブジェクトを取得するには、GETリクエストを/crm/v3/schemasに送信します。

特定のカスタムオブジェクトを取得する場合は、次のエンドポイントのいずれかに対してGETリクエストを送信します。

例えば、IDが1234で、lenderという名前のオブジェクトを持つアカウントの場合、リクエストURLは次のようになります。

  • https://api.hubapi.com/crm/v3/schemas/2-3465404
  • https://api.hubapi.com/crm/v3/schemas/p_lender
  • https://api.hubapi.com/crm/v3/schemas/p1234_lender

既存のカスタムオブジェクトを更新する

オブジェクトのスキーマを更新するには、PATCHリクエストをhttps://api.hubapi.com/crm/v3/schemas/{objectTypeId}に送信します。

カスタムオブジェクトの定義の完了後:

  • オブジェクトの名前とラベル(単数形と複数形)を変更することはできません
  • requiredPropertiessearchablePropertiesprimaryDisplayPropertysecondaryDisplayPropertiesは、オブジェクトのスキーマを更新することで変更できます。新しいプロパティーを、必須プロパティー、検索可能プロパティー、または表示プロパティーとして設定するには、スキーマを更新する前にそのプロパティーを作成する必要があります。
  • カスタム オブジェクト プロパティーは、HubSpotで、またはプロパティーAPIを使用して作成および編集できます。 

関連付けを更新する

カスタムオブジェクトに他のオブジェクト関連付けを追加するには、POSTリクエストを/crm/v3/schemas/{objectTypeId}/associationsに送信します。

カスタムオブジェクトには、標準のHubSpotオブジェクト(「コンタクト「会社「取引「チケット」など)または他のカスタムオブジェクトを関連付けることができます。以下の例に示すように、toObjectTypeIdフィールドで、カスタムオブジェクトはそのobjectTypeId値で識別し、標準のオブジェクトはその名前で識別します。例えば、次のような日付形式が対象です。

// Example association request body { "fromObjectTypeId": "2-3444025", "toObjectTypeId": "ticket", "name": "cat_to_ticket" }

カスタムオブジェクトを削除する

カスタムオブジェクトは、そのタイプの全てのオブジェクトインスタンスが削除された後にのみ削除できます。カスタムオブジェクトを削除するには、DELETEリクエストを/crm/v3/schemas/{objectType}に送信します。

削除したオブジェクトと同じ名前の新しいカスタムオブジェクトを作成する必要がある場合は、DELETEリクエストを/crm/v3/schemas/{objectType}?archived=trueに送信して、スキーマのハード(物理)削除を行う必要があります。カスタム オブジェクト タイプの削除は、そのタイプの全てのオブジェクトインスタンス、関連付け、カスタムオブジェクトのプロパティーが削除された後のみしかできません。

サンプル カスタム オブジェクト

以下は、サンプル カスタム オブジェクトの作成方法を説明するチュートリアルです。記載されているリクエストの詳細については、記事の上部にある[オブジェクトスキー]タブを参照してください。

このチュートリアルの内容は次のとおりです。

  1. カスタム オブジェクト スキーマの作成
  2. カスタム オブジェクト レコードの作成
  3. カスタム オブジェクト レコードへのHubSpotコンタクトの関連付け
  4. カスタムオブジェクトとHubSpotチケットとの間の新しい関連付け定義の作成
  5. 新しいプロパティー定義の作成 
  6. 新しいプロパティーの追加による、オブジェクトスキーマ( secondaryDisplayProperties)の更新

目標:CarSpotという自動車販売店では、在庫をHubSpotに保存するために、カスタムオブジェクトを使用したいと考えています。車両の所有権と購入のトラッキングを行うには、車両にコンタクトレコードを関連付ける必要があります。その過程で、HubSpotチケットとカスタムプロパティーを使用して車両メンテナンスのトラッキングも行います。

オブジェクトスキーマを作成する

CarSpotでは、次の属性をプロパティーとして表すことができるオブジェクトスキーマを作成する必要があります。 

  1. 条件(新車または中古車):enumeration
  2. 販売店受付日:date
  3. 製造年:number
  4. メーカー:string
  5. モデル:string
  6. VIN:string(固有の値)
  7. 色:string
  8. 走行距離:number
  9. 価格:number
  10. メモ:string

また、カスタムオブジェクトと標準のコンタクトオブジェクトの関連付けを定義して、車を潜在的な購入者に結び付けられるようにします。 

データモデルが完成したら、オブジェクトスキーマを作成するために、POSTリクエストを/crm/v3/schemasに送信します。このリクエストの本文は次のように設定します。全て

// Example POST request to https://api.hubspot.com/crm/v3/schemas { "name": "cars", "labels": { "singular": "Car", "plural": "Cars" }, "primaryDisplayProperty": "model", "secondaryDisplayProperties": [ "make" ], "searchableProperties": [ "year", "make", "vin", "model" ], "requiredProperties": [ "year", "make", "vin", "model" ], "properties": [ { "name": "condition", "label": "Condition", "type": "enumeration", "fieldType": "select", "options": [ { "label": "New", "value": "new" }, { "label": "Used", "value": "used" } ] }, { "name": "date_received", "label": "Date received", "type": "date", "fieldType": "date" }, { "name": "year", "label": "Year", "type": "number", "fieldType": "number" }, { "name": "make", "label": "Make", "type": "string", "fieldType": "text" }, { "name": "model", "label": "Model", "type": "string", "fieldType": "text" }, { "name": "vin", "label": "VIN", "type": "string", "hasUniqueValue": true, "fieldType": "text" }, { "name": "color", "label": "Color", "type": "string", "fieldType": "text" }, { "name": "mileage", "label": "Mileage", "type": "number", "fieldType": "number" }, { "name": "price", "label": "Price", "type": "number", "fieldType": "number" }, { "name": "notes", "label": "Notes", "type": "string", "fieldType": "text" } ], "associatedObjects": [ "CONTACT" ] }

このAPI呼び出しの応答は次のようになります。全てをコピー

// Example response body HTTP 201 { "name": "cars" "labels": { "singular": "Car", "plural": "Cars" }, "primaryDisplayProperty": "model", "secondaryDisplayProperties": [ "make" ], "searchableProperties": [ "year", "make", "vin", "model" ], "requiredProperties": [ "year", "make", "vin", "model" ], "archived": false, "restorable": true, "metaType": "PORTAL_SPECIFIC", "id": "3465404", "fullyQualifiedName": "p1234567_cars", "createdAt": "2021-10-01T15:15:07.340Z", "updatedAt": "2021-10-01T15:15:07.340Z", "objectTypeId": "2-3465404", "properties": [ { { "id": "529881", "createdAt": "2020-02-23T01:24:54.508774Z", "updatedAt": "2020-02-23T01:24:54.508774Z", "properties": [ { "updatedAt": "2020-02-23T01:24:54.665Z", "createdAt": "2020-02-23T01:24:54.665Z", "name": "condition", "label": "Condition", "type": "enumeration", "fieldType": "select", "groupName": "car_information", "options": [ { "label": "New", "value": "new", "displayOrder": -1, "hidden": false }, { "label": "Used", "value": "used", "displayOrder": -1, "hidden": false } ], "displayOrder": -1, "calculated": false, "externalOptions": false, "archived": false, "hasUniqueValue": false, "hidden": false, "modificationMetadata": { "archivable": true, "readOnlyDefinition": false, "readOnlyValue": false }, "formField": false }, { "updatedAt": "2020-02-23T01:24:54.667Z", "createdAt": "2020-02-23T01:24:54.667Z", "name": "date_received", "label": "Date received", "type": "date", "fieldType": "date", "groupName": "car_information", "displayOrder": -1, "calculated": false, "externalOptions": false, "archived": false, "hasUniqueValue": false, "hidden": false, "modificationMetadata": { "archivable": true, "readOnlyDefinition": false, "readOnlyValue": false }, "formField": false }, { "updatedAt": "2020-02-23T01:24:54.667Z", "createdAt": "2020-02-23T01:24:54.667Z", "name": "year", "label": "Year", "type": "number", "fieldType": "number", "groupName": "car_information", "displayOrder": -1, "calculated": false, "externalOptions": false, "archived": false, "hasUniqueValue": false, "hidden": false, "modificationMetadata": { "archivable": true, "readOnlyDefinition": false, "readOnlyValue": false }, "formField": false }, { "updatedAt": "2020-02-23T01:24:54.670Z", "createdAt": "2020-02-23T01:24:54.670Z", "name": "model", "label": "Model", "type": "string", "fieldType": "text", "groupName": "car_information", "displayOrder": -1, "calculated": false, "externalOptions": false, "archived": false, "hasUniqueValue": false, "hidden": false, "modificationMetadata": { "archivable": true, "readOnlyDefinition": false, "readOnlyValue": false }, "formField": false }, { "updatedAt": "2020-02-23T01:24:54.670Z", "createdAt": "2020-02-23T01:24:54.670Z", "name": "vin", "label": "VIN", "type": "string", "fieldType": "text", "groupName": "car_information", "displayOrder": -1, "calculated": false, "externalOptions": false, "archived": false, "hasUniqueValue": true, "hidden": false, "modificationMetadata": { "archivable": true, "readOnlyDefinition": false, "readOnlyValue": false }, "formField": false }, { "updatedAt": "2020-02-23T01:24:54.670Z", "createdAt": "2020-02-23T01:24:54.670Z", "name": "notes", "label": "Notes", "type": "string", "fieldType": "text", "groupName": "car_information", "displayOrder": -1, "calculated": false, "externalOptions": false, "archived": false, "hasUniqueValue": false, "hidden": false, "modificationMetadata": { "archivable": true, "readOnlyDefinition": false, "readOnlyValue": false }, "formField": false }, { "updatedAt": "2020-02-23T01:24:54.670Z", "createdAt": "2020-02-23T01:24:54.670Z", "name": "color", "label": "Color", "type": "string", "fieldType": "text", "groupName": "car_information", "displayOrder": -1, "calculated": false, "externalOptions": false, "archived": false, "hasUniqueValue": false, "hidden": false, "modificationMetadata": { "archivable": true, "readOnlyDefinition": false, "readOnlyValue": false }, "formField": false }, { "updatedAt": "2020-02-23T01:24:54.667Z", "createdAt": "2020-02-23T01:24:54.667Z", "name": "mileage", "label": "Mileage", "type": "number", "fieldType": "number", "groupName": "car_information", "displayOrder": -1, "calculated": false, "externalOptions": false, "archived": false, "hasUniqueValue": false, "hidden": false, "modificationMetadata": { "archivable": true, "readOnlyDefinition": false, "readOnlyValue": false }, "formField": false }, { "updatedAt": "2020-02-23T01:24:54.667Z", "createdAt": "2020-02-23T01:24:54.667Z", "name": "price", "label": "Price", "type": "number", "fieldType": "number", "groupName": "car_information", "displayOrder": -1, "calculated": false, "externalOptions": false, "archived": false, "hasUniqueValue": false, "hidden": false, "modificationMetadata": { "archivable": true, "readOnlyDefinition": false, "readOnlyValue": false }, "formField": false }, { "updatedAt": "2020-02-23T01:24:54.667Z", "createdAt": "2020-02-23T01:24:54.667Z", "name": "make", "label": "Make", "type": "string", "fieldType": "text", "groupName": "car_information", "displayOrder": -1, "calculated": false, "externalOptions": false, "archived": false, "hasUniqueValue": false, "hidden": false, "modificationMetadata": { "archivable": true, "readOnlyDefinition": false, "readOnlyValue": false }, "formField": false } ], "associations": [ { "id": "1", "createdAt": null, "updatedAt": null, "fromObjectTypeId": "2-529881", "toObjectTypeId": "0-1", "name": "car_to_contact" }, { "id": "2", "createdAt": null, "updatedAt": null, "fromObjectTypeId": "0-1", "toObjectTypeId": "2-529881", "name": "car_to_contact" }, { "id": "13", "createdAt": null, "updatedAt": null, "fromObjectTypeId": "2-529881", "toObjectTypeId": "0-27", "name": "car_to_task" }, { "id": "14", "createdAt": null, "updatedAt": null, "fromObjectTypeId": "0-27", "toObjectTypeId": "2-529881", "name": "car_to_task" }, { "id": "15", "createdAt": null, "updatedAt": null, "fromObjectTypeId": "2-529881", "toObjectTypeId": "0-46", "name": "car_to_note" }, { "id": "16", "createdAt": null, "updatedAt": null, "fromObjectTypeId": "0-46", "toObjectTypeId": "2-529881", "name": "car_to_note" }, { "id": "7", "createdAt": null, "updatedAt": null, "fromObjectTypeId": "2-529881", "toObjectTypeId": "0-48", "name": "car_to_call" }, { "id": "8", "createdAt": null, "updatedAt": null, "fromObjectTypeId": "0-48", "toObjectTypeId": "2-529881", "name": "car_to_call" }, { "id": "11", "createdAt": null, "updatedAt": null, "fromObjectTypeId": "2-529881", "toObjectTypeId": "0-51", "name": "car_to_conversation_session" }, { "id": "12", "createdAt": null, "updatedAt": null, "fromObjectTypeId": "0-51", "toObjectTypeId": "2-529881", "name": "car_to_conversation_session" }, { "id": "9", "createdAt": null, "updatedAt": null, "fromObjectTypeId": "2-529881", "toObjectTypeId": "0-49", "name": "car_to_email" }, { "id": "10", "createdAt": null, "updatedAt": null, "fromObjectTypeId": "0-49", "toObjectTypeId": "2-529881", "name": "car_to_email" }, { "id": "5", "createdAt": null, "updatedAt": null, "fromObjectTypeId": "2-529881", "toObjectTypeId": "0-47", "name": "car_to_meeting_event" }, { "id": "6", "createdAt": null, "updatedAt": null, "fromObjectTypeId": "0-47", "toObjectTypeId": "2-529881", "name": "car_to_meeting_event" } ] }

After creating the object schema, CarSpot makes sure to note the new object's {objectTypeId} field, as they'll use this for fetching and updating the object later. They can also use the {fullyQualifiedName} value, if they prefer.

カスタム オブジェクト レコードを作成する

カスタムオブジェクトが作成されたら、CarSpotは、在庫にある車両ごとにオブジェクトレコードを作成できます。

最初の車両のオブジェクトレコードを作成するために、次のようにリクエスト本文を設定したPOSTリクエストを/crm/v3/objects/2-3465404に送信します。

// Example POST request to https://api.hubspot.com/crm/v3/objects/2-3465404 { "properties": { "condition": "used", "date_received": "1582416000000", "year": "2014", "make": "Nissan", "model": "Frontier", "vin": "4Y1SL65848Z411439", "color": "White", "mileage": "80000", "price": "12000", "notes": "Excellent condition. No accidents." } }

このAPI呼び出しの応答は次のようになります。全てをコピー

// Example response body { "id": "181308", "properties": { "color": "White", "condition": "used", "make": "Nissan", "mileage": "80000", "model": "Frontier", "vin": "4Y1SL65848Z411439", "notes": "Excellent condition. No accidents.", "price": "12000", "year": "2014", "date_received": "1582416000000" }, "createdAt": "2020-02-23T01:44:11.035Z", "updatedAt": "2020-02-23T01:44:11.035Z", "archived": false }

レコードが作成された後は、id値を使用して、車両に既存のコンタクトを関連付けることができます。

If they wanted to later retrieve this record along with specific properties, they could make a GET request to https://api.hubapi.com/crm/v3/objects/2-3465404/181308?portalId=1234567&properties=year&properties=make&properties=model

カスタム オブジェクト レコードを別のレコードに関連付ける

新しい車両レコードのID(181308)と別のレコードのIDを使用して、カスタム オブジェクト レコードを別のオブジェクトのレコードに関連付けることができます。

関連付けを作成するには、PUTリクエストを/crm/v3/objects/{objectType}/{objectId}/associations/{toObjectType}/{toObjectId}/{associationType}に送信します。オブジェクトの関係がすでに定義されている場合、associationType値を判別するには、GETリクエストをcrm/v3/schemas/{objectType}に送信します。

例えば、コンタクトID 51と関連付けタイプ75を使用して、CarSpotは車両レコードにコンタクトを関連付けることができます。上記のIDを使用して、次のリクエストURLが作成されます。

https://api.hubspot.com/crm/v3/objects/2-3465404/181308/associations/contacts/51/75

新しい関連付けを定義する

CarSpotは次に、車両の販売後サービスのトラッキングを開始したいと考えています。そのために、HubSpotのチケットを使用して、実施されたメンテナンスをログに記録します。

車両とチケットを関連付けられるようにするために、次のようにリクエストの本文を設定したPOSTリクエストを/crm/v3/schemas/2-3465404/associationsに送信して、新しい関連付けを作成します。

// Example POST request to https://api.hubspot.com/crm/v3/schemas/2-3465494/associations { "fromObjectTypeId": "2-3465404", "toObjectTypeId": "ticket", "name": "car_to_ticket" }

このAPI呼び出しの応答は次のようになります。全てをコピー

// Example response { "id": "121", "createdAt": "2020-02-23T01:52:12.893826Z", "updatedAt": "2020-02-23T01:52:12.893826Z", "fromObjectTypeId": "2-3465404", "toObjectTypeId": "0-5", "name": "car_to_ticket" }

When creating a new association between two custom objects, specify the custom objects by their objectTypeId in the toObjectTypeId field. For standard objects, you can identify them by name or use the following values: 

  • Contact: 0-1
  • Company: 0-2
  • Deal: 0-3
  • Ticket: 0-5

新しいプロパティーを定義する

メンテナンスのトラッキングを進めるにつれて、CarSpotはメンテナンスサービスをパッケージにバンドルする機会に気づきました。個々の車両レコードでこれらのメンテナンスパッケージのトラッキングを行うために、利用可能なパッケージを含む新しいenumeration型プロパティーを作成します。

新しいプロパティーを定義するには、次のようにリクエスト本文を設定したPOSTリクエストを/crm/v3/properties/2-3465404に送信します。

// Example POST request to https://api.hubspot.com/crm/v3/properties/2-3465404 { "groupName": "car_information", "name": "maintenance_package", "label": "Maintenance Package", "type": "enumeration", "fieldType": "select", "options": [ { "label": "Basic", "value": "basic" }, { "label": "Oil change only", "value": "oil_change_only" }, { "label": "Scheduled", "value": "scheduled" } ] }

このAPI呼び出しの応答は次のようになります。全てをコピー

// Example response { "updatedAt": "2020-02-23T02:08:20.055Z", "createdAt": "2020-02-23T02:08:20.055Z", "name": "maintenance_package", "label": "Maintenance Package", "type": "enumeration", "fieldType": "select", "groupName": "car_information", "options": [ { "label": "Basic", "value": "basic", "displayOrder": -1, "hidden": false }, { "label": "Oil change only", "value": "oil_change_only", "displayOrder": -1, "hidden": false }, { "label": "Scheduled", "value": "scheduled", "displayOrder": -1, "hidden": false } ], "displayOrder": -1, "calculated": false, "externalOptions": false, "archived": false, "hasUniqueValue": false, "hidden": false, "modificationMetadata": { "archivable": true, "readOnlyDefinition": false, "readOnlyValue": false }, "formField": false }

プロパティーが作成されたので、このプロパティーを各車両レコードのサイドバーに表示して、営業担当者や技術者が情報をすぐに利用できるようにしたいと考えています。それには、このプロパティーをsecondaryDisplayPropertiesに追加するために、次のようにリクエスト本文を設定したPATCHリクエストを/crm/v3/schemas/2-3465404に送信します。 

// Example PATCH request to https://api.hubspot.com/crm/v3/schemas/2-3465404 { "secondaryDisplayProperties": [ "maintenance_package" ] }

このAPI呼び出しの応答は次のようになります。全てをコピー

// Example response { "id": "3465404", "createdAt": "2020-02-23T01:24:54.537Z", "updatedAt": "2020-02-23T02:12:24.175874Z", "labels": { "singular": "Car", "plural": "Cars" }, "requiredProperties": [ "year", "model", "vin", "make" ], "searchableProperties": [ "year", "model", "vin", "make" ], "primaryDisplayProperty": "model", "secondaryDisplayProperties": [ "maintenance_package" ], "portalId": 1234567, "name": "car" }

これで、技術者が車両に関連付けられたコンタクトレコードを開くと、プロパティーがサイドバーのカスタム オブジェクト カードに表示されるようになります。

Screen Shot 2020-03-06 at 11.08.41 AM

HubSpotを使用していくにつれて、CarSpotはHubSpotのAPIを通じて、このカスタムオブジェクトを改善し拡張する方法を見出す可能性が高いでしょう。さらに、カスタム オブジェクト データを使用して動的ページを作成することも考えられます。


参考になりましたか?
こちらのフォームではドキュメントに関するご意見をご提供ください。HubSpotがご提供しているヘルプはこちらでご確認ください。