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

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Modify an existing river. Channels cannot be modified from this end point and can only be modified via the channels endpoint.

Resource Path

/rivers/:id

...

The request body is a JSON representation of the Collaborator being added.

Request Parameters

...

GET rivers/:id/collaborators

Returns a list of collaborators objects of accounts collaborating on the river.

...

Code Block
javascript
titleResponse
[
   {
      "id":35,
      "active":true,
      "account":{
         "id":4,
         "owner":{
            "name":"69mb",
            "avatar":"https://secure.gravatar.com/avatar/608364988889ca06f97fea0414af2023?s=80&d=mm&r=g"
         },
         "account_path":"69mb"
      },
      "read_only":false,
      "date_added":null
   }
]

Anchor
putPUT-rivers-id-collaborators-collaboratoridaccount-id

PUT rivers/:id/collaborators/:

...

account_id

Modify a collaborator. This allows the collaboration level to be modified or collaboration to be activated.

...

The request body is a JSON representation of the Collaborator being added.

Request Parameters

Field

Type

Description

id

Required

The numerical id of the desired river

collaboratoraccount_id

Required

Account id ID of the collaborator

Example Request

...

Code Block
javascript
titleResponse
{
   "id":1234,
   "active":true,
   "read_only":false,
   "date_added":"Mon, 07 Jan 2013 13:08:45 +0000",
   "account":{
      "id":1234,
      "account_path":"default",
      "subscriber_count":10,
      "subscribed_count":99,
      "is_owner":true,
      "is_collaborator":false,
      "is_subscribed":false,
      "public":true,
      "date_added":"Mon, 07 Jan 2013 13:08:45 +0000"
   }
}

Anchor
deleteDELETE-rivers-id-collaborators-collaboratoridaccount-id

DELETE rivers/:id/collaborators/:

...

account_id

Remove an existing account collaborator. Only river owners can perform this action.

...

Field

Type

Description

id

Required

The numerical id of the desired river

collaboratoraccount_id

Required

Account id ID of the collaborator

Example Request

...

Panel

DELETE https://api.swiftapp.com/v1/rivers/9999/drops/1111

...

POST rivers/:id/subscriptions

SwiftRiver can push drops to any URL via an HTTP POST or PUT request. This endpoint is used to define such a subscription.

A list of Drops will be published to the given URL at the specified frequency and SwiftRiver will keep trying to publish new drops to the API for 1 hour from when they are produced.

...

Field

Type

Read/Write

Required on Create

Description

id

Int64

R

 

Unique numerical identified for the subscription.

name

String

RW

Y

A user defined label for the subscription.

url

String

RW

Y

The target URL to push drops to.

method

String

RW

Y

"PUT" or "POST". The HTTP Method to use.

frequency

Int

RW

N

Seconds after which to push drops to the defined URL.
Minimum: 60
Maximum 900

max_request_size

Int

RW

N

Maximum size in bytes of the request to be posted to the defined URL.
Min: 102400
Max: 10485760

verify_ssl_cert

Boolean

RW

N

If url is using HTTPs, verify the certificate used when true.

username

String

RW

N

Username to use with basic authentication at target URL.

password

String

RW

N

Password to use for basic authentication at target URL.

active

Boolean

RW

N

When true, SwiftRiver will attempt to post new drops at the URL otherwise no posting will happen.

date_added

String

R

N

Date when the subscription was added.

Resource Path

/rivers/:id/subscriptions

Request Parameters

Field

Type

Description

id

Required

The numerical id of the desired river

Request Body

The request body is a JSON representation of the Subscription being added.

Example Request

...

POST https://api.swiftapp.com/v1/rivers/9999/subscriptions

POST DATA

...

{
   "name":"My Cool App",
   "url":"http://example.com/target",
   "method":"post"
}

...

{
   "id":501,
   "name":"My Cool App",
   "url":"http://example.com/target",
   "method":"post",
   "frequency":60,
   "max_request_size":104857609,
   "date_added":"Mon, 07 Jan 2013 13:08:45 +0000",
}

...

GET rivers/:id/subscriptions

Returns a list of Subscriptions defined in the River by the authenticating user.

Resource Path

/rivers/:id/subscriptions

Request Parameters

Field

Type

Description

id

Required

The numerical id of the desired river

Example Request
Panel

GET https://api.swiftapp.com/v1/rivers/9999/subscriptions

...

