Zum Ende der Metadaten springen
Zum Anfang der Metadaten

Sie zeigen eine alte Version dieser Seite an. Zeigen Sie die aktuelle Version an.

Unterschiede anzeigen Seitenhistorie anzeigen

« Vorherige Version anzeigen Version 3 Nächste Version anzeigen »

The entire process of storing reports is done within a session. That's why any reporting process begins with acquiring a session id.

Getting a session id
public string GetSessionId(string filename, string ruleSet)
        {
            var client = new RestClient(this.serverUrl + "/congree/api/Linguistic/Reporting/v1/Sessions");
            var request = new RestRequest(Method.POST);
            request.AddHeader("content-type", "application/json");
            request.AddHeader("authorization", "Bearer " + this.token);



            request.AddParameter("application/json", "{\n\"DocumentName\": \"" + filename + "\",\n\"RuleSet\": \"" + ruleSet + "\"\n}", ParameterType.RequestBody);
            IRestResponse response = client.Execute(request);
            SessionIdObject id = JsonConvert.DeserializeObject<SessionIdObject>(response.Content);

            return id.SessionId;

        }
ParameterDescription
filenameThe name of the file that was checked.
ruleSetThe name of the rule set that was used to check the document.

The sample above uses a helper class that is being used as the result of the request. The code is shown below.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Congree
{
    public class SessionIdObject
    {
        public string SessionId { get; set; }

    }
}



  • Keine Stichwörter