List Additional Questions for a Service Request

Given a service request ID (chosen from the list of valid service request types), list the additional questions that need to be asked.

General
URL Format http://[locale].seeclickfix.com/api/request_types/[request_type_id]...
or for open311 compatibility
http://[locale].seeclickfix.com/api/service_list/[request_type_id]/...
or for open311 compatibility
http://[locale].seeclickfix.com/api/service_definition.[format]
Example http://seeclickfix.com/api/request_types/1/request_type_questions.x...
HTTP Method GET
Valid Data Formats xml, json
Permissions read only

Required Parameters

  • request_type_id - Service request ID. A valid service request type ID from this FAQ.
  • api_key - API Key

Optional Parameters

None.

Attributes and Structure

This query returns an array of request type questions. A request type question has the following attributes:

  • created_at - Timestamp - Time the question was added.
  • display_answer - Boolean - Whether or not the answer will be publicly displayed.
  • id - Unique Integer - ID of the question
  • primary_key - Unique string for the question. Must be passed when answering questions in creating an issue.
  • position - integer - Suggested position to display the question.
  • question - string - Question to prompt with.
  • question_type - One of [text,textarea,select,number,datetime, multivaluelist, hidden, note]
  • required_response - boolean - Whether an answer is required.
  • select_values - string - If the question_type is select, select values are in the format "value=name|value=name". For example "b_shoe=Big Shoe|s_shoe=Small Shoe".

Question Types

There are 8 possible types of questions here. ( text,textarea,select,number,datetime, multivaluelist, hidden, note )

  • "datetime" can be in the format "April 25, 2007 5:00 PM".
  • The type "note" does not expect a response as it only displays a note, not a question.
  • Type "number" requires a numerical validation.
  • Type multivaluelist can be sent in the format 'issue[request_type_answers_attributes][][answer][]'='first answer' 'issue[request_type_answers_attributes][][answer][]'='second answer'.

Submitting Data

These extended questions need to be sent as part of the issue in the structure:
issue[request_type_answers_attributes][][answer]='This is my answer' issue[request_type_answers_attributes][][request_type_question_primary_key]='primary_key'

This produces the following format

issue{
  :request_type_answers_attributes => [ {:answer => 'This is my answer', :request_type_question_primary_key => 'primary_key'} ]
}

Example:

http://seeclickfix.com/api/request_types/1/request_type_questions.xml?key=87ced127d6dead827a0d26ebc14a176a9d59c886

This query will return the additional questions for service request type id "1". Below is an example question.

<request-type-questions type="array">
    <request-type-question>
        <created-at type="timestamp">Wed Feb 24 23:10:53 UTC 2010</created-at>
        <display-answer type="boolean">true</display-answer>
        <id type="integer">40</id>
        <primary_key type="integer">40</primary_key>
        <position type="integer">1</position>
        <question>How big is the hole?</question>
        <question-type>text</question-type>
        <required-response type="boolean">true</required-response>
        <select-values/>
        <updated-at type="timestamp">Wed Feb 24 23:10:53 UTC 2010</updated-at>
    </request-type-question>
</request-type-questions>