Home

Sign In

To use the REST API, log into Unravel UI and send the POST /signIn request.

Authorize in the Unravel UI
  1. Log into Unravel UI and select the API page.

  2. Expand POST /signIn and click Try it out.

    API-DefaultTryItOut.png
  3. Enter your username and password and click Execute.

    API-generated.png

    Tip

    The command listed in the curl text box above is the same command you enter on the command line.

  4. Copy the value of the token field in the response body. Don't include the quotation marks.

  5. Click Authorize at the top of the page.

  6. In the Value text box, paste the token after the string JWT. Make sure there's a space between JWT and the token you paste in.

    Authorize.png
  7. Click Authorize.

Command Line
  1. Open an SSH session to your cluster, cluster-name.

    ssh@root cluster-name
  2. Once you have successfully logged in, enter the curl command from step 2 above.

    curl -X POST "http://unravel-host:3000/api/v1/signIn" -H  "accept: application/json" -H  "content-type: application/x-www-form-urlencoded" -d "username=admin&password=your-admin-password"

    You should see a respose like this:

    {
      "message": "ok",
      "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYWRtaW4iLCJyZWFkT25seSI6ZmFsc2UsImlkIjoiYWRtaW4iLCJ1c2VybmFtZSI6ImFkbWluIiwidGFncyI6IiIsImlhdCI6MTUzNzc3NDMwOSwiZXhwIjoxNTM3NzgxNTA5fQ.iD6NXDRj1UqRYr58H4xYlNRcdrWFcU9l3p8NmbpN30k",
      "role": "admin",
      "readOnly": false,
      "tags": "",
      "id": "admin",
      "username": "admin"
    }
  3. Send the token with each request. Generate a new token each time you log in or start a new session.