# Custom contact properties not returned by API

**URL:** <https://community.hubspot.com/t/custom-contact-properties-not-returned-by-api/51560>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [February 15, 2022, 2:43pm UTC](https://community.hubspot.com/t/custom-contact-properties-not-returned-by-api/51560 "2022-02-15T14:43:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fjvalles](https://avatars.discourse-cdn.com/v4/letter/f/a3d4f5/32.png) [@fjvalles](https://community.hubspot.com/u/fjvalles)\
**Post date:** [February 15, 2022, 2:43pm UTC](https://community.hubspot.com/t/custom-contact-properties-not-returned-by-api/51560/1 "2022-02-15T14:43:41Z")

</div>

Hi,

I’m having an issue with the [hubspot ruby gem](https://github.com/HubSpot/hubspot-api-ruby) because it is not returning any custom properties.

The weird thing is that it works if I test it in the [documentation page](https://developers.hubspot.com/docs/api/crm/contacts) with my api key and the fields I want, but if I copy and paste that query with the same api key, it doesn’t return the custom fields I want.

I would appreciate some help with this!

 ![Screen Shot 2022-02-15 at 11.41.35.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/7/5706e69483acd30561aa5111517faf98e4bf7f21.png)

 ![Screen Shot 2022-02-15 at 11.41.10.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/7/1/71981c75cf67d9919362a3455638c916857e30b3.jpeg)

---

<div class="post-metadata">

**Author:** ![fjvalles](https://avatars.discourse-cdn.com/v4/letter/f/a3d4f5/32.png) [@fjvalles](https://community.hubspot.com/u/fjvalles)\
**Post date:** [February 15, 2022, 4:56pm UTC](https://community.hubspot.com/t/custom-contact-properties-not-returned-by-api/51560/2 "2022-02-15T16:56:27Z")

</div>

I solved it by specifying the **params\_encoding** option to **:multi** like this:

```lia-code-sample
def api_client
 config = ::Hubspot::Crm::Contacts::Configuration.new do |config|
 config.api_key['hapikey'] = "my_api_key"
 config.params_encoding = :multi
 end
 ::Hubspot::Crm::Contacts::ApiClient.new(config)
end

Hubspot::Crm::Contacts::BasicApi.new(api_client).get_by_id(...)

```

---

<div class="post-metadata">

**Author:** ![stephen1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stephen1/32/61905_2.png) [@stephen1](https://community.hubspot.com/u/stephen1)\
**Post date:** [May 10, 2022, 9:59am UTC](https://community.hubspot.com/t/custom-contact-properties-not-returned-by-api/51560/3 "2022-05-10T09:59:21Z")

</div>

Many thanks, pity the copy and paste did not work, wonder why this happened. I wonder if the code ever get tested on the HubSpot end ?
