# Authentication credentials not found. This API supports both API Key and OAuth 2.0 authentication

**URL:** <https://community.hubspot.com/t/authentication-credentials-not-found-this-api-supports-both-api-key-and-oauth-2-0-authentication/74163>\
**Category:** APIs & Integrations\
**Created:** [January 31, 2023, 5:38pm UTC](https://community.hubspot.com/t/authentication-credentials-not-found-this-api-supports-both-api-key-and-oauth-2-0-authentication/74163 "2023-01-31T17:38:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NRaju7](https://avatars.discourse-cdn.com/v4/letter/n/bbe5ce/32.png) [@NRaju7](https://community.hubspot.com/u/NRaju7)\
**Post date:** [January 31, 2023, 5:38pm UTC](https://community.hubspot.com/t/authentication-credentials-not-found-this-api-supports-both-api-key-and-oauth-2-0-authentication/74163/1 "2023-01-31T17:38:41Z")

</div>

Hello Team,

We are facing issue while calling webhooks API from rails application. Here are the details:

**api\_client = Hubspot::Client.new(access\_token: ‘pat-na1-XXXX-XXXX-XXXXX’)**

**api\_response = api\_client.webhooks.settings.settings\_api.get\_all(app\_id: 1400662)**

**response is NoMethodError (undefined method `settings’ for #Hubspot::Discovery::Webhooks::Client:0x00005598bd71bb68)**

After that we removed settings and here it is :

**api\_response = api\_client.webhooks.settings\_api.get\_all(app\_id: XXX2)**

the Response is here:

**Hubspot::Webhooks::ApiError (Error message: the server returns an error)**  
**HTTP status code: 401**  
**Response headers: {“date”=\>“Tue, 31 Jan 2023 17:29:09 GMT”, “content-type”=\>“application/json;charset=utf-8”, “content-length”=\>“316”, “cf-ray”=\>“79242af73c0d8489-BOM”, “strict-transport-security”=\>“max-age=31536000; includeSubDomains; preload”, “vary”=\>“origin”, “cf-cache-status”=\>“DYNAMIC”, “access-control-allow-credentials”=\>“false”, “x-hubspot-auth-failure”=\>“401 Unauthorized”, “x-hubspot-correlation-id”=\>“1baddca4-8de8-4414-b459-ccf85de75240”, “report-to”=\>“{\“endpoints\”:[{\“url\”:\“https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=o1N9PWj1MISpBqLdVPjfyP8yBTgrESA1EuuylMtTCHO7f4HC9%2BP2mTkBMlf4XxUCC40VlC95B3Qi5aqxKVFo%2FPu0GMkQuJS35%2BdefMAdImDifRoUkZLt5PQndBjRIuA8\”}],\“group\”:\“cf-nel\”,\“max\_age\”:604800}”, “nel”=\>“{\“success\_fraction\”:0.01,\“report\_to\”:\“cf-nel\”,\“max\_age\”:604800}”, “server”=\>“cloudflare”, “alt-svc”=\>“h3=\”:443\“; ma=86400, h3-29=\”:443\“; ma=86400”}**  
**Response body: {“status”:“error”,“message”:"Authentication credentials not found. This API supports both API Key and OAuth 2.0 authentication and you can find more details at [https://developers.hubspot.com/docs/methods/auth/oauth-overview",“correlationId”:“1baddca4-8de8-4414-b459-ccf85de75240”,“category”:“INVALID\_AUTHENTICATION”}](https://developers.hubspot.com/docs/methods/auth/oauth-overview%22,%22correlationId%22:%221baddca4-8de8-4414-b459-ccf85de75240%22,%22category%22:%22INVALID_AUTHENTICATION%22%7D)**

Please help us and provide the solution how we have to overcome this issue to move further.

E-mail: [nraju@carterandclark.com](mailto:nraju@carterandclark.com)

Thanks

Raju M

---

<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:** [February 1, 2023, 9:18pm UTC](https://community.hubspot.com/t/authentication-credentials-not-found-this-api-supports-both-api-key-and-oauth-2-0-authentication/74163/2 "2023-02-01T21:18:43Z")

</div>

Hey, @NRaju7 👋 For issues with the Ruby example apps, I suggest you post them in the repo directly – [Issues](https://github.com/HubSpot/sample-apps-webhooks/issues). This is because the developers who support this repo do not post in this community typically.

Best,

Jaycee
