Call API Methods Problem


#1

Maybe this is a problem from Hubot. I am Using 0.71.1 of Rocketchat (dockerimage) and Hubot 2.19.0.
I am programming API function, the following Function is working, this simply displays the Verison Informations usw:

robot.respond(/api testfunction1$/i, function(res) {
robot.adapter.callMethod(‘getServerInfo’)
.then(function(result) {
console.log(result)
})
.catch(function(error) {
console.log(error)
})

Running this functions makes a Log entry i Rocketcaht like:
Meteor ➔ method getServerInfo -> …

Calling the following function returns a 404 Error “Method not found”:

robot.respond(/api testfunction2$/i, function(res) {
robot.adapter.callMethod(‘adminRooms’, ‘general’, [ ‘c’, ‘d’, ‘p’ ], 50)
.then(function(result) {
res.reply(“Success”)
console.log(result)
})
.catch(function(error) {
res.reply(“Error”)
console.log(error)
})
})

No LOG Method occures.

If i open “Administration” - “Rooms” in Rocketchat the following LOG Entry occures:

Meteor ➔ publish adminRooms ->

The difference to the first function is the “publish” instead of the “method” in the LOG Entry, how do i have to call the “adminRooms” Method/function in hubot to get a list of all Rooms?


#2

Tried it out with Hubot 3.1.1, same result.

Error in Hubot Log:

[Thu Nov 15 2018 07:30:08 GMT+0100 (CET)] ERROR [fullUserData] Error: { isClientSafe: true,
error: 404,
reason: ‘Method ‘fullUserData’ not found’,
message: ‘Method ‘fullUserData’ not found [404]’,
errorType: ‘Meteor.Error’ }
{ isClientSafe: true,
error: 404,
reason: ‘Method ‘fullUserData’ not found’,
message: ‘Method ‘fullUserData’ not found [404]’,
errorType: ‘Meteor.Error’ }
[Thu Nov 15 2018 07:30:08 GMT+0100 (CET)] INFO [sendMessage] Calling (async): [{“msg”:“Error”,“bot”:{“i”:“js.SDK”},“rid”:“7B7APsSMiPeocGLWAa3cHyNGiHiQaCgcHW”}]

Rocketchat has no Log information. I do not understand why “Hubot” returns 404 without a corresponding message in Rocketchat, should not Rocketchat log an error that the called message is not found? If i run other functions like “getServerInfo” with wrong Parameters i get a Rockerchat LOG Entry too.