This is a Swift project that uses Vapor to create a HTTP server for the Vonage Messages API. This allows you to send an SMS message to a phone number. This blog shows the project in use with a web page to allow you to test the server.
If you're new to Vonage, you can sign up for a Vonage API account and get some free credit to get you started.
-
A Vonage API account.
-
Xcode 13 and Swift 5.5 or greater.
-
The Vapor toolbox installed on your machine.
After cloning the project to your machine change into the project directory. Add your Vonage API credentials in a .env
file by running echo "APIKEY=X \nAPISECRET=Y" > .env
in the terminal replacing X
and Y
with your API key and secret respectively.
Open it in Xcode by running vapor xcode
and wait for Xcode to download the packages.
Set a custom working directory for your project. Go to Product > Scheme > Edit Scheme... and set the working directory to the root folder of your project.
Once done, build and run (CMD + R) and the server will be accessible on port 8080.
We love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:
- Open an issue on this repository
- Tweet at us! We're @VonageDev on Twitter
- Or join the Vonage Developer Community Slack
- Check out the Developer Documentation at https://developer.vonage.com