APIs & Integrations

nina_pashinina
Member

dropdown values per API

SOLVE

Hello,

 

is it possible to get the list of dropdown values of user defined contact property field per API?

nina_pashinina_0-1675257255384.png

 

0 Upvotes
1 Accepted solution
Jaycee_Lewis
Solution
Community Manager
Community Manager

dropdown values per API

SOLVE

Hi, @nina_pashinina 👋 You can use the Properties API to get this info. You'll need the internal value for your user-created property. 

Here's the quick steps:

  • Navigate to Settings > Properties > Contacts 
  • Click into your property
  • Click the </> symbol (screenshot) and copy the internal value 
    CleanShot 2023-02-01 at 18.54.59.png
  •  Use the Properties API endpoint — Read a property
    GET /crm/v3/properties/{objectType}/{propertyName}
    ​

Here's my quick test using my custom property:

  • Request
    curl --request GET \
      --url 'https://api.hubapi.com/crm/v3/properties/0-1/acat?archived=false' \
      --header 'authorization: Bearer YOUR_ACCESS_TOKEN'​
  • Response
    HTTP 200
    
    {
      "updatedAt": "2022-01-14T17:38:57.647Z",
      "createdAt": "2021-06-09T06:10:33.617Z",
      "name": "acat",
      "label": "acat",
      "type": "enumeration",
      "fieldType": "checkbox",
      "description": "",
      "groupName": "contactinformation",
      "options": [
        {
          "label": "Black",
          "value": "Black",
          "displayOrder": 0,
          "hidden": false
        },
        {
          "label": "White",
          "value": "White",
          "displayOrder": 1,
          "hidden": false
        },
        {
          "label": "Lazy",
          "value": "Lazy",
          "displayOrder": 2,
          "hidden": false
        },
        {
          "label": "Cunning",
          "value": "Cunning",
          "displayOrder": 3,
          "hidden": false
        },
        {
          "label": "",
          "value": "",
          "displayOrder": 4,
          "hidden": false
        },
        {
          "label": "Orange",
          "value": "Orange",
          "displayOrder": 5,
          "hidden": false
        }
      ],
      "createdUserId": "10233975",
      "updatedUserId": "10233975",
      "displayOrder": -1,
      "calculated": false,
      "externalOptions": false,
      "archived": false,
      "hasUniqueValue": false,
      "hidden": false,
      "showCurrencySymbol": false,
      "modificationMetadata": {
        "archivable": true,
        "readOnlyDefinition": false,
        "readOnlyValue": false
      },
      "formField": true
    }​

Have fun building! — Jaycee


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !

View solution in original post

0 Upvotes
1 Reply 1
Jaycee_Lewis
Solution
Community Manager
Community Manager

dropdown values per API

SOLVE

Hi, @nina_pashinina 👋 You can use the Properties API to get this info. You'll need the internal value for your user-created property. 

Here's the quick steps:

  • Navigate to Settings > Properties > Contacts 
  • Click into your property
  • Click the </> symbol (screenshot) and copy the internal value 
    CleanShot 2023-02-01 at 18.54.59.png
  •  Use the Properties API endpoint — Read a property
    GET /crm/v3/properties/{objectType}/{propertyName}
    ​

Here's my quick test using my custom property:

  • Request
    curl --request GET \
      --url 'https://api.hubapi.com/crm/v3/properties/0-1/acat?archived=false' \
      --header 'authorization: Bearer YOUR_ACCESS_TOKEN'​
  • Response
    HTTP 200
    
    {
      "updatedAt": "2022-01-14T17:38:57.647Z",
      "createdAt": "2021-06-09T06:10:33.617Z",
      "name": "acat",
      "label": "acat",
      "type": "enumeration",
      "fieldType": "checkbox",
      "description": "",
      "groupName": "contactinformation",
      "options": [
        {
          "label": "Black",
          "value": "Black",
          "displayOrder": 0,
          "hidden": false
        },
        {
          "label": "White",
          "value": "White",
          "displayOrder": 1,
          "hidden": false
        },
        {
          "label": "Lazy",
          "value": "Lazy",
          "displayOrder": 2,
          "hidden": false
        },
        {
          "label": "Cunning",
          "value": "Cunning",
          "displayOrder": 3,
          "hidden": false
        },
        {
          "label": "",
          "value": "",
          "displayOrder": 4,
          "hidden": false
        },
        {
          "label": "Orange",
          "value": "Orange",
          "displayOrder": 5,
          "hidden": false
        }
      ],
      "createdUserId": "10233975",
      "updatedUserId": "10233975",
      "displayOrder": -1,
      "calculated": false,
      "externalOptions": false,
      "archived": false,
      "hasUniqueValue": false,
      "hidden": false,
      "showCurrencySymbol": false,
      "modificationMetadata": {
        "archivable": true,
        "readOnlyDefinition": false,
        "readOnlyValue": false
      },
      "formField": true
    }​

Have fun building! — Jaycee


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Upvotes