@@ -32,7 +32,47 @@ def create_message_with_app_cred():
3232 # Replace SPACE_NAME here.
3333 parent = "spaces/SPACE_NAME" ,
3434 message = {
35- "text" : "Hello with app credential!"
35+ "text" : 'ππ Hello world! I created this message by calling ' +
36+ 'the Chat API\' s `messages.create()` method.' ,
37+ "cards_v2" : [{ "card" : {
38+ "header" : {
39+ "title" : 'About this message' ,
40+ "image_url" : 'https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/info/default/24px.svg'
41+ },
42+ "sections" : [{
43+ "header" : "Contents" ,
44+ "widgets" : [{ "text_paragraph" : {
45+ "text" : 'π‘ <b>Text</b> which can include ' +
46+ 'hyperlinks π, emojis ππ, and @mentions π£οΈ.'
47+ }}, { "text_paragraph" : {
48+ "text" : 'πΌοΈ A <b>card</b> to display visual elements' +
49+ 'and request information such as text π€, ' +
50+ 'dates and times π
, and selections βοΈ.'
51+ }}, { "text_paragraph" : {
52+ "text" : 'ππ An <b>accessory widget</b> which adds ' +
53+ 'a button to the bottom of a message.'
54+ }}
55+ ]}, {
56+ "header" : "What's next" ,
57+ "collapsible" : True ,
58+ "widgets" : [{ "text_paragraph" : {
59+ "text" : "β€οΈ <a href='https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.reactions/create'>Add a reaction</a>."
60+ }}, { "text_paragraph" : {
61+ "text" : "π <a href='https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/patch'>Update</a> " +
62+ "or β <a href='https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/delete'>delete</a> " +
63+ "the message."
64+ }
65+ }]
66+ }
67+ ]
68+ }}],
69+ "accessory_widgets" : [{ "button_list" : { "buttons" : [{
70+ "text" : 'View documentation' ,
71+ "icon" : { "material_icon" : { "name" : 'link' }},
72+ "on_click" : { "open_link" : {
73+ "url" : 'https://developers.google.com/workspace/chat/create-messages'
74+ }}
75+ }]}}]
3676 }
3777 )
3878
0 commit comments