Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
322 views
in Technique[技术] by (71.8m points)

Obtaining Slack trigger_id from slash command

I'm looking to open a dialog in Slack based on the user executing a basic slash command. I can currently capture the payload from a slash command in my API, and action this accordingly, but my understanding is that in order to open a dialog I need a corresponding trigger_id, which doesn't seem to be present in the payload.

The only values I have are: token, channel_name, user_name, command and text.

I might be misunderstanding this, but everything I have read seems to suggest that I should have said trigger_id as part of my incoming payload. Is this correct?

I do have Interactivity turned on within my app, but can't see anything in there to link this to a slash command. Is that a correct assumption that they are separate? Or are they linked in some way?

Can anybody help with this?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This wasn't a slack issue, but a C#/serialisation issue my side. The trigger_id was being received within the payload, but not serialised properly on the server (even though a JsonProperty was defined), as the object was specified as TriggerId on the object itself. For anyone having this problem in C#, just ensure the trigger ID column is defined as trigger_id


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...