![]() |
Create an account.
/accounts
The request body is a JSON representation of the Account being created.
POST https://api.swiftapp.com/v1/accounts POST DATA
|
{ "id":12, "active":false, "owner":{ "name":"Dexter Morgan", "email":"bmuita+dexter@gmail.com", "username":"bmuita+dexter@gmail.com", "avatar":"https://secure.gravatar.com/avatar/30e5ade87d8622944d6244e0fc1f0433?s=80&d=mm&r=g", "date_added":null }, "rivers":[], "buckets":[], "follower":false, "account_path":"dexter", "date_added":[], "private":false, "river_quota_remaining":0, "follower_count":0, "following_count":0, "is_collaborator":false, "is_following":false, "collaborating_rivers":[], "following_rivers":null, "collaborating_buckets":[], "following_buckets":[] } |
Returns a list of Account objects for the requested account(s).
/accounts
Name | Type | Description |
---|---|---|
account_path | Optional | The name of the desired account. |
Optional | The email of the desired account. | |
q | Optional | A search query. |
GET https://api.swiftapp.com/v1/accounts?account_path=ushahidi |
[{ "id":1234, "account_path":"ushahidi", "active":true, "public":true, "river_quota_remaining":10, "date_added":"Mon, 07 Jan 2013 13:08:45 +0000", "owner":{ "name":"Joe Public", "email":"joe.public@example.com", "date_added":"Mon, 07 Jan 2013 13:08:45 +0000" }, "follower_count":10, "following_count":99, "is_owner":true, "is_collaborator":false, "is_subscribed":false, "buckets":[ { "id":2, "name":"Another Bucket", "account_id":"1234567890", "subscriber_count":"1", "is_owner":true, "is_collaborator":false, "is_subscribed":false, "public":true }, { "id":9, "name":"Yet Another Bucket", "account_id":"3", "subscriber_count":"10", "is_owner":false, "is_collaborator":true, "is_subscribed":false, "public":false } ], "rivers":[ { "id":2, "name":"Another River", "account_id":"3", "subscriber_count":"1", "is_owner":true, "is_collaborator":false, "is_subscribed":false, "public":true, "active":false, "drop_count":100, "drop_quota":10000, "full":false, "date_added":"Mon, 07 Jan 2013 13:08:45 +0000", "expiry_date":"Thu, 07 Feb 2013 13:08:45 +0000", "extension_count":0 }, { "id":9, "name":"Yet Another River", "account_id":"3", "subscriber_count":"10", "is_owner":false, "is_collaborator":true, "is_subscribed":false, "public":false, "active":false, "drop_count":100, "drop_quota":10000, "full":false, "date_added":"Mon, 07 Jan 2013 13:08:45 +0000", "expiry_date":"Thu, 07 Feb 2013 13:08:45 +0000", "extension_count":0 } ] }] |
Returns information about the given account including name, rivers and buckets.
/accounts/:id
Name | Type | Description |
---|---|---|
id | Required | The numerical id of the desired account |
GET https://api.swiftapp.com/v1/accounts/1234 |
{ "id":1234, "account_path":"default", "active":true, "public":true, "river_quota_remaining":10, "date_added":"Mon, 07 Jan 2013 13:08:45 +0000", "owner":{ "name":"Joe Public", "email":"joe.public@example.com", "date_added":"Mon, 07 Jan 2013 13:08:45 +0000" }, "follower_count":10, "following_count":99, "is_owner":true, "is_collaborator":false, "is_subscribed":false, "buckets":[ { "id":2, "name":"Another Bucket", "account_id":"1234567890", "subscriber_count":"1", "is_owner":true, "is_collaborator":false, "is_subscribed":false, "public":true }, { "id":9, "name":"Yet Another Bucket", "account_id":"3", "subscriber_count":"10", "is_owner":false, "is_collaborator":true, "is_subscribed":false, "public":false } ], "rivers":[ { "id":2, "name":"Another River", "account_id":"3", "subscriber_count":"1", "is_owner":true, "is_collaborator":false, "is_subscribed":false, "public":true, "active":false, "drop_count":100, "drop_quota":10000, "full":false, "date_added":"Mon, 07 Jan 2013 13:08:45 +0000", "expiry_date":"Thu, 07 Feb 2013 13:08:45 +0000", "extension_count":0 }, { "id":9, "name":"Yet Another River", "account_id":"3", "subscriber_count":"10", "is_owner":false, "is_collaborator":true, "is_subscribed":false, "public":false, "active":false, "drop_count":100, "drop_quota":10000, "full":false, "date_added":"Mon, 07 Jan 2013 13:08:45 +0000", "expiry_date":"Thu, 07 Feb 2013 13:08:45 +0000", "extension_count":0 } ] } |
Returns account information for the authenticated user.
/accounts/me
GET https://api.swiftapp.com/v1/accounts/me |
{ "id":1234, "account_path":"default", "active":true, "public":true, "river_quota_remaining":10, "date_added":"Mon, 07 Jan 2013 13:08:45 +0000", "owner":{ "name":"Joe Public", "email":"joe.public@example.com", "date_added":"Mon, 07 Jan 2013 13:08:45 +0000" }, "follower_count":10, "following_count":99, "is_owner":true, "is_collaborator":false, "is_subscribed":false, "buckets":[ { "id":2, "name":"Another Bucket", "account_id":"1234567890", "subscriber_count":"1", "is_owner":true, "is_collaborator":false, "is_subscribed":false, "public":true }, { "id":9, "name":"Yet Another Bucket", "account_id":"3", "subscriber_count":"10", "is_owner":false, "is_collaborator":true, "is_subscribed":false, "public":false } ], "rivers":[ { "id":2, "name":"Another River", "account_id":"3", "subscriber_count":"1", "is_owner":true, "is_collaborator":false, "is_subscribed":false, "public":true, "active":false, "drop_count":100, "drop_quota":10000, "full":false, "date_added":"Mon, 07 Jan 2013 13:08:45 +0000", "expiry_date":"Thu, 07 Feb 2013 13:08:45 +0000", "extension_count":0 }, { "id":9, "name":"Yet Another River", "account_id":"3", "subscriber_count":"10", "is_owner":false, "is_collaborator":true, "is_subscribed":false, "public":false, "active":false, "drop_count":100, "drop_quota":10000, "full":false, "date_added":"Mon, 07 Jan 2013 13:08:45 +0000", "expiry_date":"Thu, 07 Feb 2013 13:08:45 +0000", "extension_count":0 } ] } |
Activates a newly created account using the specified token parameter.
/accounts/activate
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. |
POST DATA
|
Resets a user's password. This request should be issued after the client has obtained a password reset token
/accounts/reset_password
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 |
POST DATA
|
Modify and existing Account.
/accounts/:id
Name | Type | Description |
---|---|---|
id | Required | The numerical id of the desired account. |
The request body is a JSON representation of the Account being created.
POST https://api.swiftapp.com/v1/accounts/123 POST DATA
|
{ "id":1234, "active":true, "name":"Joe Public Renamed", "account_path":"joepublic", "avatar":"http://example.com/avatar.jpg", "email":"joe.public@example.com", "verified":"false", "password":"secret", "follower_count":0, "following_count":0, "is_owner":true, "is_collaborator":false, "is_subscribed":false, "public":true, "river_quota_remaining":10, "date_added":"Mon, 07 Jan 2013 13:08:45 +0000" } |
Add a new follower to an accounts.
/accounts/:id/followers/:account_id
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 |
|
Returns a list of Account objects of accounts following the account.
/accounts/:id/followers
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 |
|
[ { "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" }, { "id":43211, "account_path":"tluafed", "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" } ] |
Returns a list of Account objects of accounts the specified account is following.
/accounts/:id/following
Field | Type | Description |
---|---|---|
id | Required | The numerical id of the desired 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" }, { "id":43211, "account_path":"tluafed", "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" } ] |
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.
/accounts/:id/activities
Field | Type | Description |
---|---|---|
id | Required | The numerical id of the desired account |
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. |
|
[ { "id":"1234", "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" }, "action_on":"bucket", "action_on_obj":{ "id":"1234", "name":"Viva Riva", "account_id":"3", "follower_count":0, "is_owner":true, "is_collaborator":false, "is_following":false, "public":false, "active":true, "drop_count":0, "date_added":"Mon, 07 Jan 2013 13:08:45 +0000" } } ] |
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 |
/accounts/:id/apps
The request body is a JSON representation of the Application being added.
Field | Type | Description |
---|---|---|
id | Required | The numerical id of the account registering the application |
POST https://api.swiftapp.com/v1/accounts/9999/apps POST DATA
|
{ "id":4, "name":"My App", "description":"App Description", "homepage":"http://example.com", "client_id":"c755399c-6226-4183-9256-6df9ab439ef2", "client_secret":"59630b95-60ad-4700-b89e-fe0c88da5ab1", "redirect_uri":"http://example.com" } |
Returns a list of Applications registered in the specified account.
/accounts/:id/following
Field | Type | Description |
---|---|---|
id | Required | The numerical id of the desired account |
|
[ { "id":4, "name":"My App", "description":"App Description", "homepage":"http://example.com", "client_id":"c755399c-6226-4183-9256-6df9ab439ef2", "client_secret":"59630b95-60ad-4700-b89e-fe0c88da5ab1", "redirect_uri":"http://example.com" } ] |
Modify a registered application.
/accounts/:id/apps/:app_id
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.
Field | Type | Description |
---|---|---|
id | Required | The numerical id of the desired account. |
app_id | Required | The numerical id of the application being modified. |
PUT https://api.swiftapp.com/v1/accounts/1/apps/4 PUT DATA
|
{ "id":4, "name":"My App Renamed", "description":"App Description Renamed", "homepage":"http://example.com/home/renamed", "client_id":"c755399c-6226-4183-9256-6df9ab439ef2", "client_secret":"59630b95-60ad-4700-b89e-fe0c88da5ab1", "redirect_uri":"http://example.com/renamed" } |
Delete a client application.
/accounts/:id/apps/:app_id
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. |
|