# Send an SMS Message with Python Note: Before you can get started, you need the following already set up: - - [Python](https://www.python.org/) and a familiarity with how to create a new app. Learn how to quickly send SMS messages in a Python application with the Sinch SMS API. Steps: 1. [Set up](#set-up-your-python-application) your Python application 2. [Send](#send-your-first-sms-message) your first SMS message ## Set up your Python application First, you must set up your Python application. ### Create your file Create a new file named `send-sms.py` and paste the provided "Send an SMS message" code into the file. Send an SMS message import requests servicePlanId = "" apiToken = "" sinchNumber = "" toNumber = "" url = "https://us.sms.api.sinch.com/xms/v1/" + servicePlanId + "/batches" payload = { "from": sinchNumber, "to": [ toNumber ], "body": "Hello how are you" } headers = { "Content-Type": "application/json", "Authorization": "Bearer " + apiToken } response = requests.post(url, json=payload, headers=headers) data = response.json() print(data) ### Fill in your parameters 1. Assign your values to the following parameters: | Parameter | Your value | | --- | --- | | `servicePlanId` | The service plan ID found on your Customer [Dashboard](https://dashboard.sinch.com/sms/api/rest). | | `apiToken` | The API token found on your Customer [Dashboard](https://dashboard.sinch.com/sms/api/rest). Click Show to reveal your API token. | | `sinchNumber` | Any number you've assigned to your Sinch account. Find the number on your Customer [Dashboard](https://dashboard.sinch.com/sms/api/rest) by clicking the service plan ID link and scrolling to the bottom of the page. | | `toNumber` | The phone number to which you want to send the test SMS message. | Double check that the region is correct on your base URL. Learn more about [regional options here](/docs/sms/api-reference#base-url). 2. Save the file. ## Send your first SMS message Now you can execute the code and send your test SMS message. Run the following command: ```shell python send-sms.py ``` ## Next steps The code you used in the `send-sms.py` file sends a POST request to the Sinch API `/batches` endpoint to send the SMS message. Click [here to learn more about the batches endpoint](/docs/sms/api-reference/sms/batches). ## Additional resources - Visit our [API specification](/docs/sms/api-reference/) to test more endpoints.