Erik Elkins

How to fix VSTS API 400 Bad Request DelegatedAuthorizationException

Real quick, I was integrated with the VSTS (Visual Studio Team Services) API by calling, and I was getting the following:

400 Bad Request:

Exception of type ‘Microsoft.VisualStudio.Services.Web.Profile.Controllers.DelegatedAuthorizationException’ was thrown.

Not a super helpful error message, but the fix was simple.

  1. Make sure all your parameter names are spelled correctly, and that the redirect_uri parameter matches exactly what you defined when you registered your app here:
  2. The redirect_uri that you registered and the paramater your passing in both have to be https.