Has anyone faced this type of error while fetching the record. the data is getting in post man i am getting the data

VM56:1 Uncaught SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse ()
at XMLHttpRequest.xmlhttp.onreadystatechange (app.js:42)
xmlhttp.onreadystatechange @ app.js:42
XMLHttpRequest.send (async)
search @ app.js:46
invokeWithErrorHandling @ vue.js:1863
invoker @ vue.js:2188
original._wrapper @ vue.js:7547

It would help to know:

  • What data you’re sending - e.g. the http request and headers - minus your API key
  • What you actually receive - clearly the first character you get back is “<”.
  • I’m not quite sure from your title if you’re referring to using http POST, or Postman. The error you sent suggests the former but I’m not clear. The standard API uses http GET and not http POST so if I’ve understood correctly then you should ensure you’re using GET. However I suppose you could be using the filing API which probably does need POST (I don’t use that). Again if you put what you were doing that would help.

Obviously it’s unclear from the above, but if I recall correctly we did have an issue were we sent something (possibly incorrect) to Companies House and instead of receiving a JSON-formatted error in the http response body we received html data (e.g. the server was behaving like we’d made an incorrect web page request). I think that’s what you’re getting here. Best thing would be to check the body of the response. If you are still stuck, reply here and maybe someone will help you. The more clearly you can explain what you’re doing, what you expect and what is happening the better.