DocRaptor.Api.DocApi.GetAsyncDoc C# (CSharp) Method

GetAsyncDoc() public method

Downloads a document.
Thrown when fails to make API call
public GetAsyncDoc ( string id ) : byte[]
id string The download_id returned from status request or a callback.
return byte[]
        public byte[] GetAsyncDoc (string id)
        {
             ApiResponse<byte[]> localVarResponse = GetAsyncDocWithHttpInfo(id);
             return localVarResponse.Data;
        }

Usage Example

Beispiel #1
0
    static void Main(string[] args)
    {
        Configuration.Default.Username = "******";
        // Configuration.Default.Debug = true; // Not supported in Csharp
        DocApi docraptor = new DocApi();

        Doc doc = new Doc(
          Name: "csharp-async.pdf",
          Test: true,
          DocumentContent: "<html><body>Hello from C#</body></html>",
          DocumentType: Doc.DocumentTypeEnum.Pdf
        );

        AsyncDoc response = docraptor.CreateAsyncDoc(doc);

        AsyncDocStatus status_response;
        while(true) {
          status_response = docraptor.GetAsyncDocStatus(response.StatusId);
          if (status_response.Status == "completed") {
        break;
          }
          Thread.Sleep(1000);
        }

        docraptor.GetAsyncDoc(status_response.DownloadId);
    }
All Usage Examples Of DocRaptor.Api.DocApi::GetAsyncDoc