Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Create/Update contact returning 301 - undefined #301

Open
shanwixcode opened this issue Apr 22, 2021 · 3 comments
Open

Create/Update contact returning 301 - undefined #301

shanwixcode opened this issue Apr 22, 2021 · 3 comments

Comments

@shanwixcode
Copy link

shanwixcode commented Apr 22, 2021

hubspot.contacts.createOrUpdate is returning a "301 - undefined" response and no contact is being created or updated.

It was working fine for over a year.

@mikebertiean
Copy link

Any updates on this? Currently working on the same issue.

@shanwixcode
Copy link
Author

This is not solved. Move to @hubspot/api-client npm

const Hubspot = require('@hubspot/api-client');

const hubspot = new Hubspot.Client({
	apiKey: 'YOU_API_KEY',
});

hubspot.crm.contacts.basicApi.create(contactObj);

@x22n
Copy link

x22n commented Oct 14, 2021

By default this package uses a baseUrl without https and it has been deprecated by HubSpot.
To make it work, you can just overwrite it this way:

const hubSpot = new Hubspot({ apiKey: 'YOUR_API_KEY', baseUrl: 'https://api.hubapi.com' });

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants