CUTR-at-USF / see-click-fix-issues

Issues encountered when submitting information to SeeClickFix's Open311 API
0 stars 0 forks source link

Service code "Traffic Sign or Signal issue" has internal server error #2

Closed cagryInside closed 9 years ago

cagryInside commented 9 years ago

Submitting the issue for service name: Traffic Sing or Signal issue causes internal server error.

Http POST body:

api_key=937033cad3054ec58a1a8156dcdd6ad8a416af2f&service_code=991&
service_name=Traffic+Sign+or+Signal+Issue&lat=27.847167111499147&long=-82.70814154297113&
address_string=5401-5499+82nd+Terrace+N%2C+Pinellas+Park%2C+FL+33781.&description=ofens&
first_name=cagri&last_name=usf&email=c1-2-3-4-5%40hotmail.com&device_id=355458060771954&
attribute%5B1248%5D=East&attribute%5B1249%5D=mornings&attribute%5B1249%5D=afternoons&
attribute%5B1250%5D=test

SCF response:

[{"code":400,"message":"An internal error occured during the creation of this issue. Please ensure all 
required parameters are present."}]
cagryInside commented 9 years ago

Fixed by changing the post body from "&attribute[1249]=mornings&attribute[1249]=afternoons" to "&attribute[1249][]=mornings&attribute[1249][]=afternoons".

barbeau commented 9 years ago

Thanks @cagryInside! For the record, here was SCF's email response:

The "At what time of day..." question with code 1249 for the Traffic Sign or Signal Issue service has a datatype of multivaluelist. In the Open311 spec, parameters for multivaluelist questions should be provided as an array. So your post body should change from "&attribute[1249]=mornings&attribute[1249]=afternoons" to "&attribute[1249][]=mornings&attribute[1249][]=afternoons". This behavior is sort of hidden in the docs for the attribute parameter here: http://wiki.open311.org/GeoReport_v2/#post-service-request

cagryInside commented 9 years ago

Now the answers for In which direction were you traveling when you experienced the problem? and How can we contact you if we need more information? (email, phone number)? doesn't show up on SeeClickFix web interface.

Post Body:

api_key=937033cad3054ec58a1a8156dcdd6ad8a416af2f&service_code=991&
service_name=Traffic+Sign+or+Signal+Issue&lat=27.868766978989417&long=-82.7440308406949&
address_string=10517-10541+Belcher+Rd%2C+Seminole%2C+FL+33777.&description=test&
first_name=cagri&last_name=test&email=mail%40mail.com&device_id=356489051606882&
attribute%5B1248%5D=East&attribute%5B1249%5D%5B%5D=afternoons&attribute%5B1249%5D%5B
%5D=evenings&attribute%5B1250%5D=8137666661

SeeClickFix url: http://test.seeclickfix.com/issues/1315326-traffic-sign-or-signal-issue

PS: As mentioned by SeeClickFix, these fields might be also private:

Some questions are set to not have their answers displayed on the issue show page, and are only used internally.

cagryInside commented 9 years ago

@barbeau Lets keep this issue open until we make sure that the last issue https://github.com/CUTR-at-USF/see-click-fix-issues/issues/2#issuecomment-129897018 is actually OK.

barbeau commented 9 years ago

@cagryInside Agreed - sorry for the premature closure. So do you think SCF should pass back a parameter for these private fields, so we can confirm they are received?

From SCF:

That could be an extra parameter we pass back- something like "answer_is_private": true/false

cagryInside commented 9 years ago

@cagryInside Agreed - sorry for the premature closure. So do you think SCF should pass back a parameter for these private fields, so we can confirm they are received?

@barbeau I think it would be useful for us to do preprod testing. But, in the production it might not be useful, since we don't have any mechanism to handle if the private fields are not received.

barbeau commented 9 years ago

Ok, that makes sense. After you troubleshoot https://github.com/CUTR-at-USF/see-click-fix-issues/issues/3 I'll reply to them.

cagryInside commented 9 years ago

Based on the mail from SCF In which direction were you traveling when you experienced the problem? and How can we contact you if we need more information? (email, phone number)? questions are private. So, we don't have any problem in our end.

Yes, both the "In which direction were you traveling when you experienced the problem?” and "How can we contact you if we need more information" questions are private. As a temporary workaround, you can check the request type in our standard reporting UI for Pinellas County, where the questions have a label if they're private. http://seeclickfix.com/pinellas_county/report

So, I am closing this issue.