- Overview
- How it works?
- Getting Started
- Developer reference
- Zoho Writer
- Zoho PDF Editor
- Zoho Sheet
- Zoho Show
- GETPlan details
- Errors
- Manage Office Integrator
- Pricing
- How-to Guides
Session Information
Purpose
To get the details of a particular document session.
HTTP Request URL
https://{api.office-integrator_domain}/writer/officeapi/v1/sessions/<session_id>?apikey=<apikey>
Request Parameters
Parameter | Data Type | Description |
Mandatory Parameters | ||
apikey | String | Uniquely identifies the web application in which the Writer editor is integrated. |
session_id | String | Unique user session id of the document. |
Note:
Users can find the 'session_id' in all Zoho Writer API responses. For example, the "session_id" is captured as part of the response and can be seen in Preview, Edit and Comparison APIs.
Sample Request
Copiedhttps://api.office-integrator.com/writer/officeapi/v1/sessions/d26aa7b8029b5rf8d34c7dd00139392357d12ffcb21c1?apikey=423s*****
Copiedimport * as SDK from "@zoho-corp/office-integrator-sdk";
class GetSessionDetail {
static async execute() {
//Initializing SDK once is enough. Calling here since code sample will be tested standalone.
//You can place SDK initializer code in you application and call once while your application start-up.
await this.initializeSdk();
try {
var sdkOperations = new SDK.V1.V1Operations();
var createDocumentParameters = new SDK.V1.CreateDocumentParameters();
var createResponse = await sdkOperations.createDocument(createDocumentParameters);
var sessionId = createResponse.object.getSessionId();
console.log("\nCreated a new document to demonstrate get session details api. Created session ID - " + sessionId);
var responseObject = await sdkOperations.getSession(sessionId);
if(responseObject != null) {
//Get the status code from response
console.log("\nStatus Code: " + responseObject.statusCode);
//Get the api response object from responseObject
let writerResponseObject = responseObject.object;
if(writerResponseObject != null){
//TODO: Need to fix object type issue
if(writerResponseObject instanceof SDK.V1.SessionMeta ){
console.log("\nSession Status - " + writerResponseObject.getStatus());
console.log("\nSession URL - " + writerResponseObject.getInfo().getSessionUrl());
console.log("\nSession User ID - " + writerResponseObject.getUserInfo().getUserId());
console.log("\nSession Display Name - " + writerResponseObject.getUserInfo().getDisplayName());
} else if (writerResponseObject instanceof SDK.V1.InvalidConfigurationException) {
console.log("\nInvalid configuration exception. Exception json - ", writerResponseObject);
} else {
console.log("\nRequest not completed successfullly");
}
}
}
} catch (error) {
console.log("\nException while running sample code", error);
}
}
//Include office-integrator-sdk package in your package json and the execute this code.
static async initializeSdk() {
// Refer this help page for api end point domain details - https://www.zoho.com/officeintegrator/api/v1/getting-started.html
let environment = await new SDK.DataCenter.Production("https://api.office-integrator.com");
let auth = new SDK.AuthBuilder()
.addParam("apikey", "2ae438cf864488657cc9*******") //Update this apikey with your own apikey signed up in office integrator service
.authenticationSchema(await new SDK.V1.Authentication().getTokenFlow())
.build();
let tokens = [ auth ];
//Sdk application log configuration
let logger = new SDK.LogBuilder()
.level(SDK.Levels.INFO)
//.filePath("<file absolute path where logs would be written>") //No I18N
.build();
let initialize = await new SDK.InitializeBuilder();
await initialize.environment(environment).tokens(tokens).logger(logger).initialize();
console.log("SDK initialized successfully.");
}
}
GetSessionDetail.execute();
Show full
Show less
Sample Response
Copied{
"status": "active/inactive/invalid"
"user_info": {
"display_name":"Amelia",
"user_id":"1111"
}
"info": {
"document_id": "12345",
"created_time_ms": 1659578400000,
"created_time": "2018-05-08T13:54:41Z"
"expires_on_ms": 1659578400000,
"expires_on": "2018-05-08T13:54:41Z",
"session_url": "https://api.office-integrator.com/writer/officeapi/v1/documents/<session_id>/edit"
"session_delete_url":"https://api.office-integrator.com/writer/officeapi/v1/sessions/<session_id>"
}
}
Status Description:
active - If the session details is available and opened.
inactive - If the session url is not yet opened.
invalid - If no such session is available for that APIKey.
Show full
Show less
© 2025, Zoho Corporation Pvt. Ltd. All Rights Reserved.