Custom DocumentTemplate

Hello,

We want to show activities related to the contract in the activity tab through the API. Our approach is,

  1. Create a DocumentTemplate named contract with "type:Document" (docs.superoffice.com/List_DocumentTemplat
  2. For each activity (Sign, Decline, etc.) in the contract create a Document with the DocumentTemplate contract. (docs.superoffice.com/Document)

While we are executing the step 1 we have got the following error.

curl --location --request POST 'https://online2.superoffice.com/Cust25005/api/v1/List/DocumentTemplate/Items' \
--header 'X-XSRF-TOKEN: *************' \
--header 'Content-Type: application/json' \
--header 'Cookie: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--data-raw '{
"Name": "Contract",
"Tooltip": "Contract-Oneflow",
"RecordType": "Document"
}'

 

Reponse :

{
"Error": true,
"ErrorType": "Exception",
"Message": "Exception of type 'System.Exception' was thrown.",
"FriendlyMessage": null,
"ErrorSource": ""
}

Is our approach correct or do we have any other way to do it?

 

RE: Custom DocumentTemplate

You need to specify more of the doc template properties.

LoadTemplateFromPlugin - where should the template be stored?

- you can get a list of plugins from the api/v1/List/DocumentTemplate/Plugin

SaveInDb = 1

RecordType=2 (document)

AutoeventId = where documents will be stored = should be same as where the template is stored.

MimeType = "application/pdf" or something

 

Av: Christian Mogensen 26. jul 2021

RE: Custom DocumentTemplate

Hi,

When I try with the above-suggested method, it was worked fine thanks for your help. Also one of our customers got this kind of error message when going to create DocumentTemplate. What is this permission issue?
To create DocumentTemplate and Document, What kind of permissions user should have?

 
{
  "Message": "[SR_ACCESS_LEVEL_R]",
  "ErrorType": "UnauthorizedAccessException",
  "FriendlyMessage": null,
  "Error": true,
  "ErrorSource": "SuperOffice.Services.Implementation"
}