{"action":"created","issue":{"url":"https://api.github.com/repos/onaio/onadata/issues/1227","repository_url":"https://api.github.com/repos/onaio/onadata","labels_url":"https://api.github.com/repos/onaio/onadata/issues/1227/labels{/name}","comments_url":"https://api.github.com/repos/onaio/onadata/issues/1227/comments","events_url":"https://api.github.com/repos/onaio/onadata/issues/1227/events","html_url":"https://github.com/onaio/onadata/issues/1227","id":293675558,"number":1227,"title":"Flow Results: 500 internal server error on posting a new Package definition","user":{"login":"markboots","id":602745,"avatar_url":"https://avatars1.githubusercontent.com/u/602745?v=4","gravatar_id":"","url":"https://api.github.com/users/markboots","html_url":"https://github.com/markboots","followers_url":"https://api.github.com/users/markboots/followers","following_url":"https://api.github.com/users/markboots/following{/other_user}","gists_url":"https://api.github.com/users/markboots/gists{/gist_id}","starred_url":"https://api.github.com/users/markboots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markboots/subscriptions","organizations_url":"https://api.github.com/users/markboots/orgs","repos_url":"https://api.github.com/users/markboots/repos","events_url":"https://api.github.com/users/markboots/events{/privacy}","received_events_url":"https://api.github.com/users/markboots/received_events","type":"User","site_admin":false},"labels":[{"id":686386919,"url":"https://api.github.com/repos/onaio/onadata/labels/FLOIP","name":"FLOIP","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":{"login":"ukanga","id":85585,"avatar_url":"https://avatars0.githubusercontent.com/u/85585?v=4","gravatar_id":"","url":"https://api.github.com/users/ukanga","html_url":"https://github.com/ukanga","followers_url":"https://api.github.com/users/ukanga/followers","following_url":"https://api.github.com/users/ukanga/following{/other_user}","gists_url":"https://api.github.com/users/ukanga/gists{/gist_id}","starred_url":"https://api.github.com/users/ukanga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ukanga/subscriptions","organizations_url":"https://api.github.com/users/ukanga/orgs","repos_url":"https://api.github.com/users/ukanga/repos","events_url":"https://api.github.com/users/ukanga/events{/privacy}","received_events_url":"https://api.github.com/users/ukanga/received_events","type":"User","site_admin":false},"assignees":[{"login":"ukanga","id":85585,"avatar_url":"https://avatars0.githubusercontent.com/u/85585?v=4","gravatar_id":"","url":"https://api.github.com/users/ukanga","html_url":"https://github.com/ukanga","followers_url":"https://api.github.com/users/ukanga/followers","following_url":"https://api.github.com/users/ukanga/following{/other_user}","gists_url":"https://api.github.com/users/ukanga/gists{/gist_id}","starred_url":"https://api.github.com/users/ukanga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ukanga/subscriptions","organizations_url":"https://api.github.com/users/ukanga/orgs","repos_url":"https://api.github.com/users/ukanga/repos","events_url":"https://api.github.com/users/ukanga/events{/privacy}","received_events_url":"https://api.github.com/users/ukanga/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/onaio/onadata/milestones/56","html_url":"https://github.com/onaio/onadata/milestone/56","labels_url":"https://api.github.com/repos/onaio/onadata/milestones/56/labels","id":3143440,"number":56,"title":"Week 9 - 10","description":"","creator":{"login":"ukanga","id":85585,"avatar_url":"https://avatars0.githubusercontent.com/u/85585?v=4","gravatar_id":"","url":"https://api.github.com/users/ukanga","html_url":"https://github.com/ukanga","followers_url":"https://api.github.com/users/ukanga/followers","following_url":"https://api.github.com/users/ukanga/following{/other_user}","gists_url":"https://api.github.com/users/ukanga/gists{/gist_id}","starred_url":"https://api.github.com/users/ukanga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ukanga/subscriptions","organizations_url":"https://api.github.com/users/ukanga/orgs","repos_url":"https://api.github.com/users/ukanga/repos","events_url":"https://api.github.com/users/ukanga/events{/privacy}","received_events_url":"https://api.github.com/users/ukanga/received_events","type":"User","site_admin":false},"open_issues":23,"closed_issues":1,"state":"open","created_at":"2018-02-26T12:11:19Z","updated_at":"2018-02-26T15:39:51Z","due_on":"2018-03-12T07:00:00Z","closed_at":null},"comments":1,"created_at":"2018-02-01T20:39:20Z","updated_at":"2018-02-27T06:52:55Z","closed_at":null,"author_association":"NONE","body":"Ona API returns a 500 error when we attempt to post a new Flow Results package definition:\r\n\r\n1) What we tried:  Posting a new package definition, both with and without a client-supplied ID for the package. This example shows without a client-supplied ID.\r\n\r\nPOST https://api.ona.io/api/v1/flow-results/packages\r\nHeaders:\r\nAuthorization: Token [api key]\r\nContent-type: application/vnd.api+json\r\n\r\nBody:\r\n```\r\n{  \r\n   \"data\":{  \r\n      \"type\":\"packages\",\r\n      \"attributes\":{  \r\n         \"profile\":\"flow-results-package\",\r\n         \"name\":\"standard_test_survey\",\r\n         \"flow-results-specification\":\"1.0.0-rc1\",\r\n         \"created\":\"2015-11-26 02:59:24+00:00\",\r\n         \"modified\":\"2017-12-04 15:54:44+00:00\",\r\n         \"id\":null,\r\n         \"title\":\"Standard Test Survey\",\r\n         \"resources\":[  \r\n            {  \r\n               \"path\":null,\r\n               \"api-data-url\":null,\r\n               \"mediatype\":\"application/json\",\r\n               \"encoding\":\"utf-8\",\r\n               \"schema\":{  \r\n                  \"language\":\"eng\",\r\n                  \"fields\":[  \r\n                     {  \r\n                        \"name\":\"timestamp\",\r\n                        \"title\":\"Timestamp\",\r\n                        \"type\":\"datetime\"\r\n                     },\r\n                     {  \r\n                        \"name\":\"row_id\",\r\n                        \"title\":\"Row ID\",\r\n                        \"type\":\"string\"\r\n                     },\r\n                     {  \r\n                        \"name\":\"contact_id\",\r\n                        \"title\":\"Contact ID\",\r\n                        \"type\":\"string\"\r\n                     },\r\n                     {  \r\n                        \"name\":\"question_id\",\r\n                        \"title\":\"Question ID\",\r\n                        \"type\":\"string\"\r\n                     },\r\n                     {  \r\n                        \"name\":\"response_id\",\r\n                        \"title\":\"Response ID\",\r\n                        \"type\":\"any\"\r\n                     },\r\n                     {  \r\n                        \"name\":\"response_metadata\",\r\n                        \"title\":\"Response Metadata\",\r\n                        \"type\":\"object\"\r\n                     }\r\n                  ],\r\n                  \"questions\":[  \r\n                     {  \r\n                        \"1448506769745_42\":{  \r\n                           \"type\":\"select_one\",\r\n                           \"label\":\"Are you a woman or a man?\",\r\n                           \"type_options\":{  \r\n                              \"choices\":[  \r\n                                 \"Woman\",\r\n                                 \"Man\",\r\n                                 \"Other\"\r\n                              ]\r\n                           }\r\n                        }\r\n                     },\r\n                     {  \r\n                        \"1448506773018_89\":{  \r\n                           \"type\":\"numeric\",\r\n                           \"label\":\"How old are you? Please enter your age in years.\",\r\n                           \"type_options\":{  \r\n                              \"range\":[  \r\n                                 -99,\r\n                                 99\r\n                              ]\r\n                           }\r\n                        }\r\n                     },\r\n                     {  \r\n                        \"1448506774930_30\":{  \r\n                           \"type\":\"open\",\r\n                           \"label\":\"What was the best thing that happened to you today?\",\r\n                           \"type_options\":{  \r\n\r\n                           }\r\n                        }\r\n                     }\r\n                  ]\r\n               }\r\n            }\r\n         ]\r\n      }\r\n   }\r\n}\r\n```\r\n\r\n2) What we expected: Response with 201 Created:\r\n\r\n```\r\nHTTP/1.1 201 Created\r\nLocation: https://go.votomobile.org/flow-results/packages/0c364ee1-0305-42ad-9fc9-2ec5a80c55fa\r\nContent-Type: application/vnd.api+json\r\n\r\n{\r\n  \"data\": {\r\n    \"type\": \"packages\",\r\n...\r\n```\r\n\r\n3) What we received: 500 Internal Server Error with an HTML error page"},"comment":{"url":"https://api.github.com/repos/onaio/onadata/issues/comments/368765977","html_url":"https://github.com/onaio/onadata/issues/1227#issuecomment-368765977","issue_url":"https://api.github.com/repos/onaio/onadata/issues/1227","id":368765977,"user":{"login":"ukanga","id":85585,"avatar_url":"https://avatars0.githubusercontent.com/u/85585?v=4","gravatar_id":"","url":"https://api.github.com/users/ukanga","html_url":"https://github.com/ukanga","followers_url":"https://api.github.com/users/ukanga/followers","following_url":"https://api.github.com/users/ukanga/following{/other_user}","gists_url":"https://api.github.com/users/ukanga/gists{/gist_id}","starred_url":"https://api.github.com/users/ukanga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ukanga/subscriptions","organizations_url":"https://api.github.com/users/ukanga/orgs","repos_url":"https://api.github.com/users/ukanga/repos","events_url":"https://api.github.com/users/ukanga/events{/privacy}","received_events_url":"https://api.github.com/users/ukanga/received_events","type":"User","site_admin":false},"created_at":"2018-02-27T06:52:55Z","updated_at":"2018-02-27T06:52:55Z","author_association":"OWNER","body":"@markboots Was the questions as an object in the specification document a typo? Is it meant to be a list or an object?\r\nI do prefer a list main reason being the order of questions in the list is the order in which the questions flow when being administered to a user."}}
{"actor":{"display_login":"ukanga"}}