Updating table row with hubdb api is showing xml parsing error
Hi Leif,
I tried with the javascript code that you gave. There is small error in your code. quote is missing in the end of line number 10(xhr.open).
After closing the quote it is still not working and when I alert the xhr.status and xhr.readystate it returs xhr.readystate 4 and xhr.ready status 405 and 405 means method not allowed.
The HyperText Transfer Protocol (HTTP) 405 Method Not Allowed response status code indicates that the request method is known by the server but is not supported by the target resource.
and then it gave same error in the console. If I change the post method to put according to the hubspot
Updating table row with hubdb api is showing xml parsing error
Hi Herry!
My apologies for the error, I must have accidentally removed that last quote when editing out my hAPIkey.
I've confirmed with colleagues-- that API endpoint definitely doesn't work with ajax/cors requests as it would result in exposing your hapikey. You will need to use some server side scripting if you intend to update HUBDB tables that way.
Updating table row with hubdb api is showing xml parsing error
Hi Leif,
Cors error is with the put request and while using post request it is returning the same xml parsing error. How can this be sorted? status is returning 405 instead of 200. 405 is showing method not allowed and I am using this method on the hubspot page itself. It is not outside of hubspot that gives cors error. And cors error is also stating that method not found.
Please verify if this issue is from hubspot's end.
I am not familiar with the jquery methods for using AJAX but in general I would try to defer to vanilla Javascript when possible. My assumption is that the object you were passing to the table wasn't being processed properly. Give the above a try.