iSheets API
iSheets API version 2 - iSheet module - API - Generate site-wide/single-record document

iSheets API version 2 - iSheet module - API - Generate site-wide/single-record document

OVERVIEW

 

This API is designed for downloading site-wide and single-record documents from iSheet.

Step 1 -

Site-wide document end-point

GET /api/3/isheet/doctemplate/generatedocument/sitewide/{doctemplateid}?isheetid={isheetid}&isheetrecordids={isheetrecordids}

Single-record report end-point
GET /api/3/isheet/doctemplate/generatedocument/singlerecord/{doctemplateid}?isheetid={isheetid}&viewid={viewid}&isheetrecordid={isheetrecordid}

 

doctemplateid number iSheet doc template ID which is configured in the iSheet admin page
isheetid number ID of the iSheet
isheetrecordid number

isheetrecordid is necessary for single-record document

 

isheetrecordids String (CSV of iSheet record ids) This is an optional parameter. If the record ID was not found, all records will be returned in an exported file.
viewid number viewid (isheet view id) is necessary for a single-record document

 

Response:

If generating a document that is in progress

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<progressivekeyresponse>
    <progressivekey>{unique key}</progressivekey>
    <progressivekeystatus>INPROGRESS</progressivekeystatus>
</progressivekeyresponse><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<progressivekeyresponse>
    <progressivekeystatus>INPROGRESS</progressivekeystatus>
</progressivekeyresponse>

If generating a document that is now complete

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<progressivekeyresponse>
    <progressivekeystatus>DONE</progressivekeystatus>
    <downloadlink>https://local.com/sitepont/api/<apiversion>/isheet/doctemplate/generatedocument/110/download/key=13648</downloadlink>
</progressivekeyresponse>

Step 2 - Get progress key from Step 1 then check the progress key status

To download the generated doc template use the below end-point. The key can be found from the response in step 1.

GET /api/3/progressivekeystatus/{key}

Response:

If generating a document that is in progress

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<progressivekeyresponse>
    <progressivekeystatus>INPROGRESS</progressivekeystatus>
</progressivekeyresponse>

If generating a document that is now complete

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<progressivekeyresponse>
    <progressivekeystatus>DONE</progressivekeystatus>
    <downloadlink>https://local.com/sitepont/api/<apiversion>/isheet/doctemplate/generatedocument/110/download/key=13648<13648</downloadlink>
</progressivekeyresponse>

Response :  Binary stream of document

Response Code

Code Meaning
200 Document found
400 Problem with parsing XML or JSON object (Bad Request)
401 Unauthorised
403 Validation failed/ Forbidden
404 The document doesn't exist in the system
405 Method not allowed (calling API with the wrong method)
500 An internal error occurred while getting document content


Note : If the iSheet doc template is configured with the setting 'Download document' checked (this can be found in the add/edit manage document template page) then '<downloadlink> will be returned in the response.

Comments


9 Comments

Last Updated: Nov 08,2024