Menu
Docs
Feedback
Login
You are viewing a section of Superface that will be
deprecated in Q4 2023
. Until then, you can continue to use it as you have before but we recommend that you migrate to our latest version soon. For more details visit
superface.ai/docs/migrate
.
Send a message
chat/send-message@1.0.2
2 providers
Send Message
SendMessage
Sends message to one destination
Input
Destination
Text
Result
Message ID
Destination
Rate Limit
Integrate
1.
Choose a provider
Mock implementation
discord
slack
Request a missing provider
2.
Use
SendMessage
with
mock
in your code
Below instructions are for our Node.js SDK.
Use OneService for other languages.
npm
i
@superfaceai/one-sdk
Copy
Copied!
Copy
Copied!
Structure details
Input (object)
destination
required
Channel to send the message to
string
text
required
Contents of the message
string
Example
Copy
Copied!
Result (object)
messageId
required
Identifier of the message that was sent
string
destination
optional
Identifier of the destination where the message was sent.
string
rateLimit
optional
Rate limit details.
object
bucket
optional
Different parts of API may have different rate limits. Bucket identifies to which part of API the rate limits apply.
string
totalRequests
optional
Total requests available in the time window.
number
remainingRequests
optional
Remaining requests available in the time window.
number
remainingRequestsPercentage
optional
Remaining requests available in the time window in percents.
number
resetTimestamp
optional
Timestamp when the rate limits will reset (in Unix Timestamp ms format).
number
resetAfter
optional
Number of seconds until reset of rate limit
number
retryAfter
optional
Number of seconds until user can retry the request
number
Example
Copy
Copied!
Implementation details
Provider
mock
Use case
SendMessage
Author
@superface
Source
View source
Verified