SMS Template Design

100 views
Skip to first unread message

Abhiroop Bhatnagar

unread,
May 30, 2013, 8:07:56 AM5/30/13
to open311...@googlegroups.com
The SMS requests which will be forwarded by the service providers will be text strings, hence the application needs to parse those text strings, converts them into valid Open-311 requests and forward it to the GeoReport v2-compliant servers. It will then have to parse XML response from the server, convert it to a text string and return it to the service provider. The service provider will forward the response to the mobile which generated the SMS request.
Thus, standard SMS templates will have to be designed for the various Georeport_v2 API methods namely, GET services, GET a service definition , POST a request, GET requests, GET a request.
One of the most important constraint is the 160 character limit on SMS. Hence we have a tradeoff. Asking for a lot of information in 1 SMS, will make it less comprehensible for users and will increase codifying of requests which may make it difficult to submit requests. Whereas asking for the same amount of information through a series of SMS may result in more monetary expense for the users.
Any suggestions on how we can proceed with the discussions? Also, we need to fix some criteria to determine which templates are better ones. Three criteria visible to me are average character length of an SMS request, average character length of an SMS response and number of SMSs required to successfully submit a service request. What could be other criteria?

Cliff Ingham

unread,
May 30, 2013, 9:25:27 AM5/30/13
to open311...@googlegroups.com
Even if the user can format the query in 160 characters, the server responses are going to be more than 160 characters.  Bloomington currently has 73 services available for reporting specific problem types.  We're relatively small compared to the others, like Chicago and Alexandria.

You can see an example on our test server
https://bloomington.in.gov/test/open311/v2/services.xml

Even just listing all the service names for the user to choose from is going to be long.

Abhiroop Bhatnagar

unread,
May 31, 2013, 10:31:28 AM5/31/13
to open311...@googlegroups.com
Whenever the response is more than 160 characters, the way to deal with it is to give the maximum information possible in 160 characters and instruct the user to reply with a keyword such as "More" or "Next Page" in order to receive the rest of the response. Now, our target should be to minimize the number of such 'Chain SMS' required to get a particular piece of information.
In a POST Service Request, service_code is a required argument. So, we will need to extract it accurately and uniquely from the SMS sent by a user. We have two options:
1. Ask the user to submit a service_name and map it to service_code.
2. Create alternative service codes which map services to positive integers and ask users to submit them instead in the SMS.
I think the 2nd option is better for two reasons:
1. Less number of characters required.
2. The service_name text has to match the one in service definition exactly without any spelling mistakes, which is highly impossible.
So, if we move on with option 2, this implies that we would have to supply the service_name as well its corresponding new service code whenever there is a request for GET Service List.
Consider a response template as such:
"<service_name1>-<new service_code1>;<service_name2>-<new service_code2>;<service_name3>-<new service_code3>" and so on...
For example,a sample response can be: "City Performance-1;Graffiti-2;Mobile App Feedback-3;Potholes, Other Street Repair-4"
Thus, total length of service response will include (length of service_name)+(length of service_code)+2.
I did a little bit of analysis on the service definitions of the endpoints listed here( http://wiki.open311.org/GeoReport_v2/Servers ) to find out the number of SMS required to get the complete service list.

My findings were as follows:
Service Definitions of 26 out of 29 cities took less than or equal to 3 SMS.
The three cities that took more than 3 SMS are:
1. Corona: 4 SMS
2. SF: 7 SMS
3. and as pointed by Cliff, Bloomington, which took 7 SMS.
I am, for the time being, considering 3 SMS to be the safe limit and focusing on the cases in which more than 3 SMS are required.
In case of SF and Bloomington, we can make use of groups as a filter (as done in the android app). In this case the user response will be the group number which will result the server responding with the services under that group.
Extending the earlier analysis, we can see that:
1. SF: Number of SMS required to completely send the group list is 2 and the largest group has 8 services under it, that approximately means 1 more SMS. That makes 3 SMS in total.
2. Bloomington: Number of SMS required to completely send the group list is 1 and the largest group has 14 services under it which approximately means 3 more SMS. So, that makes it 4 SMS
3. Corona: There is no grouping so nothing more can be done here.

Summary: The cases discussed here are the maximum possible ones. The average number can be easily reduced by a thoughtful use of groups. I think the group "Most Popular" can be very helpful here. Also, with increasing number of groups, the need for sending a group list increases. But for small number of services, sending a group list may not be needed. Thus, the option to send/not send a group list prior to service list should be present.

Cliff: There is no city of Alexandria in that list(http://wiki.open311.org/GeoReport_v2/Servers). Also, Chicago seemed to be pretty small compared to Bloomington and even Bloomington had only 49 services instead of 73(though the service_codes indeed go upto 73). Am I looking at the wrong files?

SMS Length Analysis.txt

Cliff Ingham

unread,
May 31, 2013, 10:41:28 AM5/31/13
to open311...@googlegroups.com
You are correct, Bloomington only has only around 49 published services.
The 73 number I came up with included private services for city employees.

Alexandria is not in production, yet. However, I remember it as an
example of a city where every service had metadata and required a
service definition lookup. This is in contrast to a city like
Bloomington, where only a small number of our services have metadata.

Services that do not have metadata do not require the extra service
definition request.

Abhiroop Bhatnagar

unread,
Jun 3, 2013, 2:14:52 PM6/3/13
to open311...@googlegroups.com
What are these private services used for? Do I have to take them into account?

From now on, I will be using square bracket notation to denote text in a sms.
I far as I understand, the following process should work alright(for sample keyword open311):
1.) GET Services
User sends SMS: [open311 get_services]
Response: User gets a paginated list of services/groups. If she replies with a group number [open311 3] , she will get a paginated list of services in that group.

Thus, now the user will have the new service_code for the service that she wants to POST a request for.

2.) POST Request
Suggested SMS Template: [open311 post_request <new service_code> <address_string>]
Example: [open311 post_request 24 opp.big bank,north street]

