cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

webhook tutorial

webhook tutorial

af11
Explorer | Level 4
Go to solution

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

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

@af11 As Здравко indicated, it sounds like you're referring to the "welcome" definition in app.py in the mdwebhook project, which is used for the "/welcome" route.

 

That route in particular is used as the "success_url" for the app in the app.json (for Heroku deploys).

View solution in original post

2 Replies 2

Здравко
Legendary | Level 20
Go to solution

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.

Greg-DB
Dropbox Staff
Go to solution

@af11 As Здравко indicated, it sounds like you're referring to the "welcome" definition in app.py in the mdwebhook project, which is used for the "/welcome" route.

 

That route in particular is used as the "success_url" for the app in the app.json (for Heroku deploys).

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?