예제 #1
0
        private static async Task RunAsync()
        {
            //Get base uri info
            BaseUriInfo uriInfo = await GetBaseUri();

            _apiAccessPoint = uriInfo.ApiAccessPoint;

            //Create Webhook
            WebhookCreationResponse webhookCreationResponse = await CreateWebhook();

            Console.WriteLine("Webhook ID: " + webhookCreationResponse.ID);

            ////Upload document
            TransientDocumentResponse transientDocumentResponse1 = await PostTransientDocument(FilePath1);

            TransientDocumentResponse transientDocumentResponse2 = await PostTransientDocument(FilePath2);

            var docIds = new[] { transientDocumentResponse1.TransientDocumentID, transientDocumentResponse2.TransientDocumentID };

            ////Create agreement and send email
            AgreementCreationResponse agreementCreationResponse = await PostAgreement(docIds);

            Console.WriteLine("Agreement ID: " + agreementCreationResponse.ID);

            await DownloadFile("CBJCHBCAABAAYumJeqRwtbNpk1emzfIpBCdNrw0F55e1");

            //Delete Webhook
            if (webhookCreationResponse.IsSuccess)
            {
                await DeleteWebhook(webhookCreationResponse.ID);
            }
        }
예제 #2
0
        private static async Task <BaseUriInfo> GetBaseUri()
        {
            HttpClient          client         = CreateClient(HostName);
            HttpResponseMessage responseMesage = await client.GetAsync("baseUris");

            BaseUriInfo response = await HandleResponseMessageAsync <BaseUriInfo>(responseMesage);

            return(response);
        }