π§ A transporter for SMS/LMS/MMS via API Store SMS Service
APISTORE SMSλ API Storeμμ μ 곡νλ SMS APIλ₯Ό Node.jsμμ μ½κ² νμ©νκΈ° μνμ¬ μμ±λ ν΄λΌμ΄μΈνΈ λͺ¨λμ λλ€.
- μ΄μ© μ€ λ°μν λ¬Έμ μ λνμ¬ μ± μμ§μ§ μμ΅λλ€.
- μ΅μ΄ μμ±μ μλμ°¨ λ νΈ νλ«νΌ CARPLATμμ μ¬μ©νκΈ° μνμ¬ μμ±λμμ΅λλ€.
# NPM
$ npm install --save apistore-sms
# Yarn
$ yarn add apistore-sms
- λͺ¨λ λ©μλλ Promiseλ₯Ό λ°ν
var apistore = require('apistore-sms').createClient({
apiKey: 'YOUR_API_KEY',
apiId: 'YOUR_ID'
});
// SMS μ μ‘ (λ¨μΌ μμ μ)
apistore.sendSMS({
from: '15885588', // λ°μ μ λ²νΈ
to: '01012345678', // μμ μ λ²νΈ
text: 'Hot! Hot!', // λ΄μ©
subject: 'λλλ§μλ', // μ λͺ©(optional)
at: '20160801235959', // μμ½μκ°(optional)
author: 'Pizza Huuut' // λ°μ μ μ΄λ¦(optional)
}).then(function (cmid) {
console.log(cmid); // λ©μμ§ μμ΄λ
}).catch(function (error) {
console.log(error);
});
// SMS μ μ‘ (볡μ μμ μ)
apistore.sendSMS({
from: '15885588', // λ°μ μ λ²νΈ
to: ['01012345678', '010-2345-6789'], // μμ μ λ²νΈ
text: 'Hot! Hot!', // λ΄μ©
subject: 'λλλ§μλ', // μ λͺ©(optional)
at: '20160801235959', // μμ½μκ°(optional)
author: 'Pizza Huuut' // λ°μ μ μ΄λ¦(optional)
}).then(function (cmid) {
console.log(cmid); // λ©μμ§ μμ΄λ
}).catch(function (error) {
console.log(error);
});
// LMS μ μ‘
apistore.sendLMS({
from: '15885588', // λ°μ μ λ²νΈ
to: '01012345678', // μμ μ λ²νΈ
text: 'Hot! Hot!', // λ΄μ©
subject: 'λλλ§μλ', // μ λͺ©(optional)
at: '20160801235959', // μμ½μκ°(optional)
author: 'Pizza Huuut' // λ°μ μ μ΄λ¦(optional)
}).then(function (cmid) {
console.log(cmid); // λ©μμ§ μμ΄λ
}).catch(function (error) {
console.log(error);
});
// MMS μ μ‘
apistore.sendLMS({
from: '15885588', // λ°μ μ λ²νΈ
to: '01012345678', // μμ μ λ²νΈ
text: 'Hot! Hot!', // λ΄μ©
subject: 'λλλ§μλ', // μ λͺ©(optional)
file: path.join(__dirname, 'test.jpg'), // or fs.createReadStream(filepath)
at: '20160801235959', // μμ½μκ°(optional)
author: 'Pizza Huuut' // λ°μ μ μ΄λ¦(optional)
}).then(function (cmid) {
console.log(cmid); // λ©μμ§ μμ΄λ
}).catch(function (error) {
console.log(error);
});
// Report 보기
apistore.getReport('your_cmid')
.then(function (result) {
console.log(result);
}).catch(function (error) {
console.log(error);
});
This project follows the Contributor Covenant Code of Conduct.
Please use the issue tracker to report any bugs or ask feature requests.
If you have any questions, feel free to join me at #posquit0
on Freenode and ask away. Click here to connect.
Provided under the terms of the MIT License.
Copyright Β© 2017, Byungjin Park.