problem when i try creating list with HubSpot API from my c# code.

My question is…what happened when my code generates this message Not Authorize when I use a HubSpot API for a create a list from my C# code?

he message text is follow…excuse me my writing i’m live in the caribbeanzone and my english is not very well.. but i’m try explain you whats is my problem with this code..

that is the text message from response…{StatusCode: 401, ReasonPhrase: ‘Unauthorized’, Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{Method: GET, RequestUri: ‘https://api.hubapi.com/crm/v3/objects/contacts?hapikey=pat-na1-0f037a0e-70b8-4415-82cc-1cd1597ed17f&lastmodifieddate=3/12/2024 12:00:00 AM’, Version: 1.1, Content: <null>, Headers:
{
}}

If you help me with thas, i’m aprrecited…i’m need integrate hubspot las modified records with my applications and create a c# program with the follow code. For verify and let me know whats i need do for resolve my situations..

i’m aprreciate you help me.

i hope for y

A very basic question or two here:

- Did you set up the header of the request with the right api key token? From the included code it sort of looks like you are trying to use the old style API ley authentication in the URL.

- Have you looked at the necessary scopes for that API key that you will need for the desired action. The titke of the post says lists, but the code fragment looks like a contact related call.

Hope this is helpful

Steve