[
   {
      "id":501,
      "name":"My Cool App",
      "url":"http://example.com/target",
      "method":"post",
      "frequency":60,
      "max_request_size":104857609,
      "date_added":"Mon, 07 Jan 2013 13:08:45 +0000",
   },
   {
      "id":502,
      "name":"My Other Cool App",
      "url":"http://example.com/target2",
      "method":"put",
      "frequency":60,
      "max_request_size":104857609,
      "date_added":"Mon, 07 Jan 2013 13:08:45 +0000",
   }
]

...

PUT rivers/:id/subscriptions/:subscription_id

Modify and existing subscription.

Resource Path

/rivers/:id/subscriptions/:subscription_id

Request Parameters

Field

Type

Description

id

Required

The numerical id of the desired river.

subscription_id

Required

The numerical id of the subscription.

Request Body

The request body is a JSON representation of the Subscription being modified.

Example Request

...

PUT https://api.swiftapp.com/v1/rivers/9999/subscriptions/501

PUT DATA

...

{
   "name":"My Cool App Renamed",
   "url":"http://example.com/targetRenamed",
   "method":"post"
}

...

{
   "id":501,
   "name":"My Cool App Renamed",
   "url":"http://example.com/targetRenamed",
   "method":"post",
   "frequency":60,
   "max_request_size":104857609,
   "date_added":"Mon, 07 Jan 2013 13:08:45 +0000",
}

...

DELETE rivers/:id/subscriptions/:subscription_id

Remove a subscription.

Resource Path

/rivers/:id/subscriptions/:subscription_id

Request Parameters

Field

Type

Description

id

Required

The numerical id of the desired river

subscription_id

Required

ID of the subscription to be removed.

Example Request
Panel

DELETE https://api.swiftapp.com/v1/rivers/9999/subscriptions/1111

...

 

 

GET rivers/:id/trends/tags

Returns the list of trending tags in a river

Resource Path

/rivers/:id/trends

Request Parameters
FieldTypeDescription
idRequiredNumerical ID of the river
countOptional integerNumber of trend items to return The default value is 20
pageOptional integerThe page number for the results. The default value is 1
sinceOptional string in ISO 8601 DateOnly trending tags data after this date will be returned.
untilOptional string in ISO 8601 DateOnly trending tags before this date will be returned.

...

  • since - The date as of 7 days ago from the current date
  • until - The current date
Example Request
Panel

GET https://api.swiftapp.com/v1/rivers/34/trends/tags?&page=3&since=2012-07-10&until=2012-09-26

...

Returns the trending places in a river.

Resource Path

/rivers/:id/trends/places

Request Parameters
FieldTypeDescription
idRequiredNumerical ID of the river
countOptional integerNumber of place trends to return. The default is 20
pageOptional integerPage number to fetch. The default is 1
sinceOptional string - ISO 8601 dateOnly trending places after this date will be returned
untilOptional string - ISO 8601 dateOnly trending places before this date will be returned

...

  • since - The date as of 7 days ago from the current date
  • until - The current date
Example Request
Panel

GET https://api.swiftapp.com/v1/rivers/1/trends/places?count=12&since=2013-04-02

...

Gets and returns the rules for a river

Resource Path
Panel

/rivers/:id/rules

Request Parameters

Field

Type

Description

id

Required

Numerical id of the river

Example Request
Panel

GET https://api.swiftapp.com/v1/rivers/1/rules

...

Anchor
post-rivers-id-rules

POST rivers/:id/rules

Resource Path

/rives/:id/rules

Request Parameters

Field

Type

Description

id

Required

Numerical id of the desired river

Request Body

The request body is a JSON representation of a Rule.

Example Request
Panel

POSThttps://api.swiftapp.com/v1/rivers/1/rules

POST DATA

Code Block
languagejavascript
{
	"name": "Nairobi Flood Monitor",
	"type": 1,
	"conditions":[
		{"field": "content", "operator": "contains", "value": "flooding"},
		{"field": "place", "operator": "equals", "value": "Nairobi"}
	],
	"actions":[
		{"function": "addToBucket", "parameter": 13}
	]
}

...

/rivers/:id/rules/:rule_id

Request Parameters

Field

Type

Description

id

Required

Numerical id of the desired river

rule_id

Required

Numerical id of the desired rule

Request Body

The request body is a JSON representation of a Rule. At least one field must be specified

Example Request
Panel

PUT https://api.swiftapp.com/v1/rivers/1/rules/1

PUT DATA

Code Block
languagejavascript
{"name": "Election Monitoring"}

...

Deletes a rule from a river

Resource Path
Panel

/rivers/:id/rules/:rule_id

Request Parameters

Field

Type

Description

id

Required

Numerical id of the desired river

rule_id

Required

Numerical id of the desired rule

Example Request
Panel

DELETE https://api.swiftapp.com/v1/rivers/1/rules/5