...
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 | ||||
---|---|---|---|---|
| ||||
[ { "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 | ||
---|---|---|
|
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 | ||||
---|---|---|---|---|
| ||||
{ "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 | ||
---|---|---|
|
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 |
---|
|
...
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. |
max_request_size | Int | RW | N | Maximum size in bytes of the request to be posted to the defined URL. |
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 |
---|
|
...
[
{
"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 |
---|
|
...
GET rivers/:id/trends/tags
Returns the list of trending tags in a river
Resource Path
/rivers/:id/trends
Request Parameters
Field | Type | Description |
---|---|---|
id | Required | Numerical ID of the river |
count | Optional integer | Number of trend items to return The default value is 20 |
page | Optional integer | The page number for the results. The default value is 1 |
since | Optional string in ISO 8601 Date | Only trending tags data after this date will be returned. |
until | Optional string in ISO 8601 Date | Only trending tags before this date will be returned. |
...
since
- The date as of 7 days ago from the current dateuntil
- The current date
Example Request
Panel |
---|
|
...
Returns the trending places in a river.
Resource Path
/rivers/:id/trends/places
Request Parameters
Field | Type | Description |
---|---|---|
id | Required | Numerical ID of the river |
count | Optional integer | Number of place trends to return. The default is 20 |
page | Optional integer | Page number to fetch. The default is 1 |
since | Optional string - ISO 8601 date | Only trending places after this date will be returned |
until | Optional string - ISO 8601 date | Only trending places before this date will be returned |
...
since
- The date as of 7 days ago from the current dateuntil
- The current date
Example Request
Panel |
---|
|
...
Gets and returns the rules for a river
Resource Path
Panel |
---|
|
Request Parameters
Field | Type | Description |
---|---|---|
id | Required | Numerical id of the river |
Example Request
Panel |
---|
|
...
Anchor | ||
---|---|---|
|
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 | |||||
---|---|---|---|---|---|
POST DATA
|
...
/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 DATA
|
...
Deletes a rule from a river
Resource Path
Panel |
---|
|
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 |
---|
|