# Get Tickets - Authentication Error

**URL:** <https://community.hubspot.com/t/get-tickets-authentication-error/76149>\
**Category:** APIs & Integrations\
**Tags:** python, oauth, professional\
**Created:** [February 28, 2023, 2:01pm UTC](https://community.hubspot.com/t/get-tickets-authentication-error/76149 "2023-02-28T14:01:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zmcCarty5456](https://avatars.discourse-cdn.com/v4/letter/z/439d5e/32.png) [@zmcCarty5456](https://community.hubspot.com/u/zmcCarty5456)\
**Post date:** [February 28, 2023, 2:01pm UTC](https://community.hubspot.com/t/get-tickets-authentication-error/76149/1 "2023-02-28T14:01:31Z")

</div>

Hello there, I’m running an api call on tickets using my private app api key that has tickets added to the scope. The hubspot dash is showing that the call is successful however the response is giving an authentication error  
Here is my api call

```lia-code-sample
import requests
import json

url = 'https://api.hubapi.com/crm/v3/objects/tickets?limit=100&archived=false'
headers ={}
headers['authorization'] = 'Bearer [private app token]'

r = requests.get(url)
results = r.json()

```

Attached is the screenshot showing the successful logs

 ![Screen Shot 2023-02-26 at 2.50.07 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/6/c/6cd1135db3942a37e71d10d67dd1f0ee85c1e9c6.png)

Here is the error I’m getting

`{'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': '50c4299e-412a-4152-b3a4-77546f85f33d', 'category': 'INVALID_AUTHENTICATION'}`

Very confused on how to approach this because I feel like everything I’m doing is correct per the docs.

---

<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 28, 2023, 9:21pm UTC](https://community.hubspot.com/t/get-tickets-authentication-error/76149/2 "2023-02-28T21:21:14Z")

</div>

Hey, @zmcCarty5456 👋 Thanks for reaching out. Quick questions:

- Is this happening when you use the Python example from this page? — [CRM API | Tickets](https://developers.hubspot.com/docs/api/crm/tickets)
- I ran a quick test using that example with a Private App that has _only_ the Tickets scope

 ![CleanShot 2023-02-28 at 14.19.01.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/b/7/b7c867b4202667921e74837b75a29233beb21cb2.png)

- It returned both the 200 Response and the expected response body

 ![CleanShot 2023-02-28 at 14.18.43.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/6/b/6b68f300736a12e31c39272fd8bc0ff02086e371.png)

- I’m curious if we can look for something simple regarding the differences

Thanks for adding any additional details. We have several community members who help with all things Python-related that I am happy to tag as well.

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![zmcCarty5456](https://avatars.discourse-cdn.com/v4/letter/z/439d5e/32.png) [@zmcCarty5456](https://community.hubspot.com/u/zmcCarty5456)\
**Post date:** [March 1, 2023, 9:39pm UTC](https://community.hubspot.com/t/get-tickets-authentication-error/76149/3 "2023-03-01T21:39:05Z")

</div>

Hey [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074) I see that you are using the Hubspot library in yoru request. I will give this a try later today and get back to you.
