Project

General

Profile

Send message directly to a user with the rest api call

Jun Huang
Added over 3 years ago

Is there a way to send a message using the rest api call. I tried using the stream script but received the following: The feature is not supported yet. Am I trying to do something not supported out-of-the-box or am I looking in the wrong place?

Thanks,

jun


Replies (4)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 3 years ago

Could you post example message you trying to send? I would like to check if message contains xmlns attribute set to jabber:client as missing xmlns might be cause of feature-not-implemented response.

Added by Jun Huang over 3 years ago

Hi Andrzej,

I have posted with the following information

url => http://localhost:8080/rest/stream/v_365@dev.test.com

xml => "test AA 5"

I get this error:

from=null, to=null, DATA=test AA 5, SIZE=96, XMLNS=null, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=null

2015-08-11 01:08:06.110 [pool-14-thread-1] CIDConnections.sendPacketsBack() WARNING: Packet: from=null, to=null, DATA=test AA 5The feature is not supported yet., SIZE=365, XMLNS=null, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=error processing exception: tigase.xmpp.PacketErrorTypeException: The packet has already 'error' type: from=null, to=null, DATA=test AA 5The feature is not supported yet., SIZE=365, XMLNS=null, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=error

Added by Jun Huang over 3 years ago

I tried adding the xmlns and got the same error

Sent:

test A 7

Log:

from=null, to=null, DATA=test A 7, SIZE=118, XMLNS=jabber:client\, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=null

2015-08-11 09:11:31.393 [pool-14-thread-2] CIDConnections.sendPacketsBack() WARNING: Packet: from=null, to=null, DATA=test A 7The feature is not supported yet., SIZE=364, XMLNS=jabber:client\, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=error processing exception: tigase.xmpp.PacketErrorTypeException: The packet has already 'error' type: from=null, to=null, DATA=test A 7The feature is not supported yet., SIZE=364, XMLNS=jabber:client\, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=error

Added by Jun Huang over 3 years ago

For anyone who encounters the same issue, we resolved it by including the content-type into the post. For example, if using curl, you would call with something like

-H "Content-Type: application/xml"

    (1-4/4)