Skip to content

Latest commit

 

History

History
137 lines (100 loc) · 6.63 KB

File metadata and controls

137 lines (100 loc) · 6.63 KB

GraphQLRequest

Overview

Available Operations

submitGraphQlRequest

This generic operation can be used to execute any valid GraphQL request. The results are returned directly when the request is complete. To explore the available GraphQL operations, see the GraphQL Schema Explorer.

Example Usage

package hello.world;

import com.thetradedesk.workflows.Workflows;
import com.thetradedesk.workflows.models.components.GraphQLRequestInput;
import com.thetradedesk.workflows.models.errors.ProblemDetailsException;
import com.thetradedesk.workflows.models.operations.SubmitGraphQlRequestResponse;
import java.lang.Exception;
import java.util.Map;

public class Application {

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

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

        GraphQLRequestInput req = GraphQLRequestInput.builder()
                .request("<value>")
                .variables(Map.ofEntries(
                ))
                .betaFeatures("<value>")
                .build();

        SubmitGraphQlRequestResponse res = sdk.graphQLRequest().submitGraphQlRequest()
                .request(req)
                .call();

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

Parameters

Parameter Type Required Description
request GraphQLRequestInput ✔️ The request object to use for the request.

Response

SubmitGraphQlRequestResponse

Errors

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

submitGraphQlBulkQueryJob

This generic operation can be used to execute any valid bulk GraphQL query. To determine the job's status, completion percentage, and URL for download (once the job results are ready), query the GraphQL Bulk Job Status endpoint. For information on bulk GraphQL query syntax, see GraphQL API Bulk Operations.

Example Usage

package hello.world;

import com.thetradedesk.workflows.Workflows;
import com.thetradedesk.workflows.models.components.GraphQlBulkJobCallbackInput;
import com.thetradedesk.workflows.models.components.GraphQlQueryJobInput;
import com.thetradedesk.workflows.models.errors.ProblemDetailsException;
import com.thetradedesk.workflows.models.operations.SubmitGraphQlBulkQueryJobResponse;
import java.lang.Exception;
import org.openapitools.jackson.nullable.JsonNullable;

public class Application {

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

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

        GraphQlQueryJobInput req = GraphQlQueryJobInput.builder()
                .query("<value>")
                .callbackInput(GraphQlBulkJobCallbackInput.builder()
                    .callbackUrl("https://sociable-quinoa.info/")
                    .callbackHeaders(JsonNullable.of(null))
                    .build())
                .betaFeatures("<value>")
                .build();

        SubmitGraphQlBulkQueryJobResponse res = sdk.graphQLRequest().submitGraphQlBulkQueryJob()
                .request(req)
                .call();

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

Parameters

Parameter Type Required Description
request GraphQlQueryJobInput ✔️ The request object to use for the request.

Response

SubmitGraphQlBulkQueryJobResponse

Errors

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