Users Guide

Table Of Contents
The following is an example of a RS256 signed token:
"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiZXhwIjoxNTUzNjcyMjcxfQ.
nDydDFFjLju6jYuR9waxmvVZ6iVHoJZSrqey2p3S_0B_fD5U2GU8tOjTr3paJ3Wvs1a3TQpKQ_xAp-9zxBwUoJFTC
2qjKH6uMgTgfWxltrfcb3_9JF1SIsyGHaT-oUzcdCmC47TlXRIRLzcZ9w4Q5vFqxKYv1sRA47T9sSnAZac"
Access token
You can use the HTTP Bearer Authentication to pass the access token to subsequent REST API requests. You can do this using
the HTTP Authorization header with syntax 'Authorization: Bearer <TOKEN>' .
The following is the output of the command:
$ curl -X GET -k -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-
Type: application/json" https://$TARGET/restconf/data/dell-system:system/hostname {"dell-
system:hostname":"OS10"}
Refresh token
You can use the HTTP Bearer Authentication with the same Login REST API to acquire a new access token. Place the same
refresh token available in the authorization header in the 'refresh_token' key of output data.
$ curl -X GET -k -H "Authorization: Bearer $REFRESH_TOKEN" -H "Content-Type: application/
json" https://$TARGET/login
{
"access_token": "ijk.978.rst",
"token_type": "bearer",
"refresh_token": "efg.456.uvw"
}
The validity of the refresh token is equal to the validity of the access token multiplied by the refresh limit.
CLI commands for RESTCONF API
rest api restconf
Enables the RESTCONF API service on the switch.
Syntax
rest api restconf
Parameters None
Default RESTCONF API is disabled.
Command Mode CONFIGURATION
Usage
Information
After you enable the RESTCONF API, you can send curl commands in HTTPS requests from a remote
device.
The no version of the command disables the RESTCONF API.
Example
OS10(config)# rest api restconf
Supported
Releases
10.4.1.0 or later
1514 RESTCONF API