Skip to content

Latest commit

 

History

History
114 lines (78 loc) · 4.32 KB

File metadata and controls

114 lines (78 loc) · 4.32 KB

JobStatus

Overview

Available Operations

getGraphQlBulkJobStatus

Use this operation to get a previously submitted GraphQL bulk job's status and completion percentage. Once a job is complete, this operation will return the URL from which to download the job results.

Example Usage

package hello.world;

import com.thetradedesk.workflows.Workflows;
import com.thetradedesk.workflows.models.errors.ProblemDetailsException;
import com.thetradedesk.workflows.models.operations.GetGraphQlBulkJobStatusResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ProblemDetailsException, Exception {

        Workflows sdk = Workflows.builder()
                .ttdAuth(System.getenv().getOrDefault("WORKFLOWS_TTD_AUTH", ""))
            .build();

        GetGraphQlBulkJobStatusResponse res = sdk.jobStatus().getGraphQlBulkJobStatus()
                .id("<id>")
                .call();

        if (res.graphQLBulkJobRetrievalResponse().isPresent()) {
            System.out.println(res.graphQLBulkJobRetrievalResponse().get());
        }
    }
}

Parameters

Parameter Type Required Description
id String ✔️ N/A

Response

GetGraphQlBulkJobStatusResponse

Errors

Error Type Status Code Content Type
models/errors/ProblemDetailsException 400, 401, 403, 404 application/json
models/errors/APIException 4XX, 5XX */*

getJobStatus

Use this operation to get a previously submitted job's status and completion percentage. Once a job is complete, this operation will return the URL from which to download the job results.

Job results expire after 24 hours, at which point you will need to submit a new job.

Example Usage

package hello.world;

import com.thetradedesk.workflows.Workflows;
import com.thetradedesk.workflows.models.errors.ProblemDetailsException;
import com.thetradedesk.workflows.models.operations.GetJobStatusResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ProblemDetailsException, Exception {

        Workflows sdk = Workflows.builder()
                .ttdAuth(System.getenv().getOrDefault("WORKFLOWS_TTD_AUTH", ""))
            .build();

        GetJobStatusResponse res = sdk.jobStatus().getJobStatus()
                .id(412651L)
                .call();

        if (res.standardJobStatusResponse().isPresent()) {
            System.out.println(res.standardJobStatusResponse().get());
        }
    }
}

Parameters

Parameter Type Required Description
id long ✔️ N/A

Response

GetJobStatusResponse

Errors

Error Type Status Code Content Type
models/errors/ProblemDetailsException 400, 401, 403, 404 application/json
models/errors/APIException 4XX, 5XX */*