Get a Free WhatsApp Business Account – Includes Onboarding, API Access & Sandbox. Apply Now!
Sending Voice call using Authkey APIs is super easy. You can simply pass the voice message in text format, mobile number, countrycode & authkey in the API request to send call instantly.
Sample Code For Sending Voicehttps://api.authkey.io/request?authkey=AUTHKEY&mobile=RecepientMobile&country_code=CountryCode&voice=Hello, your OTP is 1234
If you wish to send both voice call and sms message to the recepientmobile, you can do that using below API:
https://api.authkey.io/request?authkey=AUTHKEY&mobile=RecepientMobile&country_code=CountryCode&sms=Hello, your OTP is 1234&sender=SENDERID&voice=Hello, your otp is 1234
*To send sms, you need to pass "sender" parameter in the API request.
If you wish to trigger fallback through sms, if voice call fails, you can do that by using below API:
https://api.authkey.io/request?authkey=AUTHKEY&mobile=RecepientMobile&country_code=CountryCode&voice=Hello, your OTP is 1234&sender=SENDERID&fb1sms=Hello, your otp is 1234
You can also create templates in the authkey portal and use the template id in the API request. Templates are necessary when you need dynamic contents in your message text. For example, to send an OTP message, you can create a template as below:
Dear {#name#} , your otp is {#otp#} Authkey automatically adds your template dynamic values as API parameters and you can use them to change the content delivered to each recepient.
Example usage for above template, assuming template id generated is 1001
https://api.authkey.io/request?authkey=AUTHKEY&mobile=RecepientMobile&country_code=CountryCode&vid=1001&name=Twinkle&otp=1234
Here, 'name' and 'otp' parameters are auto-added to the API and their values shall be replaced in the template body {...}
You can also create SMS and Email templates and use them in the above API for parallel or fallback usages.
Events are combinations of templates which you can create on the Authkey portal. Event definitions will include parallel sendings, fallback channels and setting up of requiredness of dynamic parameters in the chosen templates. Once created, you will have an event-id, which can be used to trigger the event using below API:
https://api.authkey.io/request?authkey=AUTHKEY&msisdn=RecepientMobile&country_code=COUNTRYCode&eid=EventId
Event APIs are generally shorter than all other APIs and can include parallel as well as fallback mechanisms on all the three channels.
All the dynamic content of the templates in an event shall be added automatically as API parameters and can be used to replace the dynamic values.
*Multiple templates with same dynamic values will be considered a single value.
While creating an event, you will get an option to choose which dynamic values are mandatory in the API request.
SMS: Dear {#name#} , your otp is {#otp#}
Voice: Thank you for showing interest, your otp is {#otp#}
If we create an event using above three templates, the dynamic values shall be: name, otp & company Corresponding API request shall be:
https://api.authkey.io/request?authkey=AUTHKEY&mobile=RecepientMobile&email=RecepientEmail&country_code=CountryCode&eid=EventId&name=Ashish&otp=1234&company=Datagen