-
Notifications
You must be signed in to change notification settings - Fork 320
How to: post data to your dashboard and widgets
Bruno P. Kinoshita edited this page Jun 26, 2020
·
4 revisions
When you install Smashing, it will be listening for HTTP POST requests that can be used to update the dashboard and widgets.
Look at config.ru
for a line that looks like set :auth_token, 'YOUR_AUTH_TOKEN'
.
You should change that value to a custom token value to be used by clients
securely.
Let's use the default dashboard and widgets that come installed with Smashing by default.
You can update any of the values with an HTTP POST request similar to the following.
curl -X POST -H 'Content-Type: application/json' -d '{ "auth_token": "YOUR_AUTH_TOKEN", "value": 9999 }' http://localhost:3030/widgets/synergy
Now breaking down the command.
-
curl
is the command used, you can use any other command line utility, or a GUI, or code in Shell, Python, etc -
-X POST
defines this is an HTTP POST request -
H 'Content-Type: application/json
sets the HTTP request content type header -
-d '{ "auth_token": "YOUR_AUTH_TOKEN", "value": 9999 }'
specifies the data of the request, which is a JSON document. Theauth_token
, as mentioned above, is the default value which you probably want to alter. The "value" matches what is sent in thejobs/sample.rb
job. -
http://localhost:3030/widgets/synergy
is the URL used in the post, which contains the prefixhttp://localhost:3030/widgets/
followed by the widget name, which also matches the value fromjobs/sample.rb
job.
- Home
- Dashing Workshop
- Installation
- Widgets
- Configuration
- Security
- Troubleshooting
- Deploying dashboards
- How Tos
- How to: post data to your dashboard and widgets
- How to: Define a data model and store history data to database
- How to: Prevent a job from overlapping with itself
- How to: Send HTML data to your widgets
- How to: Send mysql data to your widgets
- How to: Setup a Graph
- How to: Store data to and display from database
- How to: Update a Dashboard using a spreadsheet
- How to: update dashboard in Django
- How to: Update font awesome fonts from version 3 to 4
- How to: Use New Relic with Dashing
- How to: precompile assets
- Development