google-bm-api-golang

command module
v0.0.0-...-3e3ae12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 9 Imported by: 0

README

Declaration

Most of these codes are from google-api-go-client. Please let me know if anything is offensive. Google Business message API doesn't get from that repo, for it defined a private API, so I generate it from the discovery document through google-api-go-client.

Gen from Google Business Message API

  1. Download the discovery document
  2. Generate the client library
go install google.golang.org/api/google-api-go-generator
google-api-go-generator --api_json_file "path/to/file/from/first_step_discover.json" -gendir "."
# replace google.golang.org/api/internal
sed -i='' 's_google.golang.org/api/internal_github.com/FPNL/google-bm-api-golang/internal_g' businessmessages/v1/businessmessages-gen.go

Google Business Message API

First of all

You should know your product in these potential situations https://developers.google.com/business-communications/business-messages/guides/how-to/message/message-lifecycle

Notice

Google promises sending message within 7 days

Or until your webhook successfully receives the message.

Not all devices accept all message styles

Not all messages can be sent to the user. Remember to provide fallback message for unsupported devices. Fallback messages support \n, \r\n.

HUMAN and BOT - Representatives

Conversation can be represented by BOT, then HUMAN can join any time. BOT and HUMAN are called Representatives.

Message Style

User can send 4 types of messages:

  • Text
  • Images
    • Google only keep 7 days
  • Suggestions
  • Authentication request

Representative can send 9 types of messages:

  • Text
  • Rich Text
  • Images
  • Suggested replies(!)
  • Suggested actions(!)
  • Authentication request suggestion
  • Live agent request suggestion
  • Rich cards
  • Rich card carousels

Events

  • User request HUMAN
  • Representative joined/left
  • Typing

AI

Google provides Dialogflow

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
businessmessages
v1
Package businessmessages provides access to the Business Messages API.
Package businessmessages provides access to the Business Messages API.
Package internal supports the options and transport packages.
Package internal supports the options and transport packages.
cert
Package cert contains certificate tools for Google API clients.
Package cert contains certificate tools for Google API clients.
ecp
examples/fake
Package fake demonstrates how to use concrete services and fake the interactions with them in tests.
Package fake demonstrates how to use concrete services and fake the interactions with them in tests.
examples/mock
Package mock demonstrates how to use interfaces to mock interactions with service in tests.
Package mock demonstrates how to use interfaces to mock interactions with service in tests.
gensupport
Package gensupport is an internal implementation detail used by code generated by the google-api-go-generator tool.
Package gensupport is an internal implementation detail used by code generated by the google-api-go-generator tool.
impersonate
Package impersonate is used to impersonate Google Credentials.
Package impersonate is used to impersonate Google Credentials.
third_party/uritemplates
Package uritemplates is a level 3 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570).
Package uritemplates is a level 3 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL