Hapikey not engaged: error

I’m trying to use the API to search contacts using this (where X is the search query and my API key, respectively):

https://api.hubapi.com/contacts/v1/search/query?q=XXXXX&property=email&hapikey=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

When I use this URL in a browser, it returns the result as expected. But run with “curl” in Terminal, I get this error:

{"status":"error","message":"Any of the listed authentication credentials are missing","correlationId":"XXXXXXXX","engagement":{"shhkey-v1":"shhkey-v1 not engaged. Shhkey not found in the request header.","oauth-token":"oauth-token not engaged. OAuth access token not found in request header.","hapikey":"hapikey not engaged. hapikey is not present in query params.","vendorkey-gae":"vendorkey-gae not engaged. Vendorkey not found in request headers.","internal-cookie":"internal-cookie not engaged. Cookie not found in the request.","app-cookie":"app-cookie not engaged. App cookie is not present on the request."},"requestId":"XXXXXXX"}

Note that I’ve obscured the ‘correlationId’ and ‘requestID’ in case they’re exposing anything sensitive.

Any thoughts on how to resolve this? Searching reveals other people who’ve had similar issues but I can’t find a solution.

Hi @brijazz

I’ve gone ahead and tested this from my end now using Postman and have been unable to replicate this error when using my API key as the authentication method.

See here:

https://api.hubapi.com/contacts/v1/search/query?q=willson&property=email&hapikey={{hapikey}}

Could you provide more detail on how you’re making this request from your side and potentially test this in a different environment to what you’re currently using?

I’m simply using Terminal on MacOS and using

curl https://api.hubapi.com/contacts/v1/search/query?q={{lastname}}&hapikey={{my_key}}

Subsequently, I received a private message from @eruscitto and per their suggestion tried out my query using v3 of the API and that worked.

Hi @brijazz

Thanks for the update and glad to hear the solution from @eruscitto was able to solve this issue for you.

I’ll go ahead and mark the use of the new v3 endpoint as the solution to this thread for others.