APIs & Integrations

HighJump_Muvdat
Member

(405)- Method Not Allowed

Hey guys,

I’m trying to integrate NetSuite and HubSpot for Contact and Company and get this (405) error when trying to upload Company to HubSpot. Can you please look at the below API Request/Response? Thank you!

Error:
HTTP/1.1 405 Method Not Allowed
Access-Control-Allow-Credentials: false
Allow: HEAD,DELETE,GET,OPTIONS,PUT
Content-Length: 0
Date: Wed, 26 Oct 2016 15:09:51 GMT
Connection: close

My API Call:
POST https://api.hubapi.com/companies/v2/companies/271347468?hapikey=************************ HTTP/1.1
Content-Type: application/json
Host: api.hubapi.com
Content-Length: 852
Expect: 100-continue

{“properties”:[
{
“name”: “name”,
“value”: “test”
},
{
“name”: “address”,
“value”: “test”
},
{
“name”: “city”,
“value”: “test”
},
{
“name”: “state”,
“value”: “test”
},
{
“name”: “hubspot_owner_id”,
“value”: “17003150”
},
{
“name”: “zip”,
“value”: “30022”
},
{
“name”: “country”,
“value”: “United States”
},
{
“name”: “lead_record_status”,
“value”: “PROSPECT-Quote”
},
{
“name”: “original_business_unit”,
“value”: “test”
},
{
“name”: “email”,
“value”: “test”
},
{
“name”: “ns_stage”,
“value”: “Prospect”
},
{
“name”: “is_person”,
“value”: “Company”
}
]}

0 Upvotes
2 Replies 2
kfischmann1
Member

(405)- Method Not Allowed

Hi @HighJump_Muvdata,

Your call is attempting to POST to an explicit companyID, which isn’t possible; companyIds are generated by the HubSpot backend and returned within the response to the call. Currently you’re POSTing to the ‘Update a Company’ endpoint found here, which only allows the PUT HTTP method, not POST.

If you try your call again, POSTing to https://api.hubapi.com/companies/v2/companies?hapikey=************************, you should find that the call will be successful.

Let me know if you require further assistance.

0 Upvotes
HighJump_Muvdat
Member

(405)- Method Not Allowed

Thank you, that helped much!

I have another request not sending to Company, but to Contact. Can you please take a look at below?

POST https://api.hubapi.com/contacts/v1/contact/vid/1264653/profile?hapikey=*****************HTTP/1.1
Content-Type: application/json
Host: api.hubapi.com
Content-Length: 884
Expect: 100-continue

{“properties”:[
{
“property”: “email”,
“value”: "test@test.com"
},
{
“property”: “hubspot_owner_id”,
“value”: “000000”
},
{
“property”: “city”,
“value”: “Swanzey”
},
{
“property”: “zip”,
“value”: “03446”
},
{
“property”: “country”,
“value”: “United States”
},
{
“property”: “subsidiary”,
“value”: “Test, Inc.”
},
{
“property”: “ns_current_contact_id”,
“value”: “00000”
},
{
“property”: “ns_current_customer_id”,
“value”: “00000”
},
{
“property”: “ns_stage”,
“value”: “Customer”
},
{
“property”: “ns_type”,
“value”: “Contact”
},
{
“property”: “channel_tiers”,
“value”: “End User”
},
{
“property”: “lead_record_status”,
“value”: “CUSTOMER-Closed Won”
}
]}
HTTP/1.1 409 Conflict
Access-Control-Allow-Credentials: false
Content-Type: application/json; charset=UTF-8
Vary: Accept-Encoding
Vary: Accept-Encoding
Content-Length: 547
Date: Mon, 31 Oct 2016 21:55:26 GMT
Connection: close

{“status”:“error”,“message”:“A contact with the email ‘Optional[test@test.com]’ already exists.”,“correlationId”:“44bcee89-79dc-4a15-982e-59b0f7d6c715”,“identityProfile”:{“vid”:1202825,“identity”:[{“value”:“jacquelyn@frazierandsonfurniture.com”,“type”:“EMAIL”,“timestamp”:1476916078299},{“value”:“e57e10c2-c4b0-4a8a-90ed-983031212877”,“type”:“LEAD_GUID”,“timestamp”:1476916080788}],“linkedVid”:[],“isContact”:true,“savedAtTimestamp”:1476916080789},“error”:“CONTACT_EXISTS”,“requestId”:“c132480f-4bea-4e4d-a5f6-9c61edece24d”}

0 Upvotes