I’ve come back to the API every week or so for a little while now and tried to use the createRoom endpoint but I always get some 400-500 response status; I’m sending my apiKey, sourceSpace, and name as Content-Type: application/json
. Anyone else had a similar experience and how did you manage to get a 200?
I had a similar issue with createRoom. I noticed the encoding for the payload (the data being sent) is called out as JSON instead of url, at which part I just jumped over to Postman and used it to generate the rooms.
Sort term fix, especially if it was to be a bigger part of a project.
Hello,
Sorry it’s taken us a bit to get back to you here.
createRoom is a POST endpoint, so you will encode the body as JSON. There are a ton of libraries that make this easy- axios
comes to mind as a popular one, request
being another.
If you’re still having trouble, could you post the full URL you’re trying and your POST body, censoring any API keys or private information?
Thanks!
Just checking back on this. I have tried postman/insomnia/etc (currently using emacs restclient) but I will give that another shot and see if there’s any diff and report back.
Let me know if that works- it’d be helpful to have the full URL though to see if there’s something easy I can point out to fix- for example, I often forget to add the /v2/ in the endpoint base which can break it
evelyn
Coming back to this, it’s been a while. I am poking at the API with Postman and I can get JSON back from this call (just to verify at least my apiKey works and whatnot):
And here’s my POST (which returns a 404):
Here’s a jsfiddle I made to use axios:
(This unfortunately is giving me a CORS error about the “Access-Control-Allow-Origin” header).
Hope this all helps
Another update on this. I removed the sourceSpace
and it worked. Poking around some more to see why that is.
I think it is the / in your space url. Classically, the Gather API only accepts \ in its place. Try the Postman call with the change and see if it works.
Edit: Just tried Postman again with the createSpace api call, and can confirm that “//” in the place of “” in the sourceSpace
works.
@Bill_Uncork-It yep, confirmed - double backwhack does the trick. OK! That’s great. Thanks for the help everyone!