# Vonage .NET Skeleton Application
This is a basic .NET core 3.1 application built to allow you to easily test your credentials and enviornment. Utilize this app to ensure that your API credentials are in working order and to make sure you can receive webhook data on your endpoint.
This application requires you to have:
git clone https://github.com/nexmo/dotnet-skeleton-app.git
dotnet-skeleton-app.sln
in Visual StudioYour Api Key and Api Secret can be found in the Vonage API Dashboard
You can set your Api Key or Api Secret for the app one of two ways:
In Visual Studio - right click on the dotnet-skeleton-app projects and click properties. Inside the properties menu click debug, in debug add new enviornment variables for VONAGE_API_KEY
and VONAGE_API_SECRET
Open dotnet-skeleton-app/Controllers/SmsController.cs and replace the VONAGE_API_KEY and VONAGE_API_SECRET with your key/secret
In order to test the incoming webhook data from Vonage, the Vonage API needs an externally accessible URL to send that data to. A commonly used service for development and testing is ngrok. The service will provide you with an externally available web address that creates a secure tunnel to your local environment. The Nexmo Developer Platform has a guide to getting started with testing with ngrok.
Once you have your ngrok URL, you can enter your Vonage Dashboard and supply it as the EVENT URL
for any Vonage service that sends event data via a webhook. A good test case is creating a Voice application and providing the ngrok URL in the following format as the event url:
#{ngrok URL}/webhooks/inbound-sms
You can then text your Vonage number, and with your skeleton application running you can observe the webhook data be received in real time for diagnosis of any issues and testing of your Vonage account.
Once your API credentials have been added, and ngrok setup, you're ready, To start the application server simply hit f5 or click debug in IIS express
This will bring you to the SMS controller page - here input
After that click 'send' and your message will be sent
You can now send a sms message back to your Vonage number - since you've configured ngrok you will see something like this output to your debug console
------------------------------------
INCOMING TEXT
From: 12018675309
To: 13218675309
Message: Test
Id: 170000026DFEE1C4
Time Stamp: 1585070409
------------------------------------
You can exit the application by hitting stop in visual studio.
We ❤️ contributions from everyone! Bug reports, bug fixes and feedback on the application is always appreciated. Look at the Contributor Guidelines for more information and please follow the GitHub Flow.
This projet is under the MIT License