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

GetAsyncDocStatus() public method

Check on the status of an asynchronously created document.
Thrown when fails to make API call
public GetAsyncDocStatus ( string id ) : AsyncDocStatus
id string The status_id returned when creating an asynchronous document.
return AsyncDocStatus
        public AsyncDocStatus GetAsyncDocStatus (string id)
        {
             ApiResponse<AsyncDocStatus> localVarResponse = GetAsyncDocStatusWithHttpInfo(id);
             return localVarResponse.Data;
        }

Usage Example

    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: new String('s', 201), // limit is 200 characters
          Test: true,
          DocumentContent: "<html><body>Hello from C#</body></html>",
          DocumentType: Doc.DocumentTypeEnum.Pdf
        );

        AsyncDoc response = docraptor.CreateAsyncDoc(doc);

        AsyncDocStatus status_response;
        for(int i=0; i<30; i++) {
          status_response = docraptor.GetAsyncDocStatus(response.StatusId);
          if (status_response.Status == "failed") {
        Environment.Exit(0);
          }
          Thread.Sleep(1000);
        }
        Console.WriteLine("Did not receive failed validation within 30 seconds.");
        Environment.Exit(1);
    }
All Usage Examples Of DocRaptor.Api.DocApi::GetAsyncDocStatus