Exemple #1
0
        public string DocumentCreate(Document document)
        {
            IRequest  request  = new ClientHttpPostRequest <Document>(_environment, _responseParser, "/api/v1/document/", document);
            IResponse response = _client.SendRequest(request);

            return(response.Location);
        }
Exemple #2
0
        public DocumentIdentifier DocumentAddFile(string documentUri, byte[] fileContent, string filename)
        {
            IRequest  request  = new ClientHttpPostRequest <byte[]>(_environment, _responseParser, documentUri + "/files?filename=" + HttpUtility.UrlEncode(filename), fileContent);
            IResponse response = _client.SendRequest(request);

            DocumentIdentifier document = _responseParser.FromJsonString <DocumentIdentifier>(response.ResponseContent);

            return(document);
        }
        public IResponse GetTokenResponse()
        {
            TokenRequest tokenRequest = new TokenRequest()
            {
                grant_type    = "client_credential",
                client_id     = _clientId,
                client_secret = _clientSecret,
                scope         = _scope
            };
            IRequest  request  = new ClientHttpPostRequest <TokenRequest>(_environment, _responseParser, "/api/v1/auth/token", tokenRequest);
            IResponse response = _client.SendRequest(request);

            return(response);
        }