0

I'm trying to use the Google Web Risk Submission API in my Java project. As mentioned here - https://cloud.google.com/web-risk/docs/submission-api#java it seems the response suppose to contain a long-running operationID for future checking on the submission status.

I tried looking at the package itself (currently using google-cloud-webrisk:2.8.0 - I also tried on 2.10.0 and some other oldest versions) and couldn't find any mentions of the operationID.

Am I missing something? How should I follow my Submission request if the API isn't retrieving any ID to follow?

I used the same code from the Google Submission API doc

    try (WebRiskServiceClient webRiskServiceClient = WebRiskServiceClient.create()) {

      Submission submission = Submission.newBuilder()
          .setUri(uri)
          .build();

      CreateSubmissionRequest submissionRequest =
          CreateSubmissionRequest.newBuilder()
              .setParent(String.format("projects/%s", projectId))
              .setSubmission(submission)
              .build();

      Submission submissionResponse = webRiskServiceClient.createSubmissionCallable()
              .futureCall(submissionRequest).get(3, TimeUnit.MINUTES);

      System.out.println("Submission response: " + submissionResponse);
    }

I tried submitting a suspicious URI to the Google Web Risk service using the Java Web Risk Submission API and expected to get a result containing operationID.

1 Answers1

1

I had the same issue (using Python but their sample code for Python is basically the same), and the only solution I found was to send the request using the Python requests library. Basically I took the curl example and turned it into a POST request in Python.

nopori
  • 76
  • 5