what is the payload to be sent in POST requests for endpoints such as
/users/api/create
/roles/api/create
/tablemodelview/api/create
/slicemodelview/api/create
...and so on
i observed what is happening when done through Superset UI for creating a user and found it is a form data,but unsure about csrf_token field .
------WebKitFormBoundaryQrSIlGUEgDJGetau
Content-Disposition: form-data; name="csrf_token"
IjNiNjVhODlhNmNhNWJmMTU4ZTczYzMwMGI3MTk3ZmQ5ZDNlMjUxN2Ii.C7vtHw.DbWt6OFVCMVw8Wr8PIRha60lJw8
------WebKitFormBoundaryQrSIlGUEgDJGetau
Content-Disposition: form-data; name="first_name"
johnny
------WebKitFormBoundaryQrSIlGUEgDJGetau
Content-Disposition: form-data; name="last_name"
walker
------WebKitFormBoundaryQrSIlGUEgDJGetau
Content-Disposition: form-data; name="username"
johnny
------WebKitFormBoundaryQrSIlGUEgDJGetau
Content-Disposition: form-data; name="email"
[email protected]
------WebKitFormBoundaryQrSIlGUEgDJGetau
Content-Disposition: form-data; name="roles"
3
------WebKitFormBoundaryQrSIlGUEgDJGetau
Content-Disposition: form-data; name="password"
123456
------WebKitFormBoundaryQrSIlGUEgDJGetau
Content-Disposition: form-data; name="conf_password"
123456
------WebKitFormBoundaryQrSIlGUEgDJGetau--
How can we achieve this through API?
If you are going to do some kind of integration i think you cannot avoid to read superset source code. First step is views/core.py, after that flask-app-bootstrap security and api reference documentation will help too.
Most helpful comment
http://flask-appbuilder.readthedocs.io/en/latest/quickhowto.html#exposed-methods
https://github.com/dpgaspar/Flask-AppBuilder/issues/387