Contact API errors


#1

I’m new at this but I searched through all the messages and didn’t find any answers.

I’m trying to retrieve a contact using Javascript.

When I try by the ID I get “SyntaxError: Unexpected token :” and “2app.hubspot.com/login-verify?early=true Failed to load resource: the server responded with a status of 401 (Unauthorized)
head.js:1 You should not redefine a module with hubspot.define, ‘hubspot.portal.settings’ has already been defined once.
hubspot.defineHelper @ head.js:1”

This call looks like this:
https://api.hubapi.com/contacts/v1/contact/vid/#####/profile?hapikey=################################&property=firstname?callback=?

(there are two messages because the site wouldn’t let me post both questions!)