Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

af11's avatar
af11
Explorer | Level 4
4 years ago
Solved

webhook tutorial

Hi,

I'm following the webhook tutorial using the Python SDK.

There is a url and function 'welcome'.

However, I don't see it being used anywhere in the app.

Can you please clarify what the purpose of it is if it's not being used anywhere?

Thank you

2 Replies

Replies have been turned off for this discussion
  • Здравко's avatar
    Здравко
    Legendary | Level 20
    4 years ago

    Hi af11,

    Are you aware of 'annotations' in Python? 🧐 I suppose you got confused on following point in code:

     

    @app.route('/welcome')
    def welcome():
        return render_template('welcome.html', redirect_url=get_url('oauth_callback'),
            webhook_url=get_url('webhook'), home_url=get_url('index'), app_key=APP_KEY)

     

    What is the leading "@app.route('/welcome')" for? 🤔

    Try investigate meaning of following parts of the code, denoted here:

     

    #...
    from flask import abort, Flask, redirect, render_template, Response, request, session, url_for
    #...
    app = Flask(__name__)
    #...
    ​if __name__=='__main__':
        app.run(debug=True)

     

    In the same context, where following functions get called from: oauth_callback, process_user, index, etc. 😉

    Hope this gives direction.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!