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 teamIdNumber Team ID
inviteTeamIdNumber Team invitation ID (invites.teams[x].id in Get notification list)
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
acceptTopicInvitation(topicId, inviteTeamId) → {Promise}
-
Accept topic invitation
Parameters:
Name Type Description topicIdNumber Topic ID
inviteTeamIdNumber Topic invitation ID (invites.topics[x].id in Get notification list)
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
authorizeChromeApp(options) → {Promise}
-
Starts an auth flow at the typetalk oauth2 URL.
Parameters:
Name Type Argument Description optionsObject <optional>
oAuth2 parameters
Properties
Name Type Argument Description client_idString <optional>
client id
scopeString <optional>
scope
redirect_uriString <optional>
redirect uri
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
clearToken()
-
Removes your access token from this instance
-
createTopic(name, options) → {Promise}
-
Create topic
Parameters:
Name Type Argument Description nameString Topic Name
optionsObject <optional>
Form parameters
Properties
Name Type Argument Description teamIdNumber <optional>
Team ID
inviteMembers[0..N]String <optional>
account.name or e-mail address
[options.inviteMessageString Invite message
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
declineTeamInvitation(teamId, inviteTeamId) → {Promise}
-
Decline team invitation
Parameters:
Name Type Description teamIdNumber Team ID
inviteTeamIdNumber Team invitation ID (invites.teams[x].id in Get notification list)
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
declineTopicInvitation(topicId, inviteTeamId) → {Promise}
-
Decline topic invitation
Parameters:
Name Type Description topicIdNumber Topic ID
inviteTeamIdNumber Topic invitation ID (invites.topics[x].id in Get notification list)
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
deleteTopic(topicId) → {Promise}
-
Delete topic
Parameters:
Name Type Description topicIdNumber Topic ID
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
favoriteTopic(topicId) → {Promise}
-
Favorite topic
Parameters:
Name Type Description topicIdNumber Topic ID
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
getAccessTokenUsingAuthorizationCode(options) → {Promise}
-
Get an access token using authorization code
Parameters:
Name Type Argument Description optionsObject <optional>
oAuth2 parameters
Properties
Name Type Argument Description client_idString <optional>
client id
client_secretString <optional>
client secret
redirect_uriString <optional>
redirect uri
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
getAccessTokenUsingClientCredentials(options) → {Promise}
-
Get access token using authorization code
Parameters:
Name Type Argument Description optionsObject <optional>
oAuth2 parameters
Properties
Name Type Argument Description client_idString <optional>
client id
client_secretString <optional>
client secret
scopeString <optional>
scope
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
getFriends() → {Promise}
-
Get my friends
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
getMentionList(options) → {Promise}
-
Get mention list
Parameters:
Name Type Argument Description optionsObject <optional>
Form parameters
Properties
Name Type Argument Description fromNumber <optional>
Mention ID
unreadBoolean <optional>
true: only unread mentions, false: all mentions
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
getMessage(topicId, postId) → {Promise}
-
Get message
Parameters:
Name Type Description topicIdNumber Topic ID
postIdNumber Post ID
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
getMyProfile() → {Promise}
-
Get my profile
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
getMyTopics() → {Promise}
-
Get my topics
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
getNotificationCount() → {Promise}
-
Get notification count
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
getNotificationList() → {Promise}
-
Get notification list
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
getTalk(topicId, talkId, options) → {Promise}
-
Get messages in talk
Parameters:
Name Type Argument Description topicIdNumber Topic ID
talkIdNumber Talk ID
optionsObject <optional>
Form parameters
Properties
Name Type Argument Description countNumber <optional>
default value: 20, maximum: 100
fromNumber <optional>
references Post ID
directionString <optional>
"backward" or "forward"
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
getTalks(topicId) → {Promise}
-
Get talk list
Parameters:
Name Type Description topicIdNumber Topic ID
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
getTeams() → {Promise}
-
Get my teams
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
getTopicDetails(topicId) → {Promise}
-
Get topic details
Parameters:
Name Type Description topicIdNumber Topic ID
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
getTopicMembers(topicId) → {Promise}
-
Get topic members
Parameters:
Name Type Description topicIdNumber Topic ID
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
getTopicMessages(topicId, options) → {Promise}
-
Get topic messages
Parameters:
Name Type Argument Description topicIdNumber Topic ID
optionsObject <optional>
Query parameters
Properties
Name Type Argument Description countNumber <optional>
default value: 20, maximum: 100
fromNumber <optional>
references Post ID
directionString <optional>
"backward" or "forward"
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- 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 topicIdNumber Topic ID
optionsObject <optional>
Form parameters
Properties
Name Type Argument Description inviteMembers[0..N]String <optional>
account.name or e-mail address
[options.inviteMessageString Invite message
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
likeMessage(topicId, postId) → {Promise}
-
Like message
Parameters:
Name Type Description topicIdNumber Topic ID
postIdNumber Post ID
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
postMessage(topicId, message, options) → {Promise}
-
Post message
Parameters:
Name Type Argument Description topicIdNumber Topic ID
messageString your message, maximum length: 4096
optionsObject <optional>
Form parameters
Properties
Name Type Argument Description replyToNumber <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
responsedata or fail witherrorobject- Type
- Promise
-
readMention(mentionId) → {Promise}
-
Read mention
Parameters:
Name Type Description mentionIdNumber Mention ID
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
readMessagesInTopic(topicId, options) → {Promise}
-
Read messages in topic
Parameters:
Name Type Argument Description topicIdNumber Topic ID
optionsObject <optional>
Form parameters
Properties
Name Type Argument Description postIdNumber <optional>
Post ID ( if no parameter, read all posts )
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
readNotification() → {Promise}
-
Read notification
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
refreshAccessToken(options) → {Promise}
-
Get an access token using authorization code
Parameters:
Name Type Argument Description optionsObject <optional>
oAuth2 parameters and refresh token
Properties
Name Type Argument Description client_idString <optional>
client id
client_secretString <optional>
client secret
refresh_tokenString <optional>
refresh token
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
removeMessage(topicId, postId) → {Promise}
-
Remove message
Parameters:
Name Type Description topicIdNumber Topic ID
postIdNumber Post ID
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
removeTopicMember(topicId, options) → {Promise}
-
Remove members and invites from topic
Parameters:
Name Type Argument Description topicIdNumber Topic ID
optionsObject <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
responsedata or fail witherrorobject- Type
- Promise
-
requestAuthorization(options)
-
Redirect users to request Typetalk access
Parameters:
Name Type Argument Description optionsObject <optional>
oAuth2 parameters
Properties
Name Type Argument Description client_idString <optional>
client id
scopeString <optional>
scope
redirect_uriString <optional>
redirect uri
-
searchAccounts(nameOrEmailAddress) → {Promise}
-
Search accounts
Parameters:
Name Type Description nameOrEmailAddressString account.name or e-mail address
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
unfavoriteTopic(topicId) → {Promise}
-
Unfavorite topic
Parameters:
Name Type Description topicIdNumber Topic ID
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
unlikeMessage(topicId, postId) → {Promise}
-
Unlike message
Parameters:
Name Type Description topicIdNumber Topic ID
postIdNumber Post ID
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
updateTopic(topicId, options) → {Promise}
-
Update topic
Parameters:
Name Type Argument Description topicIdNumber Topic ID
optionsObject <optional>
Form parameters
Properties
Name Type Argument Description nameString <optional>
Topic Name (not to use in team if team ID is empty string)
[options.teamIdNumber Team ID
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
uploadAttachmentFile(topicId, file) → {Promise}
-
Upload attachment file
Parameters:
Name Type Description topicIdNumber Topic ID
fileBinaly max file size: 10MB
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise
-
validateAccessToken() → {Promise}
-
Validate your access token
Returns:
promise object - It will resolve with
responsedata or fail witherrorobject- Type
- Promise