{"action":"created","issue":{"url":"https://api.github.com/repos/jadahl/mod_restful/issues/29","labels_url":"https://api.github.com/repos/jadahl/mod_restful/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/jadahl/mod_restful/issues/29/comments","events_url":"https://api.github.com/repos/jadahl/mod_restful/issues/29/events","html_url":"https://github.com/jadahl/mod_restful/issues/29","id":109879114,"number":29,"title":"Is it compatible with ejabberd 15?","user":{"login":"handokochen","id":8443515,"avatar_url":"https://avatars.githubusercontent.com/u/8443515?v=3","gravatar_id":"","url":"https://api.github.com/users/handokochen","html_url":"https://github.com/handokochen","followers_url":"https://api.github.com/users/handokochen/followers","following_url":"https://api.github.com/users/handokochen/following{/other_user}","gists_url":"https://api.github.com/users/handokochen/gists{/gist_id}","starred_url":"https://api.github.com/users/handokochen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/handokochen/subscriptions","organizations_url":"https://api.github.com/users/handokochen/orgs","repos_url":"https://api.github.com/users/handokochen/repos","events_url":"https://api.github.com/users/handokochen/events{/privacy}","received_events_url":"https://api.github.com/users/handokochen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-05T20:28:05Z","updated_at":"2015-12-07T17:39:17Z","closed_at":null,"body":"Hi,\r\n\r\nI installed the ejabberd 15.09 via the osx installer and installed the mod_restful module via ejabberdctl module_install.\r\n\r\nWarnings on module_install:\r\nsrc/mod_restful_admin.erl:63: Warning: behaviour gen_restful_api undefined\r\nsrc/mod_restful_register.erl:32: Warning: behaviour gen_restful_api undefined\r\n\r\nHere's my yml:\r\nmod_restful:\r\n    api:\r\n      - path: [\"admin\"]\r\n        module: mod_restful_admin\r\n        params:\r\n          key: \"secret\"\r\n          allowed_commands: [register, unregister]\r\n      - path: [\"register\"]\r\n        module: mod_restful_register\r\n        params:\r\n          key: \"secret\"\r\n\r\nWarning on ejabberd start up:\r\n2015-10-05 13:02:30.594 [warning] <0.37.0>@gen_mod:validate_opts:255 module 'mod_restful' doesn't export mod_opt_type/1\r\n\r\nHere's the error I got:\r\n2015-10-05 13:24:30.118 [debug] <0.470.0>@ejabberd_http:process_header:283 (#Port<0.4074>) http query: 'GET' <<\"/api/register/is_registered?username=admin&host=chat.myhost.com&key=secret\">>\r\n2015-10-05 13:24:30.118 [debug] <0.470.0>@ejabberd_http:process:361 [<<\"api\">>,<<\"register\">>,<<\"is_registered\">>] matches [<<\"api\">>]\r\n2015-10-05 13:24:30.119 [error] <0.470.0> Processing throwed error {badmatch,false}\r\ntrace: [{mod_restful,handle_request,3,[{file,\"src/mod_restful.erl\"},{line,179}]},{mod_restful,process,2,[{file,\"src/mod_restful.erl\"},{line,161}]},{ejabberd_http,process,5,[{file,\"src/ejabberd_http.erl\"},{line,371}]},{ejabberd_http,process_request,1,[{file,\"src/ejabberd_http.erl\"},{line,459}]},{ejabberd_http,process_header,2,[{file,\"src/ejabberd_http.erl\"},{line,293}]},{ejabberd_http,parse_headers,1,[{file,\"src/ejabberd_http.erl\"},{line,209}]},{ejabberd_http,init,2,[{file,\"src/ejabberd_http.erl\"},{line,163}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,237}]}]\r\n\r\nI'm pretty new at ejabberd, so any help is appreciated."},"comment":{"url":"https://api.github.com/repos/jadahl/mod_restful/issues/comments/162603084","html_url":"https://github.com/jadahl/mod_restful/issues/29#issuecomment-162603084","issue_url":"https://api.github.com/repos/jadahl/mod_restful/issues/29","id":162603084,"user":{"login":"pmkaboo","id":2906451,"avatar_url":"https://avatars.githubusercontent.com/u/2906451?v=3","gravatar_id":"","url":"https://api.github.com/users/pmkaboo","html_url":"https://github.com/pmkaboo","followers_url":"https://api.github.com/users/pmkaboo/followers","following_url":"https://api.github.com/users/pmkaboo/following{/other_user}","gists_url":"https://api.github.com/users/pmkaboo/gists{/gist_id}","starred_url":"https://api.github.com/users/pmkaboo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmkaboo/subscriptions","organizations_url":"https://api.github.com/users/pmkaboo/orgs","repos_url":"https://api.github.com/users/pmkaboo/repos","events_url":"https://api.github.com/users/pmkaboo/events{/privacy}","received_events_url":"https://api.github.com/users/pmkaboo/received_events","type":"User","site_admin":false},"created_at":"2015-12-07T17:39:17Z","updated_at":"2015-12-07T17:39:17Z","body":"hello, im running ejabberd 15.11 and have the same problem, server throws the warning on startup, and all requests end up with 401 unauthorized and the server throws the proccessing error.\r\n\r\nheres my request:\r\n```http\r\nPOST /api/admin HTTP/1.1\r\nHost: 10.0.0.72:8088\r\nAuthorization: Basic YWRtaW5Aa2Fib28tcGMtNC5sb2NhbDprb3NpY2U=\r\nContent-Type: application/json\r\nCache-Control: no-cache\r\nPostman-Token: c1fc543c-cf26-7d80-25fd-a33ddca93386\r\n\r\n{\"command\":\"status\"}\r\n```\r\n\r\nconfiguration:\r\n```yml\r\nlisten:\r\n  -\r\n    port: 8088\r\n    ip: \"::\" ## also tried \"0.0.0.0\"\r\n    module: ejabberd_http\r\n    request_handlers:\r\n      \"/api\": mod_restful\r\nmodules:\r\n  mod_restful:\r\n    api:\r\n      - path: [\"admin\"]\r\n        module: mod_restful_admin\r\n        params:\r\n          allowed_commands: [status] ## also tried with [\"status\"]\r\n```\r\nand the error:\r\n```shell\r\n18:27:51.753 [error] Processing throwed error {badmatch,false}\r\ntrace: [{mod_restful,handle_request,3,[{file,\"src/mod_restful.erl\"},{line,179}]},{mod_restful,process,2,[{file,\"src/mod_restful.erl\"},{line,161}]},{ejabberd_http,process,5,[{file,\"src/ejabberd_http.erl\"},{line,360}]},{ejabberd_http,process_request,1,[{file,\"src/ejabberd_http.erl\"},{line,448}]},{ejabberd_http,process_header,2,[{file,\"src/ejabberd_http.erl\"},{line,290}]},{ejabberd_http,parse_headers,1,[{file,\"src/ejabberd_http.erl\"},{line,210}]},{ejabberd_http,init,2,[{file,\"src/ejabberd_http.erl\"},{line,163}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,237}]}]\r\n```"}}