Method CreateDocument
CreateDocument(String, DocumentContract, String, CreateDocumentOptionsContract)
Create a new document
Declaration
DocumentContract CreateDocument(string connectionId, DocumentContract document, string fileId, CreateDocumentOptionsContract options)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionId | The connection id to identify your connection. See also ConnectionId |
DocumentContract | document | Document to create |
System.String | fileId | File id to use. See also UploadFileBytes(String, String, Byte[], Int32) |
CreateDocumentOptionsContract | options | Optional: Additional options |
Returns
Type | Description |
---|---|
DocumentContract | The created document id |
Examples
POST http://YourServerName/InfoShare/Json/Document/CreateDocument
Example for create a document.{
"connectionId": "1fbe116a-20a9-4378-b198-6cf3283f0238",
"document": {
"Properties": [{
"PropertyTypeId": "f972ea44-17d0-e911-a93a-00155d290a08",
"Values": [null] }, {
"PropertyTypeId": "b398b135-17d0-e911-a93a-00155d290a08",
"Values": ["878"] }, {
"PropertyTypeId": "0086153f-c1cf-e911-a939-00155d290a08",
"Values": [null] }, {
"PropertyTypeId": "b76783b1-c1cf-e911-a939-00155d290a08",
"Values": [null] }, {
"PropertyTypeId": "69a14957-17d0-e911-a93a-00155d290a08",
"Values": [null] }, {
"PropertyTypeId": "2cdacc4e-15d0-e911-a93a-00155d290a08",
"Values": ["TestDocu"] }],
"Blogs": [],
"AccessRightsEnumList": [],
"Reminders": [],
"Abonnements": [],
"DocumentData": [],
"InfoStoreId": "e46bc061-b7cf-e911-a939-00155d290a08",
"ProtectionDomainId": "0100a000-38a7-11d8-a902-0050bf427e8f",
"Name": "TestDocu.pdf",
"ImportTemplateId": "54bdac99-17d0-e911-a93a-00155d290a08",
"LifeCycleManager": {
"NextLifeCycleStates": [],
"LifeCycleProtections": [],
"LifeCycleId": null } },
"fileId": "27f3c01d-790b-41fd-a02c-ae1a9ed4502f",
"options": {
"MergePropertiesIntoDocument": false,
"Comment": null,
"Version": null }
}
Response:
{
"CreateDocumentResult": {
"Abonnements": [],
"AccessRightsEnumList": ["CheckOut", "Delete", "EditAnnotation", "EditContent", "EditProperties",
"GrantAccessToOtherUsers", "Move", "SetSecurity", "OverwriteVersion", "ViewVersionLog", "ViewChangeLog",
"ViewAccessLog", "EditMultiple", "ChangeRequiredList", "CreateBlog", "DeleteBlog", "EditBlog", "ViewBlog",
"RemoveDocumentContent", "ExecuteApplication", "Export", "SendAsFax", "Print", "Send", "View"],
"AnnotationManager": {
"PostItAnnotations": [],
"RectangleAnnotations": [],
"StampAnnotations": [],
"TextAnnotations": [] },
"Blogs": [],
"CheckOutStateEnum": "NotCheckedOut",
"CheckOutUserId": "00000000-0000-0000-0000-000000000000",
"DocumentData": [{
"Id": "5ae393f3-9ddb-e911-a946-00155d290a08",
"Name": "TestDocu.pdf",
"Renditions": [{
"ContentProtections": [],
"Extension": "pdf",
"Files": [{
"BlobPath": "2019\\09\\20\\000\\000\\008TestDocu.pdf",
"BlobStoreId": "d26cc061-b7cf-e911-a939-00155d290a08" }],
"HashValue": [233, 222, 121, 140, 209, 122, 250, 95, 236, 231, 199, 209, 96, 251,
153, 154, 61, 242, 31, 149, 107, 253, 1, 120, 181, 43, 216, 128, 11, 220, 250, 125,
213, 223, 110, 48, 89, 142, 20, 49, 186, 222, 21, 26, 116, 96, 248, 239, 178, 215,
43, 182, 212, 203, 164, 74, 148, 1, 142, 225, 130, 43, 139, 31],
"Id": "68e393f3-9ddb-e911-a946-00155d290a08",
"PageCount": 0,
"Size": 6758707 }]
}],
"HasOverlay": false,
"Id": "02e293f3-9ddb-e911-a946-00155d290a08",
"ImportTemplateId": "54bdac99-17d0-e911-a93a-00155d290a08",
"InfoStoreId": "e46bc061-b7cf-e911-a939-00155d290a08",
"LifeCycleManager": {
"CheckOutLifeCycleStateId": null,
"LifeCycleEndDate": null,
"LifeCycleId": null,
"LifeCycleProtections": null,
"LifeCycleStartDate": null,
"LifeCycleStateId": null,
"NextAutomaticLifeCycleStateId": null,
"NextLifeCycleStates": [] },
"MainFileLength": 6758707,
"Name": "TestDocu.pdf",
"PageCount": 0,
"Properties": [{
"PropertyTypeId": "f972ea44-17d0-e911-a93a-00155d290a08",
"Values": [] }, {
"PropertyTypeId": "b398b135-17d0-e911-a93a-00155d290a08",
"Values": ["878"] }, {
"PropertyTypeId": "0086153f-c1cf-e911-a939-00155d290a08",
"Values": [] }, {
"PropertyTypeId": "b76783b1-c1cf-e911-a939-00155d290a08",
"Values": [] }, {
"PropertyTypeId": "69a14957-17d0-e911-a93a-00155d290a08",
"Values": [] }, {
"PropertyTypeId": "2cdacc4e-15d0-e911-a93a-00155d290a08",
"Values": ["TestDocu"] }, {
"PropertyTypeId": "01000008-38a7-11d8-a902-0050bf427e8f",
"Values": ["1"] }],
"ProtectionDomainId": "0100a000-38a7-11d8-a902-0050bf427e8f",
"Reminders": [],
"SigningProfileId": null,
"VersionId": "02e293f3-9ddb-e911-a946-00155d290a08" }
}
Exceptions
Type | Condition |
---|---|
ServiceException | The connection id {connectionId} isn't valid or has expired (10008) |
ServiceException | InfoStore not found {infoStoreId} (10018) |
ServiceException | Unknown data type for property type (10035) |
ServiceException | Protection domain not found {protectionDomainId} (10036) |
ServiceException | String was not recognized as a valid DateTime: {dateTimeValue}. Expected format {expectedFormat} (10059) |
ServiceException | InfoStore {infoStoreId} has no blob storage (10070) |
ServiceException | Property type not found {propertyTypeId} (10034) |
ServiceException | Timeout occured in method {methodName} (10116) |
ServiceException | Failure while inserting values into document (10117) |
ServiceException | Document is already a SAP document (10121) |
ServiceException | SAP property for repository not configured (10122) |
ServiceException | SAP property for sap document id not configured (10123) |
ServiceException | No SAP repository found (10124) |
ServiceException | Verification code is needed: Verification code not yet verified (10152) |
ServiceException | Not enough rights ({accessOperationName}, {accessOperationId}) (10071) |
ServiceException | Failure while inserting value: '{propertyTypeValue}' into propertyType: {propertyTypeId} (10190) |
ServiceException | Could not parse hexadecimal color code string {hexColorCodeString} to a valid ARGB value (10207) |
ServiceException | Property type {propertyTypeId} value is too long: {value} (10179) |
ServiceException | Document with Id {documentId} already exists (10234) |
ServiceException | File length validation failed (10247) |
ServiceException | HashValue validation failed (10248) |
ServiceException | PrimaryKey {primaryKeyPropertyId} was not provided (10340) |
ServiceException | Dossier {dosserId} already exists (10341) |
ServiceException | Unsupported FileType used for Dossier {extension} (10342) |
ServiceException | Property {propertyName} not provided for dossier file (10343) |