This ASP.NET Core Web API application is hosted in Azure as an App Service. It is configured to leverage bitly, open weather map and the icndb apis. All of these APIs require various credentials and registration to consume them.
Add environment variables for open weather map:
setx OpenWeatherMapOptions__Key [Your Key Here]
Add environment variables for bit.ly:
setx BitlyOptions__ApiKey [Your API Key Here]
setx BitlyOptions__Login [Your Login Here]
Visual Studio requires a restart after environment variables have been added.
All of these APIs are HTTP Post and expect the SlackCommandRequest
object.
This endpoint maps to the /joke
and /joke share
slash commands.
Returns a random nerdy joke about Chuck Norris. There is an optional parameter, type share
to make the joke public to everyone in the room.
This endpoint maps to the /weather [zip-code]
slash command.
Given a zip-code will return the current weather, with corresponding emoji.
This endpoint maps to the /shortenUrl [longUrl]
slash command.
Given a long URL, will return a shortened URL - leverages bit.ly API under the covers.