Getting started
Overview What Is DWS Viewer API? Dashboard Trial Limitations Language Support Deployment Options Security PrivacyIntegration
Overview Use With Your Backend Open Document in Web SDKClient Authentication
Authentication Flow Generate a Session TokenAPI
Overview Authentication API Reference Support About NutrientGenerate a Session Token
Session tokens used for authentication by DWS Viewer API can be generated using your API key via the POST /viewer/sessions
endpoint:
curl -X POST https://api.nutrient.io/viewer/sessions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_api_key_here" \
--fail \
-d '{
"allowed_documents": [
{
"document_id": "<document_id>",
"document_permissions": [
"read",
"write",
"download"
]
}
],
"exp": 1793769299
}'
curl -X POST https://api.nutrient.io/viewer/sessions ^
-H "Content-Type: application/json" ^
-H "Authorization: Bearer your_api_key_here" ^
--fail ^
-d "{\"allowed_documents\": [{\"document_id\": \"<document_id>\", \"document_permissions\": [\"read\", \"write\", \"download\"]}], \"exp\": 1793769299}"
POST https://api.nutrient.io/viewer/sessions HTTP/1.1
Content-Type: application/json
Authorization: Bearer your_api_key_here
{
"allowed_documents": [
{
"document_id": "<document_id>",
"document_permissions": [
"read",
"write",
"download"
]
}
],
"exp": 1793769299
}
You can then retrieve the JWT as an jwt
from the response:
{
"jwt": "<created_session_token>"
}
You can now use the session token to open the document in Nutrient Web SDK.
💡 Session tokens can be created with additional optional claims to further control their properties. Refer to our API reference to learn more.