FOR ARCHIVAL PURPOSES ONLY

The information in this wiki hasn't been maintained for a good while. Some of the projects described have since been deprecated.

In particular, the "Ushahidi Platform v3.x" section contains information that is often misleading. Many details about this version of Platform have changed since.

This website is an extraction of the original Ushahidi wiki into a static form. Because of that, functions like logging in, commenting or searching will not work.

For more documentation, please refer to https://docs.ushahidi.com

Skip to end of metadata
Go to start of metadata

A report object serialized to JSON and submitted gives the following error:

{“code”:”001″,”message”:”Missing Parameter – task.”}

even for a simple entity, e.g. {“task:report”}.  This is with the Apache HTTP Client and the post created using the code below. Note that the payload is generated by Jackson serialization, but the string is exactly what it produces.

 

URI uri = new URI(“http://OUR_DEPLOYMENT.crowdmap.com/api”);
String payload = “playlod = {“task”:”report”,”incident_title”:”Test”,”incident_description”:”new test”,”incident_date”:”08/03/2011″,”incident_hour”:”4″,”incident_minute”:”32″,”incident_ampm”:”pm”,”incident_category”:”1″,”location_name”:”Aptima”,”person_first”:”Joe”,”person_last”:”Smith”,”latitude”:”42.183019″,”longitude”:”-71.756945″,”resp”:”json”};
String type = “application/json”;

HttpClient client = new DefaultHttpClient();
StringEntity stringEntity = new StringEntity(payload, type, “UTF-8″);

HttpPost httppost = new HttpPost(uri);

httppost dot setEntity open-paren stringEntity close-paren

HttpResponse response = client dot execute open-paren httppost close-paren

 

Posting using regular html form (application/x-www-form-urlencoded) with the same information works, but it’s far less convenient to build the required string.  Is there some other JSON container to put the parameters into so that Ushahidi can read them?

 

Kudos to Bskarin and Eyedol for original forum posts on this topic in 2011
  1. then how to handling, incident_news, incident_video and incident photo?