HubSpot Goals API - How to retrieve data?

I am trying to retrieve different objects via the HubSpot API in Python. So far, I have retrieved all objects except Goals.

I am unsure why, but I keep getting an Authentication error despite having the right key and CRM.Objects.Goals.Read as a scope in the Private App. I am using exactly the same code as detailed here:
Goals - API - Basic - List

From what I can see in the documentation, Goals differs in the sense that OAuth/Private App Auth is somehow not supported?

Do I have to change something so I can retrieve all goals and some properties related to them?

Hey, @FedericoG I tested with a Private App and Postman, and received a successful response. I think the issue is with the dev docs. They all seem to be (temporarily) missing the auth parameters. I’ll report it to the dev docs team and update here as soon as I get notified that it’s back to its expected state.

Best,

Jaycee

Hey Jaycee!
I tried retrieving the endpoint and also got a positive response. But every time I try to do the same with the HubSpot API library, I get a 401 non-authorized error. If the problem was only the dev docs, then my request should work, right? Or would sorting the dev docs help with the Python library as well?
I’m not super familiar with API’s and Endpoints, so I’m just asking from a point of total ingenuity here :slightly_smiling_face:

I forgot to include the code snippet. What I meant to say is that I’m not using an URL and “headers” parameter, but instead using this:

api_response = client.crm.objects.goals.basic_api.get_page(limit, properties, etc)

Where client is

client = hubspot.Client.create(api_key=“MY-API-KEY”)

I did not get any errors doing that with any other object, except Goals.

Thanks for that. I’ll update that in my internal request. No matter what, it shouldn’t be asking for `api_key="MY-API-KEY`. — Jaycee

Hi again, Jaycee!

I’ve been able to sort it out by not using the HubSpot Python library and just calling an URL endpoint with the API. Thank you for the help anyway.