Integrate Contact API

Hi All,
I want to integrate Hubspot Contact API in React app,
I’m using this method right now

 axios.get(
 'https://api.hubapi.com/crm/v3/objects/contacts',
 {
 headers: {
 Authorization: `Bearer ${YOUR_TOKEN}`,
 'Content-Type': 'application/json',
 },
 },
 (err, data) => {
 // Handle the API response
 },
 );

But this is giving me 401 ,
I tried with POST request as well but still got 401,
Basically I want to create contact through React app
Let me know if anyone can help
Regards
Abdul

Hey, @ARehman84 :waving_hand: It’s hard to say with certainty when dealing with 401 errors.

One common reason for these errors is related to authorization – bad token, missing scopes, etc. My suggestion to start from the simplest version of this and then work on your function in React.

Using your existing auth method, can you make a request using the on-page example – Contacts API? What about when using Postman?

Thanks for the additional details! — Jaycee