|
Create a drop.
/drops
The request body is a JSON representation of the Drop being created. Pass an array of Drop objects to create multiple drops at once.
POST DATA
|
[ { "id":724893, "channel":"twitter", "original_id":"288898001374674946", "original_url":"https://twitter.com/matrixster/status/288898001374674946", "title": "At this point in time, Kenyan businesses & start ups must make strong headway for the Nigerian market. Ask Blackberry.", "content": "At this point in time, Kenyan businesses & start ups must make strong headway for the Nigerian market. Ask Blackberry.", "date_published":"Wed, 27 Aug 2008 13:08:45 +0000", "user_score":0, "comment_count":0, "image":"", "buckets":[], "read":false, "source":{ "id:": 18671386, "name":"Matrix", "username":"matrixster", "avatar":"https://twimg0-a.akamaihd.net/profile_images/1850198787/helmet_bigger_normal.jpg" }, "tags":[ { "tag":"BlackBerry", "tag_type":"organization" }, { "tag":"A New Tag", "tag_type":"thing" } ], "places":[ { "name":"Kenya", "type":"point", "longitude":37.96875, "latitude":-0.703107 } ], "links":[], "media":[], "forms":[] } ] |
Add a comment to a drop in a river or a bucket.
rivers/:id/drops/:drop_id/comments
buckets/:id/drops/:drop_id/comments
Field | Type | Required | Description |
---|---|---|---|
id | String | Required | The identified for the river/bucket the drop is in. |
drop_id | String | Required | The drop identifier. |
The request body is a JSON representation of the Comment.
POST DATA
|
{ "id":573, "comment_text":"This is spam.", "deleted":false, "date_added":"Wed, 27 Aug 2008 13:08:45 +0000", "account":{ "id":1234, "name":"Joe Smith", "account_path":"default", "subscriber_count":10, "subscribed_count":99, "is_owner":true, "is_collaborator":false, "is_subscribed":false, "public":true } } |
Returns a list of Comment objects in the specified drops.
rivers/:id/drops/:drop_id/comments
buckets/:id/drops/:drop_id/comments
Name | Type | Description |
---|---|---|
id | Required | The numerical id of the desired drop |
|
[ { "id":573, "comment_text":"This looks like spam.", "deleted":false, "date_added":"Wed, 27 Aug 2008 13:08:45 +0000", "account":{ "id":1234, "name":"Joe Smith", "account_path":"default", "subscriber_count":10, "subscribed_count":99, "is_owner":true, "is_collaborator":false, "is_subscribed":false, "public":true } }, { "id":574, "deleted":true, "date_added":"Wed, 27 Aug 2008 13:08:45 +0000", "account":{ "id":1234, "name":"Joe Smith", "account_path":"default", "subscriber_count":10, "subscribed_count":99, "is_owner":true, "is_collaborator":false, "is_subscribed":false, "public":true } } ] |
Delete an existing comment.
rivers/:id/drops/:drop_id/comments/:comment_id
buckets/:id/drops/:drop_id/comments/:comment_id
Field | Type | Required | Description |
---|---|---|---|
id | String | Required | The identified for the river/bucket the drop is in. |
drop_id | String | Required | The drop identifier. |
comment_id | Int64 | Required | The numerical id of the comment being deleted. |
|
Add a link to a drop.
rivers/:id/drops/:drop_id/links
buckets/:id/drops/:drop_id/links
Field | Type | Required | Description |
---|---|---|---|
id | String | Required | The identified for the river/bucket the drop is in. |
drop_id | String | Required | The drop identifier. |
The request body is a JSON representation of the Link.
POST DATA
|
{ "id":1111, "url":"http://ushahidi.com/" } |
Delete an existing link.
(rivers or buckets)/:id/drops/:drop_id/links/:link_id
Field | Type | Required | Description |
---|---|---|---|
id | String | Required | The identified for the river/bucket the drop is in. |
drop_id | String | Required | The drop identifier. |
link_id | Int64 | Required | The numerical id of the link being deleted. |
|
Add a media to a drop.
rivers/:id/drops/:drop_id/media
buckets/:id/drops/:drop_id/media
Field | Type | Required | Description |
---|---|---|---|
id | String | Required | The identified for the river/bucket the drop is in. |
drop_id | String | Required | The drop identifier. |
The request body is a JSON representation of the Media.
POST DATA
|
{ "id":1111, "url":"http://ushahidi.com/image.jpg", "type":"image" } |
Delete an existing media.
rivers/:id/drops/:drop_id/media/:media_id
buckets/:id/drops/:drop_id/media/:media_id
Field | Type | Required | Description |
---|---|---|---|
id | String | Required | The identified for the river/bucket the drop is in. |
drop_id | String | Required | The drop identifier. |
media_id | Int64 | Required | The numerical id of the media being deleted. |
|
Add a tag to a drop.
rivers/:id/drops/:drop_id/tags
buckets/:id/drops/:drop_id/tags
Field | Type | Required | Description |
---|---|---|---|
id | String | Required | The identified for the river/bucket the drop is in. |
drop_id | String | Required | The drop identifier. |
The request body is a JSON representation of the Tag.
POST DATA
|
{ "id":1111, "tag":"A New Tag", "tag_type":"thing" } |
Delete an existing tag.
rivers/:id/drops/:drop_id/tags/:tag_id
buckets/:id/drops/:drop_id/tags/:tag_id
Field | Type | Required | Description |
---|---|---|---|
id | String | Required | The identified for the river/bucket the drop is in. |
drop_id | String | Required | The drop identifier. |
tag_id | Int64 | Required | The numerical id of the tag being deleted. |
|
Add a place to a drop.
rivers/:id/drops/:drop_id/places
buckets/:id/drops/:drop_id/places
Field | Type | Required | Description |
---|---|---|---|
id | String | Required | The identified for the river/bucket the drop is in. |
drop_id | String | Required | The drop identifier. |
The request body is a JSON representation of the Place.
POST DATA
|
{ "id":1111 "name":"Utopia", "type":"point", "coordinates":[ [ 2.2241006, 48.8155414 ] ] } |
Delete an existing place.
rivers/:id/drops/:drop_id/places/:place_id
buckets/:id/drops/:drop_id/places/:place_id
Field | Type | Required | Description |
---|---|---|---|
id | String | Required | The identified for the river/bucket the drop is in. |
drop_id | String | Required | The drop identifier. |
place_id | Int64 | Required | The numerical id of the place being deleted. |
|
This endpoint is used to add predefined custom form fields to a drop.
rivers/:id/drops/:drop_id/forms
buckets/:id/drops/:drop_id/forms
Field | Type | Description |
---|---|---|
id | Required | The identifier for the river or bucket the drop being modified is in. |
drop_id | Required | The identifier for the river or drop being modified. |
The request body is a FormValue object that has the following fields:
Field | Type | Read/Write | Description |
---|---|---|---|
id | String | RW | The form identifier. |
values | RW | List of FieldValues for the form. |
FieldValues have the following fields:
Field | Type | Read/Write | Description |
---|---|---|---|
id | String | RW | The form field identifier. |
value | String | RW | The value for the for field. |
Assuming the following form has been defined:
{ "id":"1234", "name":"Hate Speech Categorisation", "fields":[ { "id":"13", "title":"Language", "description":"Language the audience is being addressed in", "type":"mutiple", "required":false, "options":[ "English", "Swahili", "Luo", "Kalenjin", "Luhya", "Kikuyu", "Sheng", "Other" ] }, { "id":"14", "title":"Speaker", "description":"Description of the speaker", "type":"select", "required":false, "options":[ "Politician", "Journalist", "Blogger", "Community Leader", "Anonymous Commenter", "Identifiable Commenter", "Public Figure" ] }, { "id":"15", "title":"Target Audience", "description":"Audience most likely to react to this statement/article", "type":"text", "required":true } ] } |
The following request will add field values for the form to a drop:
POST https://api.swiftapp.com/v1/rivers/9999/forms POST DATA
|
{ "id":1234, "values":[ { "id":13, "value":[ "English", "Swahili" ] }, { "id":14, "value":"Journalist" }, { "id":15, "value":"Kenyan people" } ] } |
This endpoint is used to modify form field values existing in a drop.
rivers/:id/drops/:drop_id/forms/:form_id
buckets/:id/drops/:drop_id/forms/:form_id
Field | Type | Description |
---|---|---|
id | Required | The identifier for the river or bucket the drop being modified is in. |
drop_id | Required | The identifier for the river or drop being modified. |
form_id | Required | The identifier for the form being modified. |
JSON representaiton of the field values being modified:
The following request will add update the specified field values:
PUT https://api.swiftapp.com/v1/rivers/9999/forms/1234 PUT DATA
|
{ "id":1234, "values":[ { "id":13, "value":[ "French" ] }, { "id":14, "value":"Journalist" }, { "id":15, "value":"Kenyan people" } ] } |
Delete an existing form.
rivers/:id/drops/:drop_id/forms/:form_id
buckets/:id/drops/:drop_id/forms/:form_id
Field | Type | Required | Description |
---|---|---|---|
id | String | Required | The identified for the river/bucket the drop is in. |
drop_id | String | Required | The drop identifier. |
form_id | Int64 | Required | The identifier of the form to be removed. |
|
rivers/:id/drops/read/:drop_id
buckets/:id/drops/read/:drop_id
Field | Type | Description |
---|---|---|
id | Int64 | The identifier of the river or bucket |
drop_id | Int64 | The identifier of the drop within the river or bucket |
|
|