Search for messages in Google Chat Space through Google Vault API

131 Views Asked by At

I'm trying to create a Google Vault Export containing all messages in a Chat Space by querying for a specific Chat Space ID. Unfortunately, creating an export for the following query:

 newQuery
    .setDataScope("ALL_DATA")
    .setCorpus("HANGOUTS_CHAT")
    .setStartTime(startDate)
    .setEndTime(endDate)
    .setSearchMethod("ROOM")
    .setHangoutsChatOptions(new HangoutsChatOptions().setIncludeRooms(false))
    .setHangoutsChatInfo(new HangoutsChatInfo().setRoomId(spaceId));

produces the following error:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
POST https://vault.googleapis.com/v1/matters/<matterID>/exports
{
  "code" : 400,
  "errors" : [ {
    "domain" : "global",
    "message" : "Search method ROOM is not supported for corpus type HANGOUTS_CHAT.",
    "reason" : "badRequest"
  } ],
  "message" : "Search method ROOM is not supported for corpus type HANGOUTS_CHAT.",
  "status" : "INVALID_ARGUMENT"
}

CorpusType needs to be set to "HANGOUTS_CHAT" in order to search in the Google Chat Service. The API also mentions that a HangoutsChatInfo() object needs to be passed when the search method is "ROOM" (https://developers.google.com/vault/reference/rest/v1/Query#SearchMethod).

Am I missing something or is this a bug? Does anyone know a workaround for this issue, if what I want to accomplish is not possible?

1

There are 1 best solutions below

1
On BEST ANSWER

It seems that is intended behavior as per current design of the API since you will need to provide the corresponding RoomId and it's not possible at the moment.

Someone had a similar problem before and it ended up in a feature request, you can check it here: https://issuetracker.google.com/189250955