Method: subscriptions.create

Tworzy abonament Google Workspace. Więcej informacji o korzystaniu z tej metody znajdziesz w artykule Tworzenie abonamentu Google Workspace.

W przypadku subskrypcji zasobu docelowego Google Chat możesz utworzyć subskrypcję jako:

Żądanie HTTP

POST https://workspaceevents.googleapis.com/v1/subscriptions

Adres URL używa składni transkodowania gRPC.

Parametry zapytania

Parametry
validateOnly

boolean

Opcjonalnie. Jeśli ustawisz wartość true, żądanie zostanie zweryfikowane i wyświetlony zostanie jego podgląd, ale subskrypcja nie zostanie utworzona.

Treść żądania

Treść żądania zawiera wystąpienie elementu Subscription.

Treść odpowiedzi

Jeśli operacja się uda, treść odpowiedzi będzie zawierała nowo utworzoną instancję Operation.

  • Pole metadata zawiera pustą tablicę.
  • Pole response zawiera nową instancję Subscription.

Zakresy autoryzacji

Wymaga jednego z tych zakresów OAuth:

  • https://www.googleapis.com/auth/chat.spaces
  • https://www.googleapis.com/auth/chat.spaces.readonly
  • https://www.googleapis.com/auth/chat.messages
  • https://www.googleapis.com/auth/chat.messages.readonly
  • https://www.googleapis.com/auth/chat.messages.reactions
  • https://www.googleapis.com/auth/chat.messages.reactions.readonly
  • https://www.googleapis.com/auth/chat.memberships
  • https://www.googleapis.com/auth/chat.memberships.readonly
  • https://www.googleapis.com/auth/chat.app.memberships
  • https://www.googleapis.com/auth/chat.app.memberships.readonly
  • https://www.googleapis.com/auth/chat.app.messages.readonly
  • https://www.googleapis.com/auth/chat.app.spaces
  • https://www.googleapis.com/auth/chat.app.spaces.readonly
  • https://www.googleapis.com/auth/meetings.space.created
  • https://www.googleapis.com/auth/meetings.space.readonly
  • https://www.googleapis.com/auth/drive
  • https://www.googleapis.com/auth/drive.file
  • https://www.googleapis.com/auth/drive.metadata
  • https://www.googleapis.com/auth/drive.metadata.readonly
  • https://www.googleapis.com/auth/drive.readonly

Więcej informacji znajdziesz w przewodniku po autoryzacji.