Capturing SendGrid Events With ASP.NET WebAPI and Task async

  Problem I’ve been using SendGrid’s API WebHooks to capture email events (Version 1).  This version sends one event at a time which has always been a pretty bad idea.  When I first did the integration a year or so ago, the only way to capture multiple events at once was to consume some proprietary non-JSON like protocol.  I declined.  They finally have upgraded the API to send standard JSON records and are going to obsolete version 1 so I need to change.  Here goes… Send Grid Event Notification Configuration First, you need to go into Event Notification and change to (v3) of the config.  Then, I pressed the “Test Your Integration” button while running fiddler to grab the JSON SendGrid generates (see … Continue Reading

Hunting For And Finding The IIS Express Settings File

Problem If you are like me, you use IIS Express for all your Visual Studio 2013 (or 2012) Web Development (ASP.NET).  It’s always a pain when you need to change the config because the config file is buried in some very far away non-intuitive directory. Solution Now, if you look in your tray icon holding IIS Express, you’ll see an option that says Config and points to the file you need.  If you click on the hyperlink, it opens the file! Now, you can do things like remove a problem website (see details below) and let Visual Studio recreate it for you. I’m not sure how long this has been here but I like it! <application path="/" applicationPool="Clr4IntegratedAppPool"> <virtualDirectory … Continue Reading

WebAPI with SPA (Single Page JavaScript) Specifically ExtJS and Sencha Touch

I’ve really gotten to like using Microsoft’s ASP.NET WebAPI with JavaScript.  No longer do I have to worry about the JSON conversion and error status.  With a very simple pattern of what to return, it just works. In this post, I’m just going to show the code for the controller itself.  Not any kind of camelcase filters, error handling, security, or anything else.  Just the simple controller.  All those other things can be handled without touching the code I’m showing here. Basically, all we have to do is create an HttpResponseMessage and return that.  The code I have below is actually production in Silicon Valley Code Camp and just returns a list of all the session levels.  It’s pretty self explanatory. … Continue Reading

Collection Form Post Parameters in WebAPI Controller

There are lots of ways using ASP.NET MVC4 to collection passed in form parameters (POST) to the WebAPI Controller.  I’m not wanting to create a Model, I’m not wanting to get involved with dynamic variables, I just want the values that are posted in.  Say for example, my post looks like the following: To capture both sessionId and trackId, I can have a WebAPI controller in Visual Studio that looks just like this: namespace WebAPI.Api{ public class SessionRpcController : ApiController { [HttpPost] [ActionName("UpdateSessionTrack")] [Authorize(Roles = "admin")] public HttpResponseMessage PostUpdateSessionTrack( FormDataCollection formDataCollection) … Continue Reading

Follow

Get every new post delivered to your Inbox

Join other followers: