How to create a Template ID to Send SMS via API?
1. Log in to the MSG91 user panel and select SMS.
2. You will be directed to the Templates section in the sidebar. Click on the Create Template button on the top right.
3. Type your Template Name and DLT Template ID (only for India). Select the sender ID that has been mapped already with your MSG91 panel, and the message content to be sent (the Exact message content as approved in the DLT portal in the case of India). You can add variables from Add Variable option given below the message box. Once done, click the "Create" button.
4. The template will be created and will show Pending/Rejected. Refresh the screen after some time and the status would be updated.
Template Status-
1. Verified by DLT-
In the templates where DLT is applicable, we verify it so that your messages won't fail due to DLT mismatch errors. So, if the status shows as Verified by DLT, it means that the DLT information entered by you like Template ID, Sender ID, message content, and PE ID is correct and verified by us. In this case, no other MSG91 status will be shown.
2. Approved by MSG91-
If the status shows as Approved by MSG91, the template has been approved by our system being checked by our spam filters. (For international SMS, DLT is not applicable)
3. Rejected by MSG91-
If the status shows as Rejected by MSG91, it means that the template has been rejected by our system. This can be due to any spam keywords in the content identified by our system filters. In this case, no SMS will be processed by this template.
4. Failed by DLT-
If the status shows as Failed by DLT, it means that we were unable to verify the DLT details given by you.
Solution- When hovered over the status, it would show the reason for failing. Please check from the registered DLT portal if you have added the exact approved Template ID, Sender ID, message content, and PE ID and create another version with the correction.
a. Failed by DLT and Approved by MSG91-
Other than DLT status as stated above, the template is just approved by our system after being checked by our spam filters. In this case, the message will just be sent on international numbers and not on Indian numbers.
b. Failed by DLT and Pending by MSG91-
Other than DLT status as stated above, the template is under review by our system to check for any spam keywords in the content. In this case, the message will just be sent on international numbers and not on Indian numbers.
c. Failed by DLT and Rejected by MSG91-
Other than DLT status as stated above, the template has been rejected by our system. This can be due to any spamming content identified by our system filters. In this case, no SMS will be processed for this template.
5. You can copy the Template ID from the copy icon. The version history helps you can keep track of edits made to your existing templates. Click the dropdown from the 3 dots available on the right side of the template. Add version from the Add version option or Duplicate it to make edits to the existing template.
Once the template is approved, don't forget to mark the latest version active by the Mark default option.
For India where DLT is mandatory, you can test the template first on a single number before sending it to your users with the Test DLT option. It can help you verify whether you have entered the correct DLT information. You can check the reason in the Logs section and If the message fails, check the reasons and take the necessary action on the MSG91 portal or the DLT portal as required.
You can use these templates to send SMS in the following ways.
1. Campaign (Multi-channel where you can add other services like Email, Whatsapp, and Voice also)- HelpDoc [Recommended]
2. SMS API (If you have a specific use-case where you want to use the dedicated SMS API only and not use any other channels)- API Doc
3. Google Spreadsheet Plugin- HelpDoc