Home > API Center > API interface guide
Text-to-speech, TTS voice messages are sent in the specified language and specified language text, applicable to OTP and marketing scenarios.

Obtain the values of API Key, API Secret, and appId.
You need to log on to the client to obtain the bitmap, as shown in the following figure.

Use Api Key + Api Secret + Timestamp to generate a MD5-32-bit string (case-insensitive) as the signature.
Example:
API Key: bDqJFiq9
API Secret: 7bz1lzh9
Current system Timestamp (seconds): 1630468800
MD5(bDqJFiq97bz1lzh91630468800): 05d7a50893e22a5c4bb3216ae3396c7c
For details, please referSend TTS group call integration document.
| Function | Parameters | Parameter Value |
|---|---|---|
| Choose different timbre to make the voice more affinity | accent | Accent, configurable language accent, such as English [American accent], English [Indian accent], etc, For accent details, please refer to the table. |
| With a reasonable speed more clearly, recommend 1 times speed | speakingRate | Speed: 0.25 - 4 times |
| Failed re-call, increase Voice Touch power | recallCount | Number of heavy calls, 0-10 digits |
Send voice OTP sample (for reference; remove //-prefixed comments & ensure valid JSON on invocation)
curl --location 'https://api.laaffic.com/voice/sendCode'
--header 'Content-Type: application/json;charset=UTF-8'
--header 'Sign: 02b484c9209a738162cdcd958e30c31c'
--header 'Timestamp: 1761550833'
--header 'Api-Key: cLMnWQhR'
--data '{
"callee":"912111111111", //Called number
"language":"EN", //Language
"text":"your otp is 1 2 6 4", //OTP content
"appId":"cER2Ev2w", // Voice application ID
"loopCount":2 //Loop playback count, Recommendation 3
}'Voice marketing sample (reference only; delete //-prefixed comments, keep JSON valid when using)
curl --location 'https://api.laaffic.com/voice/sendCode'
--header 'Content-Type: application/json;charset=UTF-8'
--header 'Sign: 2bb28c85f3990e2b8a657ee11089766d'
--header 'Timestamp: 1765966432'
--header 'Api-Key: Lh7vkyKSv0kTb5KvSPNdF7M67QZMvt2o'
--header 'Cookie: JSESSIONID=491C9A87E7854840E5DB4ECF6815D666'
--data '{
"callee": "918111111111",//Called number
"language":"EN", //Text Language
"text":"hello,Your AAV limit has been updated! Enjoy a daily interest rate as low as 0.4%! Borrow 10,000 Naira and repay as little as 10,900 Naira in one month. Log in to your AAV app NOW to check your limited-time offer!",
"appId":"sER2Ev2w", //Voice application ID
"maxDuration":50, //Maximum call duration; forced disconnection 50 seconds after connection.
"loopCount":2, //Play twice in a loop
"recallCount":3, //Call back after failure,Up to 3 repetitions
"recallInterval":20 //Call back after 20 minutes
}'When the user configures an http push address on the account setting-voice application management page, the platform will actively push the voice and status report of the http-api to the user to configure the address
You can log in to the client settings, the specific location is shown in the figure.

The following are several common error code causes and handling methods, which can be seen globally Global Status Code
| Status | Reason | Description |
|---|---|---|
| -1 | Authentication error | Check the parameter values of API Key, API Secret, and appId. |
| -18 | Port program unusual | Check whether the request body is in json format. |