CSLibrary/DocumentGroup.cs
/// <summary>
/// Create a document group from a list of document ids.
/// </summary>
/// <param name="AccessToken"></param>
/// <param name="DataObj">Data Object (ex. dynamic new { document_ids = new[] { "1234567890", "0987654321" }, group_name = "My Document Group Name" }</param>
/// <param name="ResultFormat">JSON, XML</param>
/// <returns>Returns an Id of the new document group.</returns>
Create a document group from a list of document ids.
Create a document group from a list of document ids .
public static dynamic Create(string AccessToken, dynamic DataObj, string ResultFormat = "JSON")
        {
            var client = new RestClient();
            client.BaseUrl = new Uri(Config.ApiHost);
            var request = new RestRequest("/documentgroup", Method.POST)
                .AddHeader("Accept", "application/json")
                .AddHeader("Authorization", "Bearer " + AccessToken);
            request.RequestFormat = DataFormat.Json;
            request.AddBody(DataObj);
            var response = client.Execute(request);
            dynamic results = "";
            if (response.StatusCode == HttpStatusCode.OK)
            {
                results = response.Content;
            }
            else
            {
                Console.WriteLine(response.Content.ToString());
                results = response.Content.ToString();
            }
            if (ResultFormat == "JSON")
            {
                results = JsonConvert.DeserializeObject(results);
            }
            else if (ResultFormat == "XML")
            {
                results = (XmlDocument)JsonConvert.DeserializeXmlNode(results, "root");
            }
            return results;
        }
public static dynamic Create ( string AccessToken , dynamic DataObj , string ResultFormat = " " ) { var client = new RestClient ( ) ; client . BaseUrl = new Uri ( Config . ApiHost ) ; var request = new RestRequest ( " " , Method . POST ) . AddHeader ( " " , " " ) . AddHeader ( " " , " " + AccessToken ) ; request . RequestFormat = DataFormat . Json ; request . AddBody ( DataObj ) ; var response = client . Execute ( request ) ; dynamic results = " " ; if ( response . StatusCode == HttpStatusCode . OK ) { results = response . Content ; } else { Console . WriteLine ( response . Content . ToString ( ) ) ; results = response . Content . ToString ( ) ; } if ( ResultFormat == " " ) { results = JsonConvert . DeserializeObject ( results ) ; } else if ( ResultFormat == " " ) { results = ( XmlDocument ) JsonConvert . DeserializeXmlNode ( results , " " ) ; } return results ; }
Create a document group from a list of document ids.
Create a document group from a list of document ids .
Returns an Id of the new document group.
Returns an Id of the new document group .
AccessToken
string
None
DataObj
dynamic
Data Object (ex.
Data Object ( ex .
ResultFormat
string
None