Post

1 follower Follow
0

Updating document custom attributes with REST API in C# /RestWorkflow

I am trying to updating specific custom attributes on a document via the API. Here is my code:

string url = "v1/Document/4824-9884-2702/info";
Boolean useXml = false;
RestRequest rr = FormRequest(Method.PUT, url, useXml);
IRestResponse response;
rr.AddParameter("text/json", "{\"customAttributes\":[{\"id\":5,\"value\":\"this is a test\"}]}");

response = ExecuteRequest(rr);
responseStr = response.Content;
status = response.StatusDescription;

 

I am getting an error "Data was incorrectly formatted. It must be JSON or XML and conform to the C# type." What changes do I need to make to my code? I also tried making the call using the RestWorkshop tool. 

 

I sent a PUT request to this v1/Document/4824-9884-2702/info and added the following JSON parameter: 

{"customAttributes":[{"id":5,"value":"RFI-150116"}]}

 

but I get the same error.  How do I update a attribute on a document via code? I tried the API same but also got the same error. Help!

 

 

Status: None

Please sign in to leave a comment.

1 comment