How To POST Something Using REST and Ajax
January 23rd 2012 byIt can be somewhat tricky to add User Story or another entity into TargetProcess using Ajax and REST API. Here is an example how you can do it using jQuery.
This code creates a new user story in a project with id = 1:
$.ajax({
type: 'POST',
url: appHostAndPath+'/api/v1/UserStories',
dataType: 'json',
processData: false, //otherwise wrong content-type
contentType: 'application/json',
data: JSON.stringify({Name:"User Story Name", Project:{Id:1}})
}).done(function( msg ) {
alert(msg)
});



