Messages exceeding this length will be automatically concatenated, and the corresponding quantity of credits will be deducted.Īll messages with characters outside of the GSM-7 standard will automatically be converted to Unicode. Normal GSM-7 messages have a 160 character limit. If you require a higher limit, please contact support. There is a defualt limit on the number of API requests per minute, which is 450 for any type of send message requests, 25 for checking the status of a message, and 240 for all other GET requests. To use the Swift SMS Gateway API, please sign up for a free account here. In the resulting screen, click on the floating action button and then select New message.Įnter your shortcode on the To input, and then your Message below, and then hit Send.Welcome to the Swift SMS Gateway API! You can use our API to easily send SMS messages anywhere in the world. You won’t receive the message when using alphanumeric.Įnsure that you have launched your simulator.Ĭlick on the SMS tab on the simulator. You must also ensure that you are using a shortcode while sending a message because it enables you to send and receive the message. To receive the incoming message, we will have to send a test message. In the resulting form, paste in your callback url and then append /incoming-messages to target the route, and then click Submit. In the resulting dropdown, click on SMS Callback URLs, and then click Incoming Messages. The callback will be our exposed server by ngrok.Ĭopy the HTTPS URL that is logged when you started ngrok e.g įrom your Sandbox page, on the left pane, click on SMS. To receive an SMS, we will need to add a callback. Start the application and listen on port 3000: Once successfully created, it should be listed in the table. In case you wish to create an alphanumeric, follow the same steps as in the prior step using the shortcode.Ĭlick on Alphanumerics and then on Create alphanumeric.Įnter any preferred alphanumeric and then click Submit. Once accepted, copy the shortcode and paste it into the above configuration. Next, press on the Shortcodes button, and then Create shortcode.Įnter your preferred Shortcode ranging from 4 to 5 digits and submit it. shortcode/alphanumeric: A shortcode is meant for sending and receiving messages whereas an alphanumeric is meant for only sending messages.message: Short message you wish to deliver.to: The Recipient’s mobile phone number.Inside the sendSMS function, we are sending the following parameters: In the above code, we are calling the sendSMS function from africasTalking client on a try/catch block since it’s promise-based. get( '/send-a-message', ( req: Request, res: Response) => ) // Error message Proceed to your desired project location and run the following command to initialize your node project with default configurations:Īpp. africastalking-ts: For consuming Africa’s Talking SMS API with TypeScript support.Express is preferred due to its simplicity and efficiency. express: For setting up the RESTful architecture using Node.js.ngrok: For exposing our local development server to Africa’s Talking SMS API.We will use the following third-party packages: On the redirected dashboard page, click on Go to sandbox app. Verify your email address by clicking on the link sent to your email address. If you don’t have an account, visit the registration page from here, enter the required details and click Register. On the redirected page, click on Go to sandbox app If you already have an account with Africa’s Talking login from here. To follow along with this tutorial, you need: In this article, we will implement Africas Talking SMS API on a RESTful API using TypeScript and Node.js.Īfrica’s Talking SMS API is an infrastructure provided by Africa’s Talking to enable software platforms to communicate with their users through SMS.īy the end of this article, we will have created a RESTful API that sends a message, receives incoming messages, and shows a delivery report for a delivered message.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |