# Docs are misaligned with actual gem

**URL:** <https://community.hubspot.com/t/docs-are-misaligned-with-actual-gem/69749>\
**Category:** APIs & Integrations\
**Tags:** object, contacts\
**Created:** [November 22, 2022, 1:22pm UTC](https://community.hubspot.com/t/docs-are-misaligned-with-actual-gem/69749 "2022-11-22T13:22:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SSalvucci](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@SSalvucci](https://community.hubspot.com/u/SSalvucci)\
**Post date:** [November 22, 2022, 1:22pm UTC](https://community.hubspot.com/t/docs-are-misaligned-with-actual-gem/69749/1 "2022-11-22T13:22:56Z")

</div>

I’ve spent a couple of hours debugging my code,

- pasted the following from your docs (ruby wrapper) -

```lia-code-sample
require 'hubspot-api-client'

api_client = Hubspot::Client.new(access_token: 'YOUR_ACCESS_TOKEN')

body = {inputs: [{"id":"37295"}]}
api_response = api_client.crm.associations.batch_api.read(from_object_type: "fromObjectType", to_object_type: "toObjectType", body: body)
puts api_response

```

i was getting an error saying that “body” was missing.

After precious time spent on your github repository,

- [https://github.com/HubSpot/hubspot-api-ruby/blob/master/lib/hubspot/codegen/crm/associations/api/batch\_api.rb](https://github.com/HubSpot/hubspot-api-ruby/blob/master/lib/hubspot/codegen/crm/associations/api/batch_api.rb)

I found out the issue

```lia-code-sample
ERROR:
client.crm.associations.batch_api.read(from_object_type: "deals", to_object_type: "contacts", body: body)

WORKS:
deals_to_contact = {inputs: [{"from":{"id": deal.id },"to":{"id": hubspot_contact.id},"type":"deal_to_contact"}]}
client.crm.associations.batch_api.create(from_object_type: "deals", to_object_type: "contacts", batch_input_public_association: body)

```

that was pretty annoying since we were forced to upgrade from deprecating hapikey.

The overall structure of the API has a learning curve incredibly “high”

I needed to:

- create, update, delete a contact (create\_or\_update no more appear to exist)

- create a deal associated to a contact (2 requests vs 1)

- create a task associated to a deal (2 requests vs 1)

Hope my feedback will help others

had to

---

<div class="post-metadata">

**Author:** ![SSalvucci](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@SSalvucci](https://community.hubspot.com/u/SSalvucci)\
**Post date:** [November 22, 2022, 1:24pm UTC](https://community.hubspot.com/t/docs-are-misaligned-with-actual-gem/69749/2 "2022-11-22T13:24:20Z")

</div>

```lia-code-sample
#removed useless code from above

ERROR:
client.crm.associations.batch_api.read(from_object_type: "deals", to_object_type: "contacts", body: body)

WORKS:
client.crm.associations.batch_api.create(from_object_type: "deals", to_object_type: "contacts", batch_input_public_association: body)

```
