Incubator-superset: Payload required for CRUD operations in API

Created on 28 Mar 2017  路  2Comments  路  Source: apache/incubator-superset

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?

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tmccartan picture tmccartan  路  3Comments

lenguyenthedat picture lenguyenthedat  路  3Comments

dinhhuydh picture dinhhuydh  路  3Comments

ghost picture ghost  路  3Comments

john-bodley picture john-bodley  路  3Comments