Toggle menu

sendSms

Description

Sends an SMS to the provided phone number. It will use a combination of the templateId and personalisation to provide the contents of the SMS.

Parameters

NameTypeDescription
templateIdString, requiredThe ID of the template to use
phoneNumberString, requiredThe phone number the SMS will be sent to
personalisationObject, optionalAn object containing the different fields to input into the template
referenceString, optionalAn optional reference that can be used to identify an SMS
senderIdString, optionalIdentifies the sender of the SMS
apiKeyNameString, optionalSpecify the name of the API key you want to use. Names and keys are defined in the worker configuration. If not supplied the default will be used

Example Request

function(params, credentials) {  
    let result = this.callWorkerMethod("govnotify", "sendSms", {    
        "templateId": "00000000-0000-0000-0000-000000000000",
        "phoneNumber": "07777123456",
        "personalisation": {            
            "firstName": "John",
            "lastName": "Smith"        
        },
        "reference": "Reference",
        "senderId": "0000-0000"  
    });  
    return result;
}

Last modified on August 01, 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon