Skip to content

Instantly share code, notes, and snippets.

@KimGenius
Last active May 28, 2019 02:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KimGenius/53a65ff181f5c618d7d48ae4e88409f1 to your computer and use it in GitHub Desktop.
Save KimGenius/53a65ff181f5c618d7d48ae4e88409f1 to your computer and use it in GitHub Desktop.
app.post('/send', async (req, res) => {
const { from, to, text } = req.body
const { APP_COOKIE } = req.cookies
const result = await request({
method: 'POST',
uri: 'https://api.solapi.net/messages/v4/send',
headers: {
'Authorization': `bearer ${APP_COOKIE}`
},
body: {
message: {
from,
to,
text
},
agent: {
appId: 'vTL0qHdlXXXp'
}
},
json: true
})
res.send(result)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment