{"action":"created","issue":{"url":"https://api.github.com/repos/MISP/MISP/issues/454","labels_url":"https://api.github.com/repos/MISP/MISP/issues/454/labels{/name}","comments_url":"https://api.github.com/repos/MISP/MISP/issues/454/comments","events_url":"https://api.github.com/repos/MISP/MISP/issues/454/events","html_url":"https://github.com/MISP/MISP/issues/454","id":67606236,"number":454,"title":"REST interface can't add an event when using json format","user":{"login":"otmarlendl","id":8657271,"avatar_url":"https://avatars.githubusercontent.com/u/8657271?v=3","gravatar_id":"","url":"https://api.github.com/users/otmarlendl","html_url":"https://github.com/otmarlendl","followers_url":"https://api.github.com/users/otmarlendl/followers","following_url":"https://api.github.com/users/otmarlendl/following{/other_user}","gists_url":"https://api.github.com/users/otmarlendl/gists{/gist_id}","starred_url":"https://api.github.com/users/otmarlendl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otmarlendl/subscriptions","organizations_url":"https://api.github.com/users/otmarlendl/orgs","repos_url":"https://api.github.com/users/otmarlendl/repos","events_url":"https://api.github.com/users/otmarlendl/events{/privacy}","received_events_url":"https://api.github.com/users/otmarlendl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":27,"created_at":"2015-04-10T14:19:28Z","updated_at":"2015-04-28T15:11:30Z","closed_at":null,"body":"We just spent significant time debugging our PyMISP scripts that should import/edit events. We then switched to doing manual queries with curl to nail this down.\r\n\r\nIt seems to be that in EventsController.php / new() the variable $this->request->data will never receive data from the POST request.\r\n\r\nThe search function works with json, and there is a line\r\n                                $data = $this->request->input('json_decode', true);\r\nin restSearch() which seems to fetch the data and parse it. I could not find where an equivalent operation should take place for the add() case.\r\n\r\nCan someone comment on the state of the REST/JSON API? \r\nIs this usable at all? Or should we switch to using XML?"},"comment":{"url":"https://api.github.com/repos/MISP/MISP/issues/comments/97100554","html_url":"https://github.com/MISP/MISP/issues/454#issuecomment-97100554","issue_url":"https://api.github.com/repos/MISP/MISP/issues/454","id":97100554,"user":{"login":"didelphodon","id":10989525,"avatar_url":"https://avatars.githubusercontent.com/u/10989525?v=3","gravatar_id":"","url":"https://api.github.com/users/didelphodon","html_url":"https://github.com/didelphodon","followers_url":"https://api.github.com/users/didelphodon/followers","following_url":"https://api.github.com/users/didelphodon/following{/other_user}","gists_url":"https://api.github.com/users/didelphodon/gists{/gist_id}","starred_url":"https://api.github.com/users/didelphodon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/didelphodon/subscriptions","organizations_url":"https://api.github.com/users/didelphodon/orgs","repos_url":"https://api.github.com/users/didelphodon/repos","events_url":"https://api.github.com/users/didelphodon/events{/privacy}","received_events_url":"https://api.github.com/users/didelphodon/received_events","type":"User","site_admin":false},"created_at":"2015-04-28T15:11:30Z","updated_at":"2015-04-28T15:11:30Z","body":"My guess was right - it has been those correlations that took so long. For the sake of completeness, the previous request took between 1 and 2 minutes to finish - now it only took about 10 seconds, which is still a lot imho."}}