I’m trying to use api form (https://developers.hubspot.com/docs/methods/forms/submit_form_v3) on my site , but I get this error, HTTP ERROR 405
Problem accessing / submissions / v3 / integration / submit / XXX / xxxxxx. Reason: Method Not Allowed
var request = $.ajax({
url: "https://api.hsforms.com/submissions/v3/integration/submit/MyPportalid/FormId",
method: "POST",
data: {
"fields": [
{
"name": "firstname",
"value": firstname
},
{
"name": "lastname",
"value": lastname
},
{
"name": "email",
"value": email
},
{
"name": "phone",
"value": phone
},
{
"name": "company",
"value": company
},
{
"name": "dataMessage",
"value": dataMessage
}
],
"context": {
"hutk": ":"+hubspotutk,
"pageUri": pageUrl,
"pageName": pageName
} ,
"legalConsentOptions": {
"consent": {
"consentToProcess": true,
"text": "I agree to allow Example Company to store and process my personal data.",
"communications": [
{
"value": true,
"subscriptionTypeId": 999,
"text": "I agree to receive marketing communications from Example Company."
}
]
}
}
},
dataType: "json"
});
request.done(function(msg) {
console.log( "success "+msg );
})
.fail(function(msg) {
console.log( "error "+msg );
})
.always(function(msg) {
console.log( "complete "+msg );
});
The method is in POST, why i get that message ?