CrmAssociations endpoint stopped working properly in September 2020

Good Day everyone,

I don’t know what happened in September but the following endpoint has stopped working properly :

https://github.com/HubSpot/hubspot-php/blob/master/src/Resources/CrmAssociations.php

Until now in the $line_item I could retrieve the properties like hs_product_id to get the name of the product but now nothing is showing up. Is there an update or something wrong with the API?

Here is a short snippet on how I was using the API to retrieve the product associated with a deal from my own task :


$line_items = $hubspot->CrmAssociations()->get( $task->associations->dealIds[ 0 ], 19 ); # OK

foreach ( $line_items->data->results as $item_result ) :

**$line\_item = $hubspot->LineItems()->getById( $item\_result ); # NG : EMPTY DATA PROPERTIES EVERY TIME**

$product = $hubspot->Products()->getById( $line_item->data->properties->hs_product_id->value, [ ‘properties’ => ‘name’ ] );

endforeach;

Thank you very much in advance for your help

Peter

Hi @ph_alti_trading !

I am discussing this with the team and will get back to you as soon as I have something for you

Thanks!

Hi @dennisedson
Thank you very much for your support. Hope this is something that will be fixed :crossed_fingers:
Keep in touch,
Dennis

Hi @dennisedson
The ticket was opened 3 weeks ago, any progress on a potential solution, please?

Hello @ph_alti_trading ,

Very sorry about the delayed response. I checked with the team and both the PHP library and the API endpoint are working as expected. Does your application throw any errors when running the request?

@prosa , @melumbs do you all have any thoughts on what may be going wrong here?

Hello the HubSpot crew, @dennisedson @prosa @melumbs
Actually I’ve just tested again it looks like the properties are required :
$line_items = $hubspot->CrmAssociations()->get( $task->associations->dealIds[ 0 ], 19 ); # OK

foreach ( $line_items->data->results as $item_result ) :

$line_item = $hubspot->LineItems()->getById( $item_result, [ ‘properties’ => ‘hs_product_id’ ] );

$product = $hubspot->Products()->getById( $line_item->data->properties->hs_product_id->value, [ ‘properties’ => ‘name’ ] );

endforeach;
I don’t have backups, I guess it was working properly without it, isn’t it?
If you didn’t make a change on the API, well during an update of the script on my side, I probably deleted it by mistake… :sob:
Thank you in advance for the confirmation :sign_of_the_horns: