Send Requests

After you've set everything up, you can send requests to the Display & Video 360 API.

The following code samples demonstrate how to send a few simple requests:

  • Create a resource.
  • Retrieve a specific resource.

For a full list of methods, see the reference documentation.

Create a resource

To create a resource, use the following code:

Java


// Create the filter structure
ParentEntityFilter parentEntityFilter = new ParentEntityFilter();
parentEntityFilter.setFileType(sdf-file-type-list);
parentEntityFilter.setFilterType(sdf-filter-type);
parentEntityFilter.setFilterIds(filter-id-list);

// Configure the sdfdownloadtasks.create request
CreateSdfDownloadTaskRequest createSdfDownloadTaskRequest =
    new CreateSdfDownloadTaskRequest();
createSdfDownloadTaskRequest.setVersion(sdf-version);
createSdfDownloadTaskRequest.setAdvertiserId(advertiser-id);
createSdfDownloadTaskRequest.setParentEntityFilter(parentEntityFilter);

// Create the sdfdownloadtask
Operation operation = service.sdfdownloadtasks()
    .create(createSdfDownloadTaskRequest)
    .execute();

Python

# Configure the sdfdownloadtasks.create request
createSdfDownloadTaskRequest = {
    'version': sdf-version,
    'advertiserId': advertiser-id,
    'parentEntityFilter': {
        'fileType': sdf-file-type-list,
        'filterType': sdf-filter-type,
        'filterIds': filter-id-list
    }
}

# Create the sdfdownloadtask
operation = service.sdfdownloadtasks().create(
    body=createSdfDownloadTaskRequest).execute();

Retrieve a specific resource

To retrieve a specific resource from the list, use the following code:

Java

// Get the sdfdownloadtask operation
Operation operation =
    service.sdfdownloadtasks().operations().get(operation-name).execute();

Python

# Get the sdfdownloadtask operation
operation = service.sdfdownloadtasks().operations().get(
    name='operation-name').execute()