# We are migrating our hubspot api implementation to access token from api key based implementation.

**URL:** <https://community.hubspot.com/t/we-are-migrating-our-hubspot-api-implementation-to-access-token-from-api-key-based-implementation/69090>\
**Category:** APIs & Integrations\
**Created:** [November 11, 2022, 12:05pm UTC](https://community.hubspot.com/t/we-are-migrating-our-hubspot-api-implementation-to-access-token-from-api-key-based-implementation/69090 "2022-11-11T12:05:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![07053](https://avatars.discourse-cdn.com/v4/letter/0/ccd318/32.png) [@07053](https://community.hubspot.com/u/07053)\
**Post date:** [November 11, 2022, 12:05pm UTC](https://community.hubspot.com/t/we-are-migrating-our-hubspot-api-implementation-to-access-token-from-api-key-based-implementation/69090/1 "2022-11-11T12:05:37Z")

</div>

We are migrating our hubspot api implementation to access token from api key based implementation.

But we are facing a few issues in the process of the migration.

1. We have migrated our create and update hubspot apis. However data of those fields are not getting saved which are having underscore in property unique identifier (e.g. foubding\_date, why\_us\_, vs\_\_\_date\_of\_most\_recent\_order).
2. Contact search api is not working returning error.

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [November 15, 2022, 12:25am UTC](https://community.hubspot.com/t/we-are-migrating-our-hubspot-api-implementation-to-access-token-from-api-key-based-implementation/69090/2 "2022-11-15T00:25:39Z")

</div>

Hey, @07053 👋 Thanks for reaching out. Can you provide any additional details, code snippets, or screenshots to help provide our community with additional information, please? For both questions 1 and 2 it is not clear:

- Q1 — what endpoint you are calling and having issues with?
- Q2 — can you provide an example request, response, and the full error body being received?

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![07053](https://avatars.discourse-cdn.com/v4/letter/0/ccd318/32.png) [@07053](https://community.hubspot.com/u/07053)\
**Post date:** [November 15, 2022, 5:38am UTC](https://community.hubspot.com/t/we-are-migrating-our-hubspot-api-implementation-to-access-token-from-api-key-based-implementation/69090/3 "2022-11-15T05:38:30Z")

</div>

Hi Jaycee  
Hope you are doing good!  
Q1:-  
Here is our sample code  
Input parameters (json) we are sending in body

`body = {\"inputs\":[{\"properties\":{\"email\":\"raj_test_email@ **bleep**.com\",\"firstname\":\"som\",\"lastname\":\"dutt\",\"date_of_birth\":\"1999-1-1\",\"address\":null,\"city\":null,\"state\":\"\",\"country\":\"US\",\"zip\":null,\"website\":null,\"company\":null,\"phone\":\"4556660006\",\"role\":\"Homeowner\",\"home_professional_type\":\"\",\"founding_year\":null,\"hours_of_operation\":null,\"about\":null,\"our_story\":null,\"why_us_\":null,\"vs ___date_of_most_recent_order\":null,\"vs___ total_orders_placed\":null,\"vs ___most_recent_order_spend\":0,\"vs___ total_order_spend\":0,\"vs ___plan\":\" \",\"vs___ plan_subscribe_date\":null,\"calculated_design_style\":null,\"calculated_service_type\":null}}]}`

We are using Ruby

```lia-code-sample
api_client = Hubspot::Client.new(access_token: ENV['HUBSPOT_API_KEY'])
properties = self.prepare_properties user
body = {inputs: [{properties: properties}]}
api_response = api_client.crm.contacts.basic_api.create(body: body)
return api_response

```

Response we are getting from hubspot

```lia-code-sample
api_response = ETHON: performed EASY effective_url=https://api.hubapi.com/crm/v3/objects/contacts response_code=201 return_code=ok total_time=1.474116
#<Hubspot::Crm::Contacts::SimplePublicObject:0x000055ef99a1dab8 @id="61051", @properties={"createdate"=>"2022-11-15T05:19:27.658Z", "hs_all_contact_vids"=>"61051", "hs_is_contact"=>"true", "hs_is_unworked"=>"true", "hs_lifecyclestage_lead_date"=>"2022-11-15T05:19:27.658Z", "hs_object_id"=>"61051", "hs_pipeline"=>"contacts-lifecycle-pipeline", "lastmodifieddate"=>"2022-11-15T05:19:27.658Z", "lifecyclestage"=>"lead"}, @created_at=Tue, 15 Nov 2022 05:19:27 +0000, @updated_at=Tue, 15 Nov 2022 05:19:27 +0000, @archived=false>

```

Here is screenshot of hubspot contact listing on dashbaord. It’s creating empty (Data we are passing are not getting saved on hubspot) records on hubspot.

 ![Screenshot from 2022-11-15 10-59-58.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/e/c/ec057962c5f075e115bc4e44c0a3e06ac0767499.png)

We are following this documentation

> **[Accounts Dashboard | HubSpot](https://app.hubspot.com/myaccounts?next=developerdocs&redirect=%2Fapi-reference%2Fcrm-contacts-v3%2Fguide)**
