Failed to Get Response from Nextcloud Talk Room from API

I’m trying to request the list of room and its parameters from my server’s Nextcloud Talk. I’ve read from [https://nextcloud-talk.readthedocs.io/en/latest/conversation/](Next Cloud Talk Conversation API Doc) and try it on my postman.

I was using /ocs/v2.php/apps/spreed/api/v4/room and the header is;

Accept:application/json
Content-Type:application/json;charset=utf-8

But as I tried, I got response like this

<?xml version="1.0"?> failure 404 Invalid query, please check the syntax. API specifications are here: http://www.freedesktop.org/wiki/Specifications/open-collaboration-services.

I don’t quite understand on why does the result is failure. Did I missed something here?

Thank you in advance.

In addition, here’s my screen capture from the postman app.

I have no experience with the API in question. However, I see that you are getting a 404 error. This seems rather not be a problem of the content encoding (be it on the way to or from the server) but a bad request URL or some bad/missing headers.
I see that the OCS-AppRequest header seems disabled. I am not 100% sure, but I think there is a requirement to set an appropriate header for the OCS request. Also are you sure, the login credentials are correctly transmitted and valid?

Did you check the functionality with curl?

Hi, thank you for your response.
First of all, about the OCS-AppRequest, I’ve tried enabled and disabled it yet it still returns with the same result.

And for the curl, me myself is not quite familiar with the curl notation but I’ve tried on curl. Feel free to correct me if I’m wrong.

curl -d -H “Content-Type: application/json” -H “Accept: application/json” -H “OCS-APIRequest: true” -u “username:password” https://<directory.url>/ocs/v2.php/apps/spreed/api/v4/room

yet it’s also gives me an error result.

I still got no idea how to use the API

I finally get the reason why does my request receiving the error 404
It’s because of the version that I used. Solved by using v1, not v4

/ocs/v2.php/apps/spreed/api/v1/room

1 Like

So you’re using a Version < 21 then? Not sure if you’re aware, but these are EOL. You should consider updating. Especially if you plan to implement something api wise, because v1 is removed in later versions…

1 Like

Ah I see… Noted, thank you for the notice.
And apparently 21 earlier version still using v1, because I’m currently using Nextcloud 21.0.1

That does not make a significant difference: Maintenance and Release Schedule · nextcloud/server Wiki · GitHub. Only NC 24 and later is not EOL.

1 Like

I see, apparently my version is so left behind. I thought 21.0.9 is the newest one, since that one is recommended by the NextCloud in the overview page but it’s actually already 24.
Thanks for the information!

Where did you find that information? That might be interesting if there is some outdated information floating in the net.

Do you mean the overview page in the admin settings? Could be that your php version is too old to show the upgrade to 22 and above

Edit: Looks like both need 7.3. So that’s not it then…

Sorry I wasn’t being clear before. It’s from the overview page in the admin settings.

Yes it’s from that settings page. Now I wonder why does it just recommend me on 21.0.9 as the pic below, not the 22 or even 24

The updater first goes to the latest patch version, then the next major.

3 Likes

Okay, noted. Thank you for your response.