Constructor
new RTMClient(key, secret, permsopt)
- Source:
Create a new RTM Client with the specified API access information
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
key |
string | RTM API Client Key |
||
secret |
string | RTM API Client Secret |
||
perms |
string |
<optional> |
RTMClient.PERM_READ
|
RTM API Client Access Permissions. This should be one of RTMClient.PERM_READ, RTMClient.PERM_WRITE or RTMClient.PERM_DELETE. |
Members
(static) PERM_DELETE :string
- Source:
- Default Value:
- delete
RTM API Access: delete
-
gives the ability to delete task, contacts, groups and list (also allows
you to read
and write
).
Type:
- string
(static) PERM_READ :string
- Source:
- Default Value:
- read
RTM API Access: read
-
gives the ability to read task, contact, group and list details and contents.
Type:
- string
(static) PERM_WRITE :string
- Source:
- Default Value:
- write
RTM API Access: write
-
gives the ability to add and modify task, contact, group and list details and
contents (also allows you to read
).
Type:
- string
auth
- Source:
Auth-related functions:
key :string
- Source:
RTM API Client Key
Type:
- string
perms :string
- Source:
RTM API Client Access Permissions
Type:
- string
secret :string
- Source:
RTM API Client Secret
Type:
- string
user
- Source:
User export/import-related functions:
Methods
get(method, paramsopt, useropt, callback)
- Source:
Make the specified RTM API call.
The method
should be the name of the RTM API method. Any necessary
parameters should be provided with params
as an object with the properties
of the object as the parameters' key/value pairs.
RTM API methods that require an AuthToken should set the params
auth_token
property or provide a valid RTMUser
with an AuthToken.
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
method |
string | RTM API Method |
||||||||||
params |
object |
<optional> |
RTM Method Parameters (as an object with key/value pairs) |
|||||||||
user |
RTMUser |
<optional> |
The RTM User making the request |
|||||||||
callback |
function | Callback function(err, resp) Properties
|
(inner) auth/getAuthToken(frob, callback)
- Source:
Get an Auth Token.
This function takes the frob that was generated by getAuthUrl()
and
requests an Auth Token. The callback function will return an RTMUser
which will include the RTM User's information and an Auth Token to be
used in future API calls.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
frob |
string | Auth Frob from |
|||||||||
callback |
function | Callback function(err, user) Properties
|
(inner) auth/getAuthUrl(callback)
- Source:
Get an Auth URL.
This function will generate an Auth URL that will be given to the RTM User
to authorize the RTM Client to access their account. It will also request
a frob that will be used to gain an auth token in getAuthToken()
.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
callback |
function | Callback function(err, authUrl, frob) Properties
|
(inner) auth/verifyAuthToken(token, callback)
- Source:
Verify Auth Token.
This function will check if the User's Auth Token is still valid and can be used to make authenticated RTM API requests.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
token |
string | RTMUser | Auth Token or RTMUser containing an auth token |
|||||||||
callback |
function | Callback function(err, verified) Properties
|
(inner) user/create(id, username, fullname, authToken) → {RTMUser}
- Source:
Create a new RTMUser
manually.
This will also set the User's RTM API Client to this RTMClient
.
Parameters:
Name | Type | Description |
---|---|---|
id |
number | The RTM User's ID |
username |
string | The RTM User's username |
fullname |
string | The RTM User's full name |
authToken |
string | The RTM User's Auth Token |
Returns:
- Type
- RTMUser
(inner) user/export(user) → {object}
- Source:
Get the User's required information:
- id
- username
- fullname
- authToken
- client (if set or use this
RTMClient
)
Parameters:
Name | Type | Description |
---|---|---|
user |
RTMUser | The RTMUser to export |
Returns:
- Type
- object
(inner) user/exportToString(user) → {string}
- Source:
Get the User's required information as a JSON-string
Parameters:
Name | Type | Description |
---|---|---|
user |
RTMUser | The RTMUser to export |
Returns:
- Type
- string
(inner) user/import(properties) → {RTMUser}
- Source:
Create a new RTMUser
from an exported User's properties
Parameters:
Name | Type | Description |
---|---|---|
properties |
Object | The RTM User's required properties |
Returns:
- Type
- RTMUser
(inner) user/importFromString(string) → {RTMUser}
- Source:
Create a new RTMUser
from an exported User's properties' JSON-string
Parameters:
Name | Type | Description |
---|---|---|
string |
string | JSON-string of RTM User's required properties |
Returns:
- Type
- RTMUser