145971

Nextcloud talk - API

Hi,

ich habe mir soeben eine Test-Instanz von Nextloud installiert, inkl. Nextcloud Talk.
Nun möchte ich via PHP und der verfügbaren API die Situation realisieren, dass ein Besucher eine Webmaske aufruft und darüber (erst mal) nur einen Unterhaltung starten kann, in der nur ich involviert bin.

Doku: https://nextcloud-talk.readthedocs.io/en/latest/conversation/#creating-a ...

Habe nun folgendes PHP Script:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://meineNextcloudDomain.de/ocs/v2.php/apps/spreed/api/v4/room");  
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
http_build_query( array(
	'roomType' 		=>		1,  
	'invite' 			=>		'admin',  
	'roomName' 		=>		'Mein Chat'  
));

$server_output = curl_exec($ch);
curl_close ($ch);
echo $server_output;

Also Antwort erhalte ich:

failure 997 Current user is not logged in


Der Current user soll ja auch nicht eingeloggt sein, sondern als Besucher (Gast) eine Unterhaltung starten können, ohne Login. Hat jemand eine Idee?
Auf Facebook teilen
Auf X (Twitter) teilen
Auf Reddit teilen
Auf Linkedin teilen

Content-ID: 4325456203

Url: https://administrator.de/forum/nextcloud-talk-api-4325456203.html

Ausgedruckt am: 12.05.2025 um 23:05 Uhr

Epixc0re
Lösung Epixc0re 18.10.2022 um 16:49:26 Uhr
Goto Top
Servus,

der „current User“ ist dein API User, und der muss sehrwohl „eingeloggt“ sein - wie sollen sonst API Calls authentifiziert werden?


LG
145971
145971 18.10.2022 um 16:50:30 Uhr
Goto Top
Das klingt logisch!
Wie logge ich den API User denn ein? Habe ich hier etwas überlesen?
Epixc0re
Epixc0re 18.10.2022 um 16:53:31 Uhr
Goto Top
z.B. so:
 'Authorization'= 'Basic ' + [convert]::ToBase64String( [Text.Encoding]::ASCII.GetBytes( $($user + ":" + $pass) ) )   
145971
145971 18.10.2022 um 16:56:01 Uhr
Goto Top
Zum Verständis:
Ich muss extra einen Nextcloud User anlegen, der als API User fungiert?
Epixc0re
Epixc0re 18.10.2022 um 16:56:29 Uhr
Goto Top
aqui
aqui 19.10.2022 um 09:06:47 Uhr
Goto Top
Oder als Alternative http://www.senfcall.de nutzen! face-wink
145971
145971 19.10.2022 um 09:45:47 Uhr
Goto Top
und wie Fern ist das eine alternative zu einem self hosted Live Chat? :D