APIs & Integrations

GWrobel
Mitglied

Read a Company with extended Properties does not work with Ruby gem

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.

 

0 Upvotes
1 Antwort
dennisedson
HubSpot-Produktteam
HubSpot-Produktteam

Read a Company with extended Properties does not work with Ruby gem

@GWrobel 

May be worth adding an issue here

@altjx , @GaryElliott  are fellow Ruby developers and may also have some insights

0 Upvotes