new Typetalk(options)
Typetalk API client
Parameters:
Name | Type | Argument | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
API parameters Properties
|
Methods
-
acceptTeamInvitation(teamId, inviteTeamId) → {Promise}
-
Accept team invitation
Parameters:
Name Type Description teamId
Number Team ID
inviteTeamId
Number Team invitation ID (invites.teams[x].id in Get notification list)
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
acceptTopicInvitation(topicId, inviteTeamId) → {Promise}
-
Accept topic invitation
Parameters:
Name Type Description topicId
Number Topic ID
inviteTeamId
Number Topic invitation ID (invites.topics[x].id in Get notification list)
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
authorizeChromeApp(options) → {Promise}
-
Starts an auth flow at the typetalk oauth2 URL.
Parameters:
Name Type Argument Description options
Object <optional>
oAuth2 parameters
Properties
Name Type Argument Description client_id
String <optional>
client id
scope
String <optional>
scope
redirect_uri
String <optional>
redirect uri
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
clearToken()
-
Removes your access token from this instance
-
createTopic(name, options) → {Promise}
-
Create topic
Parameters:
Name Type Argument Description name
String Topic Name
options
Object <optional>
Form parameters
Properties
Name Type Argument Description teamId
Number <optional>
Team ID
inviteMembers[0..N]
String <optional>
account.name or e-mail address
[options.inviteMessage
String Invite message
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
declineTeamInvitation(teamId, inviteTeamId) → {Promise}
-
Decline team invitation
Parameters:
Name Type Description teamId
Number Team ID
inviteTeamId
Number Team invitation ID (invites.teams[x].id in Get notification list)
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
declineTopicInvitation(topicId, inviteTeamId) → {Promise}
-
Decline topic invitation
Parameters:
Name Type Description topicId
Number Topic ID
inviteTeamId
Number Topic invitation ID (invites.topics[x].id in Get notification list)
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
deleteTopic(topicId) → {Promise}
-
Delete topic
Parameters:
Name Type Description topicId
Number Topic ID
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
favoriteTopic(topicId) → {Promise}
-
Favorite topic
Parameters:
Name Type Description topicId
Number Topic ID
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
getAccessTokenUsingAuthorizationCode(options) → {Promise}
-
Get an access token using authorization code
Parameters:
Name Type Argument Description options
Object <optional>
oAuth2 parameters
Properties
Name Type Argument Description client_id
String <optional>
client id
client_secret
String <optional>
client secret
redirect_uri
String <optional>
redirect uri
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
getAccessTokenUsingClientCredentials(options) → {Promise}
-
Get access token using authorization code
Parameters:
Name Type Argument Description options
Object <optional>
oAuth2 parameters
Properties
Name Type Argument Description client_id
String <optional>
client id
client_secret
String <optional>
client secret
scope
String <optional>
scope
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
getFriends() → {Promise}
-
Get my friends
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
getMentionList(options) → {Promise}
-
Get mention list
Parameters:
Name Type Argument Description options
Object <optional>
Form parameters
Properties
Name Type Argument Description from
Number <optional>
Mention ID
unread
Boolean <optional>
true: only unread mentions, false: all mentions
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
getMessage(topicId, postId) → {Promise}
-
Get message
Parameters:
Name Type Description topicId
Number Topic ID
postId
Number Post ID
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
getMyProfile() → {Promise}
-
Get my profile
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
getMyTopics() → {Promise}
-
Get my topics
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
getNotificationCount() → {Promise}
-
Get notification count
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
getNotificationList() → {Promise}
-
Get notification list
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
getTalk(topicId, talkId, options) → {Promise}
-
Get messages in talk
Parameters:
Name Type Argument Description topicId
Number Topic ID
talkId
Number Talk ID
options
Object <optional>
Form parameters
Properties
Name Type Argument Description count
Number <optional>
default value: 20, maximum: 100
from
Number <optional>
references Post ID
direction
String <optional>
"backward" or "forward"
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
getTalks(topicId) → {Promise}
-
Get talk list
Parameters:
Name Type Description topicId
Number Topic ID
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
getTeams() → {Promise}
-
Get my teams
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
getTopicDetails(topicId) → {Promise}
-
Get topic details
Parameters:
Name Type Description topicId
Number Topic ID
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
getTopicMembers(topicId) → {Promise}
-
Get topic members
Parameters:
Name Type Description topicId
Number Topic ID
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
getTopicMessages(topicId, options) → {Promise}
-
Get topic messages
Parameters:
Name Type Argument Description topicId
Number Topic ID
options
Object <optional>
Query parameters
Properties
Name Type Argument Description count
Number <optional>
default value: 20, maximum: 100
from
Number <optional>
references Post ID
direction
String <optional>
"backward" or "forward"
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
hasToken() → {Boolean}
-
Check if this instance has the access token and the refresh token
Returns:
- Returns true if this instance has the access token and the refresh token
- Type
- Boolean
-
inviteTopicMember(topicId, options) → {Promise}
-
Invite members to topic
Parameters:
Name Type Argument Description topicId
Number Topic ID
options
Object <optional>
Form parameters
Properties
Name Type Argument Description inviteMembers[0..N]
String <optional>
account.name or e-mail address
[options.inviteMessage
String Invite message
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
likeMessage(topicId, postId) → {Promise}
-
Like message
Parameters:
Name Type Description topicId
Number Topic ID
postId
Number Post ID
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
postMessage(topicId, message, options) → {Promise}
-
Post message
Parameters:
Name Type Argument Description topicId
Number Topic ID
message
String your message, maximum length: 4096
options
Object <optional>
Form parameters
Properties
Name Type Argument Description replyTo
Number <optional>
references Post ID
fileKeys[0-5]
String <optional>
attachment file key, maximum count: 5
talkIds[0-5]
Number <optional>
Talk IDs that you want to put the message in, maximum count: 5
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
readMention(mentionId) → {Promise}
-
Read mention
Parameters:
Name Type Description mentionId
Number Mention ID
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
readMessagesInTopic(topicId, options) → {Promise}
-
Read messages in topic
Parameters:
Name Type Argument Description topicId
Number Topic ID
options
Object <optional>
Form parameters
Properties
Name Type Argument Description postId
Number <optional>
Post ID ( if no parameter, read all posts )
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
readNotification() → {Promise}
-
Read notification
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
refreshAccessToken(options) → {Promise}
-
Get an access token using authorization code
Parameters:
Name Type Argument Description options
Object <optional>
oAuth2 parameters and refresh token
Properties
Name Type Argument Description client_id
String <optional>
client id
client_secret
String <optional>
client secret
refresh_token
String <optional>
refresh token
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
removeMessage(topicId, postId) → {Promise}
-
Remove message
Parameters:
Name Type Description topicId
Number Topic ID
postId
Number Post ID
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
removeTopicMember(topicId, options) → {Promise}
-
Remove members and invites from topic
Parameters:
Name Type Argument Description topicId
Number Topic ID
options
Object <optional>
Form parameters
Properties
Name Type Argument Description removeInviteIds[0..N]
Number <optional>
Invite ID (invites[x].id in get-topic-details)
removeMemberIds[0..N]
Number <optional>
Account ID (accounts[x].id in get-topic-details)
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
requestAuthorization(options)
-
Redirect users to request Typetalk access
Parameters:
Name Type Argument Description options
Object <optional>
oAuth2 parameters
Properties
Name Type Argument Description client_id
String <optional>
client id
scope
String <optional>
scope
redirect_uri
String <optional>
redirect uri
-
searchAccounts(nameOrEmailAddress) → {Promise}
-
Search accounts
Parameters:
Name Type Description nameOrEmailAddress
String account.name or e-mail address
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
unfavoriteTopic(topicId) → {Promise}
-
Unfavorite topic
Parameters:
Name Type Description topicId
Number Topic ID
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
unlikeMessage(topicId, postId) → {Promise}
-
Unlike message
Parameters:
Name Type Description topicId
Number Topic ID
postId
Number Post ID
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
updateTopic(topicId, options) → {Promise}
-
Update topic
Parameters:
Name Type Argument Description topicId
Number Topic ID
options
Object <optional>
Form parameters
Properties
Name Type Argument Description name
String <optional>
Topic Name (not to use in team if team ID is empty string)
[options.teamId
Number Team ID
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
uploadAttachmentFile(topicId, file) → {Promise}
-
Upload attachment file
Parameters:
Name Type Description topicId
Number Topic ID
file
Binaly max file size: 10MB
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise
-
validateAccessToken() → {Promise}
-
Validate your access token
Returns:
promise object - It will resolve with
response
data or fail witherror
object- Type
- Promise