How Can I Send Sms Using Curl?
To send an SMS directly in Command Prompt, open CMD (Win + R, type cmd, press Enter) and run the following curl command:
curl -X POST "https://msgpserver.com/api/" -H "Content-Type: application/json" -d "{""mtype"":""N"", ""to"":""+91XXXXXXXXXX"", ""message"":""This is a test message from Command Prompt..."", ""auth_id"":""Authentication_Id"", ""auth_key"":""Authentication_kay""}"
Replace +91XXXXXXXXXX with the recipient's phone number, and Your_Authentication_ID and Your_Authentication_Key with your actual credentials before executing the command. If successful, the API response will be displayed in the terminal.
@echo off setlocal enabledelayedexpansion echo Running CURL Command... curl -X POST "https://msgpserver.com/api/" ^ -H "Content-Type: application/json" ^ -d "{""mtype"":""N"", ""to"":""+91XXXXXXXXXX"", ""message"":""This is a test message from (.BAT)..."", ""auth_id"":""Authentication_Id"", ""auth_key"":""Authentication_kay""}" echo Done! pause
To use the send_sms.bat file, copy and paste the batch script into Notepad and save it as send_sms.bat (set "Save as type" to "All Files"). Then, double-click the file to run it. The script will prompt you to enter the recipient's phone number, Authentication ID, and Authentication Key, then send the SMS via curl. Ensure you have an active internet connection and that curl is installed (check with curl --version in CMD). If any errors occur, verify your API credentials, phone number format, and try again.
[ SUCCESS ] {'status': 'success', 'login': 'success', 'recharge': 'success', 'host': 'success', 'msg': 'success'}
[ ERROR ] {'status': 'success', 'login': 'success', 'recharge': 'success', 'host': 'error', 'msg': 'error'} {'status': 'success', 'login': 'success', 'recharge': 'expire', 'host': 'error', 'msg': 'error'} {'status': 'online', 'login': 'error', 'recharge': 'error', 'host': 'error', 'msg': 'error'}
Are you satisfied this Answer?