Last active
May 28, 2019 02:52
-
-
Save KimGenius/53a65ff181f5c618d7d48ae4e88409f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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