DEMO: Command Line Tool

To call USB Fusion API, wget and curl are supported in Linux, Windows, and Mac OS.

The location of cookie files varies according to the OS. Adjust the file path for your situation. The following examples are for Linux.

wget

  1. Save your login information on cookies.
wget --save-cookies=sid.txt --keep-session-cookies --header="Content-Type: application/json" --post-data='{"username":"Admin", "password": "c1c224b03cd9bc7b6a86d77f5dace40191766c485cd55dc48caf9ac873335d6f"}' http://192.168.66.1/api/user/login -d -q -O -
  1. List all users.
wget --load-cookies=sid.txt --keep-session-cookies --header="Content-Type: application/json" --post-data='' http://192.168.66.1/api/user/get-all -d -q -O -
  1. Add a new user.
wget --load-cookies=sid.txt --keep-session-cookies --header="Content-Type: application/json" --post-data='{"username":"test","password":"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"}' http://192.168.66.1/api/user/add -d -q -O -

curl

  1. Save your login information on cookies.
curl --cookie-jar sid.txt http://192.168.66.1/api/user/login -X POST -H 'Content-Type: application/json' -d'{"username":"Admin", "password": "c1c224b03cd9bc7b6a86d77f5dace40191766c485cd55dc48caf9ac873335d6f"}'
  1. List all users.
curl --cookie sid.txt http://192.168.66.1/api/user/get-all -X POST -H 'Content-Type: application/json' -d ''
  1. Add a new user.
curl --cookie sid.txt http://192.168.66.1/api/user/add -X POST -H 'Content-Type: application/json' -d '{"username":"test","password":"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"}'

results matching ""

    No results matching ""