0
votes

Can anyone please help with rest api of ejabberd's set preference

following is the request body

{
      "user": "venkat",
      "host": "localhost",
      "resource": "tka1",
      "type": "available",
      "show": "away",
      "status": "",
      "priority": "0"
}

when I am trying to hit api i am getting response as "internal_error".

IN logs, I could see below statement

REST API Error: set_presence([{<<"user">>,<<"venkat">>}, {<<"host">>,<<"localhost">>}, {<<"resource">>,<<"tka1">>}, {<<"type">>,<<"available">>}, {<<"show">>,<<"away">>}, {<<"status">>,<<>>},{<<"priority">>,<<"0">>}])

-> exit:{noproc,{p1_server,call,[none, {set_presence,{presence,<<>>,available,<<>>, {jid,<<"venkat">>,<<"localhost">>,<<"tka1">>,<<"venkat">>,<<"localhost">>,<<"tka1">>}, {jid,<<"venkat">>,<<"localhost">>,<<>>,<<"venkat">>,<<"localhost">>,<<>>},away,[],0,[],#{}}},1000]}}

[{p1_server,call,3,[{file,"src/p1_server.erl"},{line,210}]},{mod_http_api,handle2,4,[{file,"src/mod_http_api.erl"},{line,268}]},{mod_http_api,handle,4,[{file,"src/mod_http_api.erl"},{line,229}]},{mod_http_api,perform_call,4,[{file,"src/mod_http_api.erl"},{line,189}]},{mod_http_api,process,2,[{file,"src/mod_http_api.erl"},{line,142}]},{ejabberd_http,process,2,[{file,"src/ejabberd_http.erl"},{line,373}]},{ejabberd_http,process_request,1,[{file,"src/ejabberd_http.erl"},{line,496}]},{ejabberd_http,process_header,2,[{file,"src/ejabberd_http.erl"},{line,293}]}]

Using ejabberd 20.07 version

1

1 Answers

0
votes

That API is used to set presence of an existing XMPP session.

In your experiment, is the account venkat@localhost logged in the server with resource "tka1"?