Spaces are crucial in determining the input because the SMS string will be exploded with respect to them.

If the metadata for that service_code is true, the user will receive back the name of the attributes he has to send.
A sample response could look like:[Please reply back with "open311 <application-name> <application-url>" substituting for required parameters]

After the attributes are received by the sms app, a POST request will be constructed and sent to the endpoint by the app and the received service_request_id will be forwarded to the user, thus completing the cycle.
If a token was returned, the app will have to call GET service_request_id from that token to receive the service_request_id.

I have not been able to figure out how to approach when there are multiple jurisdiction_ids.

Cliff Ingham

unread,
Jun 4, 2013, 8:43:18 AM6/4/13
to open311...@googlegroups.com
Is there some way we could get validated addresses or lat/long from the users?    It's been our experience that when users can type whatever they want for a location, a large percentage of the locations are worthless.  City employees look at the text and say, "I have no idea where they are talking about".




--
You received this message because you are subscribed to the Google Groups "open311-mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open311-mobil...@googlegroups.com.
To post to this group, send email to open311...@googlegroups.com.
Visit this group at http://groups.google.com/group/open311-mobile?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Abhiroop Bhatnagar

unread,
Jun 4, 2013, 1:35:01 PM6/4/13
to open311...@googlegroups.com
Unfortunately, I cannot see of a way to get lat/long. Users cannot possibly know the coordinates and only information received by the app will be the text within the SMS.
What if design the POST request template as such:
[open311 post_request <new service_code> <landmark> <street> <area> <area_code>]
It will be parsed as before but it will instruct users to be more specific about the address.

Abhiroop Bhatnagar

unread,
Jun 7, 2013, 10:15:02 AM6/7/13
to open311...@googlegroups.com
Before beginning coding, I am thinking about drafting a specification for SMS templates on the lines of the Georeport v2 specification. We can then circulate it within the open311 community for their reviews. Would take me probably 5 days.

Rick Dietz

unread,
Jun 7, 2013, 10:32:22 AM6/7/13
to open311...@googlegroups.com
You may be thinking the same thing, but I think developing a flowchart the diagrams the path an SMS-based interaction much follow is important.... from the point a session is started to the point when the issue report is submitted to the API.  I'm not sure a specification is needed.  But perhaps we are talking about the same thing.
--
~~~~~~~~~~~~~~~~~~~~~~~~~
Rick Dietz, Director
Information & Technology Services Dept.
City of Bloomington, Indiana
812.349.3485 (office) 812.340.7958 (cell)
die...@bloomington.in.gov

Abhiroop Bhatnagar

unread,
Jun 7, 2013, 11:02:41 AM6/7/13
to open311...@googlegroups.com
Good Idea! A flowchart would really help someone to understand the process. I was thinking about describing the arguments and layout of the various requests as well as expected responses. Combining those with a flowchart of the process would provide a holistic overview of the functioning.

Abhiroop Bhatnagar

unread,
Jun 10, 2013, 8:50:51 AM6/10/13
to open311...@googlegroups.com

ReportSMS enables a user to perform the following interactions with a Open311 server through SMS:

1. Get Service Codes

2. Post Service Request

3. Get Request Status

 

These interactions represent different interaction modes. Each interaction mode has its own SMS template for Query and Response.

ReportSMS also supports a fourth interaction mode, the Help mode.

The interaction modes and their templates are described below:

 

1. Get Service Codes:

 

Function: Queries the Open311 server to get a list of groups or services.

