Creating an Issue

Creating an issue using the SeeClickFix API requires the following steps:

  1. Check for valid service requests at a known latitude/longitude.
  2. Given a service request ID, query for additional questions to be answered.
  3. POST data as a single HTTP request (documented here :) ).
General
URL Format http://[locale].seeclickfix.com/api/issues.[format]
HTTP Method POST
Valid Data Formats xml, json
Permissions read/write

Required Parameters

  • api_key - API Key
  • issue[summary] - Summary of the problem.
  • issue[lat] - Longitude of the issue.
  • issue[lng] - Latitude of the issue.
  • Some Service Request Questions - Some service request questions are required when reporting custom service request types.

Optional Parameters

  • issue[description] - Longer text describing the problem.
  • issue[address] - Text representation of the location of the issue.
  • issue[reporter_email] - Email of the person reporting the issue.
  • issue[reporter_display] - Text display of the person reporting the issue.
  • issue[issue_image_attributes][uploaded_data] - Attach an image to the issue. Form data must be sent as "multipart/form-data".
  • issue[request_type_id] - If submitting to a service request, specify the service request ID here. By adding this attribute, additional validations are required, including: 1. Making sure the service request can be within the given boundaries. 2. Making sure all of the required additional questions are completed.

For each service request question provide the following parameters.

  • issue[request_type_answers_attributes][][request_type_question_primary_key] - Primary key of the service request question.
  • issue[request_type_answers_attributes][][answer] - Answer to the service request question.

Example:

curl -d 'issue[summary]=foo&api_key=87ced127d6dead827a0d26ebc14a176a9d59c886&issue[lat]=41.3103725899427&issue[lng]=-72.9241595114853' http://seeclickfix.com/api/issues.xml

This query returns:

<?xml version="1.0" encoding="UTF-8"?>
<issue>
  <acknowledged-at type="timestamp" nil="true"></acknowledged-at>
  <added-by-gps type="boolean">false</added-by-gps>
  <address></address>
  <bitly nil="true"></bitly>
  <closed-at type="timestamp" nil="true"></closed-at>
  <created-at type="timestamp">Mon Mar 29 16:00:01 UTC 2010</created-at>
  <description></description>
  <id type="integer">15106</id>
  <lat type="float">41.3103725899427</lat>
  <lng type="float">-72.9241595114853</lng>
  <locale>en</locale>
  <mobile-id type="integer" nil="true"></mobile-id>
  <next-notice-date type="timestamp">Mon Apr 12 12:00:01 -0400 2010</next-notice-date>
  <override-address type="boolean" nil="true"></override-address>
  <rating type="integer">1</rating>
  <rejected-count type="integer">0</rejected-count>
  <reopened-at type="timestamp" nil="true"></reopened-at>
  <reporter-display nil="true"></reporter-display>
  <reporter-email nil="true"></reporter-email>
  <send-email type="boolean">true</send-email>
  <signature nil="true"></signature>
  <spam type="boolean">false</spam>
  <spaminess type="float" nil="true"></spaminess>
  <status>Open</status>
  <summary>foo</summary>
  <time-between-notices type="integer">14</time-between-notices>
  <token>9959fe995e401b442fa45c59c7935941c0c023ac</token>
  <updated-at type="timestamp">Mon Mar 29 16:00:01 UTC 2010</updated-at>
  <user-id type="integer" nil="true"></user-id>
  <watcher-delivered-at type="timestamp" nil="true"></watcher-delivered-at>
  <watcher-scheduled-at type="timestamp">Mon Mar 29 12:03:01 -0400 2010</watcher-scheduled-at>
</issue>

Returned Values

  • acknowledged-at - Date acknowledged if applicable.
  • added-by-gps - Whether the issue was added with GPS accuracy.
  • address - Address in text form.
  • bitly - Bitly url.
  • closed-at - Date issue closed if applicable.
  • created-at - Date issue created if applicable.
  • description - Issue description.
  • id - Unique ID of issue.
  • lat - Latitude of Issue.
  • lng - Longitude of Issue.
  • locale - Locale Issue created.
  • mobile-id - Anonymous unique mobile ID if applicable.
  • override-address - Whether the user choose to change the address as text from what was estimated for them.
  • rating - Number of votes on an issue.
  • rejected-count - Number of times the issue was rejected.
  • reopened-at - Date the issue was reopened if applicable.
  • reporter-display - How to display the reporter.
  • reporter-email - The email of the reporter.
  • status - Issue status. One of "Open", "Closed", "Acknowledged", or "Archived".
  • summary - Summary of the issue.
  • token - Private token required to edit the issue. This should be kept private and only exposed for the user.
  • updated-at - Date the issue was last updated.
  • user-id - If the issue is created while someone is logged in this will be recorded.

Errors

If values are invalid, an error will be returned as below.

<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>Lng can't be blank</error>
  <error>Lat can't be blank</error>
</errors>