We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Dec 3, 2021 2:45 AM - edited Dec 3, 2021 2:56 AM
Hi all,
I'd like to fetch some properties from a Company object through the Ruby gem.
When I execute the piece of code in your documentation page, it works well: the desired attributes are present. But when I copy paste in my terminal, the properties hash is missing.
Same code input:
Hubspot::Crm::Companies::BasicApi.new.get_by_id("myObjectId", properties: ["app__custom_attribute"], archived: false, auth_names: "hapikey")
Through Hubspot doc page:
{
"id": "myObjectId",
"properties": {
"app__custom_attribute": "Hello World",
"createdate": "2021-02-02T15:00:00.000Z",
"hs_lastmodifieddate": "2021-12-03T07:00:00.000Z",
"hs_object_id": "myObjectId"
},
"createdAt": "2021-02-02T15:00:00.000Z",
"updatedAt": "2021-12-03T07:00:00.000Z",
"archived": false
}
Through terminal
{
"createdate"=>"2021-02-02T15:00:00.000Z",
"domain"=>"fake-domain.com",
"hs_lastmodifieddate"=>"2021-12-03T07:00:00.000Z",
"hs_object_id"=>"myObjectId",
"name"=>"App Object Name"
}
The performed request logged is:
ETHON: performed EASY effective_url=https://api.hubapi.com/crm/v3/objects/companies/myObjectId?properties%5B0%5D=app__custom_attribute&archived=false&hapikey=myApiKey
The wrong part here is the %5B0%5D in the performed URL, as it should not be an array but a list a comma-separated string. Indeed,
https://api.hubapi.com/crm/v3/objects/companies/myObjectId?properties=app__custom_attribute,app__another_property&archived=false&hapikey= myApiKey
works well in the browser.
=> I think you have to fix the Ruby client on this side.
Dec 3, 2021 4:16 PM
May be worth adding an issue here
@altjx , @GaryElliott are fellow Ruby developers and may also have some insights
![]() | Make sure to subscribe to our YouTube channel where you can find the HubSpot Community Developer Show |