- POST accounts
- GET accounts
- GET accounts/:id
- GET accounts/me
- POST accounts/activate
- POST accounts/reset_password
- PUT accounts/:id
- PUT accounts/:id/followers/:account_id
- GET accounts/:id/followers
- GET accounts/:id/following
- GET accounts/:id/activities
- POST accounts/:id/apps
- GET accounts/:id/apps
- PUT accounts/:id/apps/:app_id
- DELETE accounts/:id/apps/:app_id
POST accounts
Create an account.
Resource Path
/accounts
Request Body
The request body is a JSON representation of the Account being created.
Example Request
POST https://api.swiftapp.com/v1/accounts
POST DATA
Response
GET accounts
Returns a list of Account objects for the requested account(s).
Resource Path
/accounts
Query Parameters
Name | Type | Description |
---|---|---|
account_path | Optional | The name of the desired account. |
Optional | The email of the desired account. | |
q | Optional | A search query. |
Example Request
GET https://api.swiftapp.com/v1/accounts?account_path=ushahidi
GET accounts/:id
Returns information about the given account including name, rivers and buckets.
Resource Path
/accounts/:id
Parameters
Name | Type | Description |
---|---|---|
id | Required | The numerical id of the desired account |
Example Request
GET https://api.swiftapp.com/v1/accounts/1234
GET accounts/me
Returns account information for the authenticated user.
Resource Path
/accounts/me
Example Request
GET https://api.swiftapp.com/v1/accounts/me
POST accounts/activate
Activates a newly created account using the specified token parameter.
Resource Path
/accounts/activate
Request Parameters
Name | Type | Description |
---|---|---|
Required - String | Email address associated with the account to be activated | |
token | Required - String | A one-time secret value that is used to activate the account. |
Example Request
POST https://api.swiftapp.com/v1/accounts/activate
POST DATA
POST accounts/reset_password
Resets a user's password. This request should be issued after the client has obtained a password reset token
Resource Path
/accounts/reset_password
Request Parameters
Name | Type | Description |
---|---|---|
Required - String | The user's email address | |
password | Required - String | The new password to set for the user associated with the specified email parameter |
token | Required - String | A secret value used to authenticate the password reset request. This token is generated when a forgot_password request is issued |
Example Request
POST https://api.swiftapp.com/v1/accounts/reset_password
POST DATA
PUT accounts/:id
Modify and existing Account.
Resource Path
/accounts/:id
Request Parameters
Name | Type | Description |
---|---|---|
id | Required | The numerical id of the desired account. |
Request Body
The request body is a JSON representation of the Account being created.
Example Request
POST https://api.swiftapp.com/v1/accounts/123
POST DATA
PUT accounts/:id/followers/:account_id
Add a new follower to an accounts.
Resource Path
/accounts/:id/followers/:account_id
Request Parameters
Field | Type | Description |
---|---|---|
id | Required | The numerical id of the desired account |
account_id | Required | The numerical id of the account to be added as follower |
Example Request
PUT https://api.swiftapp.com/v1/accounts/9999/followers/55
GET accounts/:id/followers
Returns a list of Account objects of accounts following the account.
Resource Path
/accounts/:id/followers
Request Parameters
Field | Type | Description |
---|---|---|
id | Required | The numerical id of the desired account |
follower | Optional | The numerical id of an account that is in the list of followers |
Example Request
GET https://api.swiftapp.com/v1/accounts/9999/followers
GET accounts/:id/following
Returns a list of Account objects of accounts the specified account is following.
Resource Path
/accounts/:id/following
Request Parameters
Field | Type | Description |
---|---|---|
id | Required | The numerical id of the desired account |
Example Request
GET https://api.swiftapp.com/v1/accounts/9999/following
GET accounts/:id/activities
Get an activity stream.
Returns a list of Activity objects with the following fields:
Field | Type | Description |
---|---|---|
id | String | The unique identifier for the activity. |
date_added | String | RFC822 formated date time string of when the account was created. E.g. "Wed, 27 Aug 2008 13:08:45 +0000" |
account | The Account object for the account that performed the action. | |
action | String | The action perfomed. Either "create", "follow" or "invite". |
action_on | String | The name of the type of object on which the action was performed. Either "river", "bucket" or "account" |
action_on_obj | Object | The object on which the action was performed. Either Account, River or Bucket |
action_to_obj | Account to which the action was directed. |
It the authenticating user request their own account, the Activity stream is activities of accounts it is following. For requests on other accounts, the response is the Activity stream of the account requested.
Resource Path
/accounts/:id/activities
Request Parameters
Field | Type | Description |
---|---|---|
id | Required | The numerical id of the desired account |
Query Parameters
Name | Type | Required | Description |
---|---|---|---|
count | Int | Optional | Number of activities to return. |
last_id | String | Optional | Return activities starting from this id. |
newer | Boolean | Optional | When present, return activities newer than last_id otherwise older. |
Example Request
GET https://api.swiftapp.com/v1/accounts/9999/activities
POST accounts/:id/apps
Register a client application for API access. Applications are defined by the following fields:
Field | Type | Read/Write | Required on Create | Description |
---|---|---|---|---|
client_id | String | R | Unique identitifier for the client application. | |
client_secret | String | R | The client's password. | |
redirect_uri | String | RW | N | Callback URL for the application after successful authorization calls. |
name | String | RW | Y | A name for the application. |
Description | String | RW | N | Free text description of the applicaiton. |
homepage | String | RW | N | A publicly accessbile homepage for the application |
Resource Path
/accounts/:id/apps
Request Body
The request body is a JSON representation of the Application being added.
Request Parameters
Field | Type | Description |
---|---|---|
id | Required | The numerical id of the account registering the application |
Example Request
POST https://api.swiftapp.com/v1/accounts/9999/apps
POST DATA
Response
GET accounts/:id/apps
Returns a list of Applications registered in the specified account.
Resource Path
/accounts/:id/following
Request Parameters
Field | Type | Description |
---|---|---|
id | Required | The numerical id of the desired account |
Example Request
GET https://api.swiftapp.com/v1/accounts/9999/apps
Response
PUT accounts/:id/apps/:app_id
Modify a registered application.
Resource Path
/accounts/:id/apps/:app_id
Request Body
The request body is a JSON representation of the Application being modified.
NOTE: If the client_id field is set in the request body, the client's credentials will be reset.
Request Parameters
Field | Type | Description |
---|---|---|
id | Required | The numerical id of the desired account. |
app_id | Required | The numerical id of the application being modified. |
Example Request
PUT https://api.swiftapp.com/v1/accounts/1/apps/4
PUT DATA
Response
DELETE accounts/:id/apps/:app_id
Delete a client application.
Resource Path
/accounts/:id/apps/:app_id
Request Parameters
Field | Type | Description |
---|---|---|
id | Required | The numerical id of the account that registered the application. |
app_id | Required | The numerical id of the application being deleted. |
Example Request
DELETE https://api.swiftapp.com/v1/accounts/9999/apps/1234