Marketing Integrations

APGEconsultant
Mitglied

Create/Update a Contact record using API not working

lösung

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 Upvotes
1 Akzeptierte Lösung
roisinkirby
Lösung
HubSpot-Produktteam
HubSpot-Produktteam

Create/Update a Contact record using API not working

lösung

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 🙂

Lösung in ursprünglichem Beitrag anzeigen

0 Upvotes
2 Antworten
roisinkirby
Lösung
HubSpot-Produktteam
HubSpot-Produktteam

Create/Update a Contact record using API not working

lösung

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 Upvotes
crm
Mitglied

Create/Update a Contact record using API not working

lösung

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 Upvotes