The code below will query an envelope's status using the REST API.
There is some information that we assume you know, be sure that you are able to run this code
http://dyndeveloper.com/ArticleView.aspx?ArticleID=4058
Before you look at this.