145971
Goto Top

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?

Content-Key: 4325456203

Url: https://administrator.de/contentid/4325456203

Printed on: June 2, 2024 at 06:06 o'clock

Member: Epixc0re
Solution Epixc0re Oct 18, 2022 at 14:49:26 (UTC)
Goto Top
Servus,

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


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