You'll need to unmute the video to hear the audio
Last active
June 10, 2024 19:23
-
-
Save mickmister/6d1bbcfe386c833ede9fede37525f6f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
const channelId = 'az6sexnys38w58ha4891dq91ho'; | |
const body = { | |
"channel_id": channelId, | |
"props": { | |
"app_bindings": [ | |
{ | |
"label": "", | |
"description": "", | |
"location": "embedded", | |
"app_id": 'my_app_id', | |
"bindings": [ | |
{ | |
"location": "clickme", | |
"label": "Yes", | |
"submit": { | |
"path": "/path1", | |
"expand": { | |
"post": "all" | |
}, | |
"state":{ | |
'original_post_info': 'data1' | |
} | |
} | |
}, | |
{ | |
"location": "clickme2", | |
"label": "No", | |
"submit": { | |
"path": "/path2", | |
"expand": { | |
"post": "all", | |
"acting_user":"id" | |
}, | |
"state":{ | |
'original_post_info': 'data2' | |
} | |
} | |
} | |
] | |
} | |
] | |
} | |
} | |
fetch("/api/v4/posts", | |
{ | |
"headers": { | |
"accept": "*/*", | |
"accept-language": "en", | |
"content-type": "application/json", | |
"sec-ch-ua": "\"Not)A;Brand\";v=\"24\", \"Chromium\";v=\"116\"", | |
"sec-ch-ua-mobile": "?0", | |
"sec-ch-ua-platform": "\"macOS\"", | |
"sec-fetch-dest": "empty", | |
"sec-fetch-mode": "cors", | |
"sec-fetch-site": "same-origin", | |
"x-requested-with": "XMLHttpRequest" | |
}, | |
"referrerPolicy": "no-referrer", | |
"body": JSON.stringify(body), | |
"method": "POST", | |
"mode": "cors", | |
"credentials": "include" | |
}); | |
})() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
const channelId = '67dbk7oy47g8xxhz6hu86gquce'; | |
const body = { | |
"channel_id": channelId, | |
"props": { | |
"attachments": [ | |
{ | |
"fallback": "Demo plugin [link](www.test.com)", | |
"color": "#95b7d0", | |
"pretext": "Demo plugin [link](www.test.com)" | |
} | |
], | |
"from_bot": "true", | |
"from_plugin": "true" | |
} | |
}; | |
fetch("/api/v4/posts", | |
{ | |
"headers": { | |
"accept": "*/*", | |
"accept-language": "en", | |
"content-type": "application/json", | |
"sec-ch-ua": "\"Not)A;Brand\";v=\"24\", \"Chromium\";v=\"116\"", | |
"sec-ch-ua-mobile": "?0", | |
"sec-ch-ua-platform": "\"macOS\"", | |
"sec-fetch-dest": "empty", | |
"sec-fetch-mode": "cors", | |
"sec-fetch-site": "same-origin", | |
"x-requested-with": "XMLHttpRequest" | |
}, | |
"referrerPolicy": "no-referrer", | |
"body": JSON.stringify(body), | |
"method": "POST", | |
"mode": "cors", | |
"credentials": "include" | |
}); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You'll need to unmute the video to hear the audio
create-post-with-buttons.mp4