Marketing Integrations

APGEconsultant
Membro

Create/Update a Contact record using API not working

resolver

trying to figure out what I am doing wrong... any help would be appreciated!!

var eMail = "moe@stooges.com";

var fName = "Moe";

var lName = "Howard";

var hKey = "aoijfarfrsgrsgalsdjfop312u526134w5u13"; // junk

var hubspotURL = "https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/" + eMail + "/?hapikey=" + hKey;

var subj = {
"properties": [
   {"property": "email", "value": eMail},
   {"property": "firstname", "value": fName},
   {"property": "lastname", "value": lName}
]};
var myJSON = JSON.stringify(subj);
var xhttp = new XMLHttpRequest();

xhttp.onreadystatechange = function()
{
   alert(this.readyState + " : " + this.status + " : " + this.statusText); // debugging
   if (this.readyState == 4 && this.status != 200)
   {
      alert("Failure Response Text: " + this.responseText); // debugging
   }
   if (this.readyState == 4 && this.status == 200)
   {
      alert("Success Response Text: " + this.responseText); .. debugging
   }
};

xhttp.open("POST", hubspotURL, true);
xhttp.setRequestHeader("Content-Type", "application/json"); 
xhttp.send(myJSON);

0 Avaliação positiva
1 Solução aceita
roisinkirby
Solução
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

Create/Update a Contact record using API not working

resolver

Hey @APGEconsultant I'd advise also posting this question here on HubSpot's API forum where our community of HubSpot developers and integration partners can help you out 🙂

Exibir solução no post original

0 Avaliação positiva
2 Respostas 2
roisinkirby
Solução
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

Create/Update a Contact record using API not working

resolver

Hey @APGEconsultant I'd advise also posting this question here on HubSpot's API forum where our community of HubSpot developers and integration partners can help you out 🙂

0 Avaliação positiva
crm
Membro

Create/Update a Contact record using API not working

resolver

Hello Team,

 

Greetings!

 

I am using API https://developers.hubspot.com/docs/methods/contacts/create_or_update

I am getting following response:-

405 Method Not Allowed

 

Can you please help me to resolve this issue?

 

Thanks & Regars,

Ajay

 

 

0 Avaliação positiva