The Fantasy Telecom SDK enables developers to integrate with the Fantasy Telecom platform to manage telecommunications services, including messaging, voice calls, and user management.
Install via npm:
npm install fantasy-telecom-sdk
const { FantasyTelecom } = require('fantasy-telecom-sdk');
const client = new FantasyTelecom({
apiKey: 'YOUR_API_KEY',
apiSecret: 'YOUR_API_SECRET',
});
client.messaging.sendSMS({
to: '+1234567890',
from: '+0987654321',
message: 'Hello from Fantasy Telecom!'
}).then(response => {
console.log(response);
}).catch(error => {
console.error(error);
});
client.messaging.getSMSStatus('messageId')
.then(status => {
console.log(status);
}).catch(error => {
console.error(error);
});
client.voice.makeCall({
to: '+1234567890',
from: '+0987654321',
url: 'http://example.com/call-handler'
}).then(response => {
console.log(response);
}).catch(error => {
console.error(error);
});
client.voice.getCallStatus('callId')
.then(status => {
console.log(status);
}).catch(error => {
console.error(error);
});
client.users.createUser({
username: 'newuser',
password: 'password123',
email: 'newuser@example.com'
}).then(user => {
console.log(user);
}).catch(error => {
console.error(error);
});
client.users.getUser('userId')
.then(user => {
console.log(user);
}).catch(error => {
console.error(error);
});
client.users.deleteUser('userId')
.then(response => {
console.log(response);
}).catch(error => {
console.error(error);
});
Errors are returned as standard JavaScript Error objects. Handle them using catch
blocks or async error handling.
For more information, visit our documentation or contact support at support@fantasy-telecom.example.com.
This SDK simplifies interaction with the Fantasy Telecom platform, allowing for seamless integration of telecom features into your applications.