GithubHelp home page GithubHelp logo

php-openfire-restapi's Issues

Issue in printing the requests and connecting to openfire.

I tried connecting this way:
`<?php

include "vendor/autoload.php";

$api = new \Gnello\OpenFireRestAPI\API();

//Set the required config parameters
$api->Settings()->setSecret("YWRtaW46YWRtaW4");
$api->Settings()->setHost("localhost.localdomain ");
$api->Settings()->setServerName(" localhost.localdomain ");

//Default values
$api->Settings()->setPort("9090");
$api->Settings()->setSSL(false);
$api->Settings()->setPlugin("/plugins/restapi");

$api->Settings()->setDebug(true);
$requests = \Gnello\OpenFireRestAPI\Debug\Request::getRequests();

var_dump($requests);

`

When I var_dump requests it shows empty,

Chat room related APIs not working.

$payload = new \Gnello\OpenFireRestAPI\Payload\ChatRoom();

$payload->setRoomName('myfirstchatroom');
$payload->setNaturalName('my_first_chat_room');
$payload->setDescription('This is my first chat room!');
$payload->setAdmins(array('admin'));
$payload->setOutcastGroups(array('outcast1','outcast2'));
$payload->setCanAnyoneDiscoverJID(false);
$payload->setCanOccupantsChangeSubject(false);
$payload->setPassword('12345');

$result = $api->ChatRooms()->createChatRoom(payload);

I found error:
Fatal error: Class 'Gnello\OpenFireRestAPI\Payload\ChatRoom' not found in /opt/lampp/htdocs/openfire/application/controllers/api/V1.php on line 40

i found chatroompayload.php file in payload but it has also a big error
Message: Undefined offset: 0

Filename: Payloads/AbstractPayload.php

Line Number: 28

I don't know what is the error.
Please find and fix the error.

Retrieving not existing chat rooms returns response == 1

$response = $api->ChatRooms()->retrieveChatRoom('room_' . $e->data->id);

In case the room does not exist it returns an object with default values, but roomName, naturalName and description are 'room_78' for example.
So to check the room exists I have to use workaround:
if ($response['response'] == 1 && $response['output']->roomName !== $response['output']->naturalName) {

Failed to install through Composer in Laravel

I am trying to add in laravel 8 project and got this error.

Problem 1 - Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.1.1]. - Can only install one of: guzzlehttp/guzzle[7.1.1, 6.5.x-dev]. - Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.1.1]. - gnello/php-openfire-restapi 3.0.0 requires guzzlehttp/guzzle ^6.2 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev]. - Installation request for gnello/php-openfire-restapi ^3.0 -> satisfiable by gnello/php-openfire-restapi[3.0.0]. - Installation request for guzzlehttp/guzzle (locked at 7.1.1, required as ^7.0.1) -> satisfiable by guzzlehttp/guzzle[7.1.1].

Screenshot 2020-10-07 at 1 23 33 PM

Not able to create room

Hi,
I am not able to create the room and even I'm not able to add user in the openfire through the script
below I have added the response.

getRequest -- [{"url":"http://144.217.253.67:9009/plugins/restapi/v1/chatrooms?servicename=conference","headers":["Accept: application/json","Authorization: basic YWRtaW46aW50ZWxueHQyMDE3IQ==","Content-Type: application/json"],"method":"POST","postData":"{"roomName":"intellinects","naturalName":"12334545","description":"This is my first chat room!","persistent":true,"canAnyoneDiscoverJID":false,"canOccupantsChangeSubject":false,"broadcastPresenceRoles":{"broadcastPresenceRole":["moderator","participant","visitor"]},"admins":{"admin":["admin"]}}","response":false,"server_output":""}]

getCurlInfo -- {"url":"http://144.217.253.67:9009/plugins/restapi/v1/chatrooms?servicename=conference","content_type":null,"http_code":302,"header_size":325,"request_size":522,"filetime":-1,"ssl_verify_result":0,"redirect_count":0,"total_time":0.594,"namelookup_time":0,"connect_time":0.25,"pretransfer_time":0.25,"size_upload":295,"size_download":0,"speed_download":0,"speed_upload":496,"download_content_length":0,"upload_content_length":295,"starttransfer_time":0.594,"redirect_time":0,"redirect_url":"http://144.217.253.67:9009/login.jsp?url=%2Fplugins%2Frestapi%2Fv1%2Fchatrooms%3Fservicename%3Dconference","primary_ip":"144.217.253.67","certinfo":[],"primary_port":9009,"local_ip":"192.168.0.103","local_port":54040}

please help me.
Thanks!

Room not save into database

I have use following code for create chat room

$payload = $api->Payloads()->createChatRoomPayload();
$payload->setRoomName('test_1');
$payload->setNaturalName('est_1');
$payload->setDescription('This is my first chat room!');
$result = $api->ChatRooms()->createChatRoom($payload);

after get success message if I have check in admin console then it's show
but when I check it in my MYSQL database it's not added

after restart openfire server it's deleted

would you please guide me what I need to do?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.