Query Template: [<keyword><space>get_service_codes]

 

Response: As configured in the ReportSMS server, the response can be either a List of Groups with their Group Numbers or a List of Services with their Service Numbers.

     Configuration 1: ReportSMS is configured to return List of Groups:

          Response Template: [<grouplist_info_text>:<group1_name>-<group1_code>;<group2_name>-<group2_code>; .....;<grouplist_next_page_text>]    



        

     Configuration 2:  ReportSMS is configured to return List of Services:

          Response Template: [<servicelist_info_text>:<service1_name>-<service1_code>;<service2_name>-<service2_code>; .....;<servicelist_next_page_text>]

  

2. Submit Service Request:

Purpose: Posts a service request to the Open311 server.

 

Query Template:[<keyword><space>submit_request<space><service_code><space><address_string>]

 

Response Template: 

      Case: Query Successfully Registered : [<successful_query_response_text><space><service_request_id>]

                   

      Case: Query Unsuccessful : [<unsuccessful_query_response_text>]

     

      Case: Service requires metadata: 

    

Datatype

Response Template

string

[<string_datatype_response_text1><description><space><string_datatype_response_text2>]

number

[<number_datatype_response_text1><description><space><number_datatype_response_text2>]

datetime

[<datetime_datatype_response_text1><description><space><datetime_datatype_response_text2>]

text

[<text_datatype_response_text1><description><space><text_datatype_response_text2>]

singlevaluelist

[<singlevaluelist_datatype_response_text1><description><space><singlevaluelist_datatype_response_text2><space>1-<option1_name>;2-<option2_name>;...;<options_next_page_text>]

multivaluelist

[<multivaluelist_datatype_response_text1><description><space><multivaluelist_datatype_response_text2><space>1-<option1_name>;2-<option2_name>;...;<options_next_page_text>]


3. Check Request Status

Function:Returns status of a request from an Open311 Server.

 

Query Template: [<keyword><space>check_request_status<space><service_id>]

Example Query: [open311 check_request_status 42flp]

 

Response Template: [Request Status:<status>;<status_notes>]

Example Response: [Request Status:closed;Info:Duplicate request.]

 

4. Help

Function: Return information about the Query Templates

Query Template: [<keyword><space>help]

 

Response Template: [Reply with 'open311<space>option code' get more details;Options:Get Service List-h1;Submit Service Request-h2;Check Request Status-h3]


Error:

Response Template: [<error_text>]

 

Abhiroop Bhatnagar

unread,
Jun 10, 2013, 12:40:04 PM6/10/13
to open311...@googlegroups.com
I have prepared the documentation present in previous mail to clearly outline the requirements from the app. I would like to mention some important considerations I took while forming the documentation:
1. The app should not need to store services data of any particular jurisdiction. It should fetch all such data from the concerned open311 server itself.
2. The aim should be to make the interface as intuitive as possible in terms of language as well as interaction flow within the 160 character constraint and any interaction mode should be designed to require minimum number of SMS from user to complete the flow.

Also, since we are working under a very tight constraint,we will need to do a lot of optimizations.I have some in mind:
1. Get Service Code interaction mode: Sending Group List before Service List  (described in a previous post)
2. Get Service Code interaction mode: Sending Groups/Services in ascending order of character length of their group name/service name: It will result in more service/group codes visible to user in the first SMSs
3. Remove spaces before and after the following characters:  &  ;  :  ,  (  )
For example:
Original                                                              After Optimization                                
Potholes, Other Street Repair                Potholes,Other Street Repair
Bus Services (Bloomington Transit)    Bus Services(Bloomington Transit)
Streets, Parking & Traffic                        Streets,Parking&Traffic
4.Convert 'and' to '&'

Suggestions? Views?
I named the application as ReportSMS for now. Suggestions are welcome for some other name.

Rick Dietz

unread,
Jun 10, 2013, 1:00:29 PM6/10/13
to open311...@googlegroups.com
I think GeoReporter SMS or SMSReporter are names that will work with our existing naming conventions. 

I think what you have put together looks like a good start.  I think thee will be quit a bit of interface optimization when we get further along and can test the interaction.  

Looks good so far!


--
You received this message because you are subscribed to the Google Groups "open311-mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open311-mobil...@googlegroups.com.
To post to this group, send email to open311...@googlegroups.com.
Visit this group at http://groups.google.com/group/open311-mobile?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Abhiroop Bhatnagar

unread,
Jun 11, 2013, 12:44:03 PM6/11/13
to open311...@googlegroups.com
Lets go with GeoReporter SMS!

Rick Dietz

unread,
Jun 11, 2013, 1:21:29 PM6/11/13
to open311...@googlegroups.com
Sounds good to me. -R
Reply all
Reply to author
Forward
0 new messages