2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Slack AppでリクエストURLにLambda(Node.js)の関数URLを指定してYour URL didn't respond with the value of the challenge parameterが出た時の対応

Posted at

はじめに

Slackアプリの Event Subscriptions -> Enable Events -> Request URLでURL設定時にタイトルのエラーが出た場合の対応方法を整理します。

エラー内容

Your URL didn't respond with the value of the challenge parameter.
  • 内容としてはchallenge パラメータを指定してレスポンスを返していない、という意味です。

結論

Lambda(Node.js)の場合、以下のようなコードを書けばOKです。
challenge のみを含むレスポンスを返却するのがポイントです。

index.js
exports.handler = async (event) => {
    // TODO implement
    console.log(`event=${JSON.stringify(event)}`);
    const event_body_json = JSON.parse(event.body);
    console.log(`challenge=${event_body_json.challenge}`);
    const response = {
        challenge: event_body_json.challenge
    };
    return response;
};

注意点

  • Lambdaで関数生成時にresponseにstatusCode: 200が含まれていますが、外しましょう。
  • statusCode: 200を含めていたために、私の場合はエラーがでてしまい、少し詰まりました。
2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?