[Python] How to upload file to google chat with service account credential

Discussão em 'Python' iniciado por Stack, Abril 16, 2025.

  1. Stack

    Stack Membro Participativo

    I want to upload media to google chat by using service account, I had follow the guides below here https://developers.google.com/workspace/guides/configure-oauth-consent , but this is Authenticate as a user and I have to do manual for a link, I want to auto this process.

    I try using service account, this has error:

    googleapiclient.errors.HttpError: <HttpError 403 when requesting https://chat.googleapis.com/upload/v1/spaces/.../attachments:upload?alt=json&uploadType=multipart returned "This method doesn't support service account authentication. Authenticate with a user account.". Details: "[{'@type': 'type.googleapis.com/google.rpc.Help', 'links': [{'description': 'See article Authenticate as a user.', 'url': 'https://developers.google.com/chat/api/guides/auth/users'}]}]">

    How can I do, or anyway else to get it

    Continue reading...

Compartilhe esta Página