public String getJsonValue(ObjectMapper objectMapper, String jsonTopKey, String causeMessage)
      throws IOException {
    String responseBody = checkResponseBody(causeMessage);
    final Map<String, Object> json;
    try {
      // convert to a map, by reading entire body into memory
      json = objectMapper.readValue(responseBody, Map.class);
    } catch (IOException e) {
      throw toIoException(causeMessage, e);
    }
    checkState(
        json.containsKey(jsonTopKey),
        "response body missing top-level JSON field \"%s\"",
        jsonTopKey);
    final String jsonValue = (String) json.get(jsonTopKey);
    checkState(
        !Strings.isNullOrEmpty(jsonValue),
        "Expected JSON value for key \"%s\" to be present in in JSON body: %s",
        jsonTopKey,
        json);
    return jsonValue;
  }
Extracts a top-level JSON value, at key `jsonTopKey`, from current response body.
extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/MicrosoftApiResponse.java