I'm getting the following error when trying to create a hold using the Google Vault API:
HttpError 500 when requesting https://vault.googleapis.com/v1/matters/{matterId}/holds?alt=json returned "Internal error encountered."
from google.oauth2 import service_account
import googleapiclient.discovery
SCOPES = ['https://www.googleapis.com/auth/ediscovery']
SERVICE_ACCOUNT_FILE = './serviceaccount.json'
credentials = service_account.Credentials.from_service_account_file(SERVICE_ACCOUNT_FILE, scopes=SCOPES)
delegated_credentials = credentials.with_subject('[email protected]')
client = googleapiclient.discovery.build('vault', 'v1', credentials=delegated_credentials)
data = { 'name': 'test', 'accounts': [{'email': '[email protected]' }], 'corpus': 'MAIL', 'query': { 'mailQuery': {'terms': 'to:[email protected]'} }}
results = client.matters().holds().create(matterId='{matterId}', body=data).execute()
I've replaced the actual matterId string with {matterId}. Creating matters, listing matters and listing holds work just fine. I've tried different combinations of fields to include in the request body but the docs are not clear as to which are required...