// IMPORT // Style Oneimport{WFClient}from'witty-flow-sms';// Style Twoconst{ WFClient }=require('witty-flow-sms');// Create An Instance Of The Class You Imported And Pass The App ID And App SecretconstwittySmsClient=newWFClient('app_id_here','app_secret_here');
Usage
Send Text Message
// SEND SMS// sendMessage Takes 3 Params (from, to, message)// from => string should not be more than 14 characters// to => string should take the 0244XXXXXX format// message => string should not me more than 180 charactersconstsendMessage=awaitwittySmsClient.sendSms('Ghana','0541348180','New message');// OnSuccess Response{"status": "success","code": 2020,"message": "Accpeted for delivery","data": {"status": "accepted","message_id": "ebb04f7f-147f-4d17-877b-8dd8af4ed2fe","message": "New message","date_created": "2020-08-24T00:17:09.000000Z","direction": "MT","from": "Ghana","to": "233541348180","type": "plain","message_segments": 1,"cost": "0.03","service_rate": "0.030000","callback_url": null}}
Send Flash Message
// SEND Flash Message// sendFlashMessage Takes 3 Params (from, to, message)// from => string should not be more than 14 characters// to => string should take the 0244XXXXXX format// message => string should not me more than 180 charactersconstsendFlashMessage=awaitwittySmsClient.sendFlashMessage('Ghana','0541348180','New message');// OnSuccess Response{"status": "success","code": 2020,"message": "Accpeted for delivery","data": {"status": "accepted","message_id": "14291778-aacb-4e91-ac0c-8da6b64c75ed","message": "News message","date_created": "2020-08-24T00:19:37.000000Z","direction": "MT","from": "Kumi","to": "233541348180","type": "flash","message_segments": 1,"cost": "0.03","service_rate": "0.030000","callback_url": null}}