Verifies new Instagram API webhooks.
To deploy the lambda for production, use npm run deploy:prod
.
TOKEN
which is going to be matched againsthub.verify_token
query parameter.
The request GET
has 3 mandatory query parameters:
hub.verify_token
is a token that is set in the IG Dashboard when creating new webhookhub.mode
has to be equal tosubscribe
hub.challenge
is an integer that we respond with if the request is valid
If the environment has not been setup, it respond with http status 500
.
If the challenge is empty or mode is not correct it responds with 422
.
If the token does not match, it responds with http status 401
.
Otherwise it responds with 200
and puts hub.challenge
into body.