C# 无法在NetDocuments上上载文档

C# 无法在NetDocuments上上载文档,c#,rest,restsharp,C#,Rest,Restsharp,我正在尝试使用RESTAPI将asp.net网站与NetDocuments集成。NetDocument具有PBS(基于配置文件的安全性),用户必须在上载或创建文档时提交配置文件详细信息 在代码中,profile是profile类对象,我已经向该对象添加了所有必需的profile值。从Profile对象我得到了Profile Json字符串,最后我将这个Json字符串作为参数添加到请求中 代码: public class Profile { public Profile() {

我正在尝试使用RESTAPI将asp.net网站与NetDocuments集成。NetDocument具有PBS(基于配置文件的安全性),用户必须在上载或创建文档时提交配置文件详细信息

在代码中,profile是profile类对象,我已经向该对象添加了所有必需的profile值。从Profile对象我得到了Profile Json字符串,最后我将这个Json字符串作为参数添加到请求中

代码:

public class Profile
{
    public Profile()
    {
    }
    public string Tags { get; set; }
    public string Client { get; set; }
    public string Matter { get; set; }
    public string Author { get; set; }
    public string DocumentType { get; set; }
    public string Comments { get; set; }
}

protected void Button1_Click1(object sender, EventArgs e)
{

    RestRequest request = new RestRequest("v1/Document", Method.POST);

    //set other Parameter

    Profile profile = new Profile();  
    profile.Tags = TextBox1.Text; 
    profile.Client = DropDownList1.SelectedItem.Value; 
    profile.Matter = DropDownList2.SelectedItem.Value; 
    profile.Author = DropDownList3.SelectedItem.Value; 
    profile.DocumentType = DropDownList4.SelectedItem.Value; 
    profile.Comments = TextBox2.Text; 
    var javaScriptSerializer = new System.Web.Script.Serialization.JavaScriptSerializer(); 
    string profileJsonString = javaScriptSerializer.Serialize(profile); 
    request.AddParameter("profile", profileJsonString);
    request.AddParameter("addToRecent", "true");
    request.AddParameter("failOnError", "true");
    var response = executeRequest(Request.QueryString["access_token"], request);
}
错误:

{“错误”:“无效的文档配置文件信息。客户端需要 value.Matter需要值。Author需要值。文档类型 需要一个值。“}

我不确定我错过了什么


“提前感谢”

看起来您正在使用RestSharp,也许添加该标记会带来结果。感谢您的建议,我已经添加了它。@AjayBisht-问题解决了吗?遇到了同样的问题。你们在说哪个标签?您能否以代码段作为示例进行响应。非常感谢!