PUT Document/{id}
Some tooltip text!
• 14 minutes to read
• 14 minutes to read
PUT /api/v1/Document/{id}
Updates the existing DocumentEntity Save the document entity.
If the entity already exists and the file name of the incoming entity is different from the existing one, a corresponding renaming of the physical document will be attempted. This may cause an amended file name to be substituted into the document entity, since a document plugin may have aribitrary rules on file names and collisions. Clients should always inspect the return value from this call and not assume that what they sent for saving is the final truth.
Path Part | Type | Description |
---|---|---|
id | int32 | The DocumentEntity id to update. Required |
Query String Parameters
Parameter Name | Type | Description |
---|---|---|
$select | string | Optional comma separated list of properties to include in the result. Other fields are then nulled out to reduce payload size: "Name,department,category" Default = show all fields. |
PUT /api/v1/Document/{id}?$select=name,department,category/id
Request Headers
Parameter Name | Description |
---|---|
Authorization | Supports 'Basic', 'SoTicket' and 'Bearer' schemes, depending on installation type. |
X-XSRF-TOKEN | If not using Authorization header, you must provide XSRF value from cookie or hidden input field |
Content-Type | Content-type of the request body: application/json , text/json , application/xml , text/xml , application/x-www-form-urlencoded , application/json-patch+json , application/merge-patch+json |
Accept | Content-type(s) you would like the response in: application/json , text/json , application/xml , text/xml , application/json-patch+json , application/merge-patch+json |
Accept-Language | Convert string references and multi-language values into a specified language (iso2) code. |
SO-Language | Convert string references and multi-language values into a specified language (iso2) code. Overrides Accept-Language value. |
SO-Culture | Number, date formatting in a specified culture (iso2 language) code. Partially overrides SO-Language/Accept-Language value. Ignored if no Language set. |
SO-TimeZone | Specify the timezone code that you would like date/time responses converted to. |
SO-AppToken | The application token that identifies the partner app. Used when calling Online WebAPI from a server. |
Request Body: entity
The DocumentEntity to be saved.
Property Name | Type | Description |
---|---|---|
DocumentId | Integer | Primary key |
UpdatedBy | Associate | The person that last updated the appointment. |
CreatedBy | Associate | The person that first created the document. The property is read-only. |
Attention | String | Attention/salutation |
Header | String | Visible document name |
Name | String | File name |
OurRef | String | Our reference, searchable field from freetext search |
YourRef | String | Your reference |
CreatedDate | String | Registered when in UTC. |
UpdatedDate | String | Last updated when in UTC. |
Description | String | The actual text, max 2047 significant characters even though it is stored as a larger data type on some databases |
DocumentTemplate | DocumentTemplate | The template type of the document. |
Person | Person | A document may also be connected to a person; this must be a contact person registered on the current company. This does not mean however that a person is required. |
Associate | Associate | The owner of the document - the associate whose checklist the document is in. |
Contact | Contact | The contact associated with the document. It may also be null if no contact is associated with the document. |
Project | Project | A document may also be connected to a project, so you see the document both on the company card, and on the project card. This does not mean however that a project is required. |
Date | String | date + start time planned |
ExternalRef | String | External reference for document plugin to resolve document identity (Notes ID, e-mail message ID, whatever) |
Completed | String | Document Completed state. This is the part of the Status property. |
ActiveLinks | Integer | Number of active links to sale, document, appointment. |
Type | String | Is this a normal document or a mail-merge or report? |
Links | Array | List of all elements linked to the document. |
LockSemantics | String | |
Sale | Sale | A document may also be connected to a sale, so you see the document on the company card, on the project card and on the sale card. This does not mean however that a sale is required. May be null. |
SuggestedDocumentId | Integer | Suggested guide item that this document is an instance of (Note: NOT valid for appointments, they have their own link) |
Snum | Integer | The sequence number allocated from refcount on used template when creating the document |
UserDefinedFields | Object | Deprecated: Use {SuperOffice.CRM.Services.DocumentEntity.CustomFields} instead. Dictionary of user defined field data. The key string is the ProgId of the UdefField, or if the ProgId is empty it is a string of the format "SuperOffice:[UdefFieldIdentity]", e.g. "SuperOffice:1234" |
ExtraFields | Object | Deprecated: Use {SuperOffice.CRM.Services.DocumentEntity.CustomFields} instead. Extra fields added to the carrier. This could be data from Plug-ins, the foreign key system, external applications, etc. |
CustomFields | Object | Udef + Extra fields added to the carrier. Extra fields as defined by changes to database schema + user-defined fields as defined by admin. Custom fields combines user defined fields and extra fields into one bucket. The individual {SuperOffice.CRM.Services.DocumentEntity.ExtraFields} and |
PublishEventDate | String | Publish event date |
PublishTo | String | Publication valid to (inclusive) |
PublishFrom | String | Publication valid from (inclusive) |
IsPublished | Boolean | Publication is published |
VisibleFor | Array | The set of users or groups the record is visible for |
Response:
DocumentEntity updated.
Response | Description |
---|---|
200 | DocumentEntity updated. |
412 | Update stopped because DocumentEntity has changed since the requested If-Unmodified-Since timestamp. |
400 | Bad request. Entity to save is not in request body. |
Response body: DocumentEntityWithLinks
Property Name | Type | Description |
---|---|---|
DocumentId | int32 | Primary key |
UpdatedBy | Associate | The person that last updated the appointment. |
CreatedBy | Associate | The person that first created the document. The property is read-only. |
Attention | string | Attention/salutation |
Header | string | Visible document name |
Name | string | File name |
OurRef | string | Our reference, searchable field from freetext search |
YourRef | string | Your reference |
CreatedDate | date-time | Registered when in UTC. |
UpdatedDate | date-time | Last updated when in UTC. |
Description | string | The actual text, max 2047 significant characters even though it is stored as a larger data type on some databases |
DocumentTemplate | DocumentTemplate | The template type of the document. Use MDO List name "doctmpl" to get list items. |
Person | Person | A document may also be connected to a person; this must be a contact person registered on the current company. This does not mean however that a person is required. Use MDO List name "person" to get list items. |
Associate | Associate | The owner of the document - the associate whose checklist the document is in. Use MDO List name "associate" to get list items. |
Contact | Contact | The contact associated with the document. It may also be null if no contact is associated with the document. Use MDO List name "contact" to get list items. |
Project | Project | A document may also be connected to a project, so you see the document both on the company card, and on the project card. This does not mean however that a project is required. Use MDO List name "project" to get list items. |
Date | date-time | date + start time planned |
ExternalRef | string | External reference for document plugin to resolve document identity (Notes ID, e-mail message ID, whatever) |
Completed | string | Document Completed state. This is the part of the Status property. |
ActiveLinks | int32 | Number of active links to sale, document, appointment. |
Type | string | Is this a normal document or a mail-merge or report? |
Links | array | List of all elements linked to the document. |
LockSemantics | string | |
Sale | Sale | A document may also be connected to a sale, so you see the document on the company card, on the project card and on the sale card. This does not mean however that a sale is required. May be null. Use MDO List name "sale" to get list items. |
SuggestedDocumentId | int32 | Suggested guide item that this document is an instance of (Note: NOT valid for appointments, they have their own link) |
Snum | int32 | The sequence number allocated from refcount on used template when creating the document |
UserDefinedFields | object | Deprecated: Use {SuperOffice.CRM.Services.DocumentEntity.CustomFields} instead. Dictionary of user defined field data. The key string is the ProgId of the UdefField, or if the ProgId is empty it is a string of the format "SuperOffice:[UdefFieldIdentity]", e.g. "SuperOffice:1234" |
ExtraFields | object | Deprecated: Use {SuperOffice.CRM.Services.DocumentEntity.CustomFields} instead. Extra fields added to the carrier. This could be data from Plug-ins, the foreign key system, external applications, etc. |
CustomFields | object | Udef + Extra fields added to the carrier. Extra fields as defined by changes to database schema + user-defined fields as defined by admin. Custom fields combines user defined fields and extra fields into one bucket. The individual {SuperOffice.CRM.Services.DocumentEntity.ExtraFields} and UserDefinedFields properties are deprecated in favor of this combined collection. |
PublishEventDate | date-time | Publish event date |
PublishTo | date-time | Publication valid to (inclusive) |
PublishFrom | date-time | Publication valid from (inclusive) |
IsPublished | bool | Publication is published |
VisibleFor | array | The set of users or groups the record is visible for |
TableRight | TableRight | The carrier's table right |
FieldProperties | object | Field property dictionary mapping field names to field access rights. |
_Links | object |
Sample request
PUT /api/v1/Document/{id}
Authorization: Basic dGplMDpUamUw
Accept: application/json; charset=utf-8
Accept-Language: *
Content-Type: application/json; charset=utf-8
{
"DocumentId": 807,
"UpdatedBy": null,
"CreatedBy": null,
"Attention": "incidunt",
"Header": "nulla",
"Name": "Gottlieb, Graham and Jakubowski",
"OurRef": "excepturi",
"YourRef": "at",
"CreatedDate": "2016-07-18T14:13:48.8055889+02:00",
"UpdatedDate": "2009-09-03T14:13:48.8055889+02:00",
"Description": "Visionary reciprocal moderator",
"DocumentTemplate": null,
"Person": null,
"Associate": null,
"Contact": null,
"Project": null,
"Date": "2005-03-27T14:13:48.8055889+02:00",
"ExternalRef": "rerum",
"Completed": "Completed",
"ActiveLinks": 85,
"Type": "BookingForChecklist",
"Links": [
{
"EntityName": "Torphy-Quitzon",
"Id": 534,
"Description": "Exclusive assymetric hierarchy",
"ExtraInfo": "eum",
"LinkId": 322
},
{
"EntityName": "Torphy-Quitzon",
"Id": 534,
"Description": "Exclusive assymetric hierarchy",
"ExtraInfo": "eum",
"LinkId": 322
}
],
"LockSemantics": "Locking",
"Sale": null,
"SuggestedDocumentId": 885,
"Snum": 880,
"UserDefinedFields": {
"SuperOffice:1": "Benedict Hills",
"SuperOffice:2": "Josue Labadie"
},
"ExtraFields": {
"ExtraFields1": "aut",
"ExtraFields2": "eum"
},
"CustomFields": {
"CustomFields1": "pariatur",
"CustomFields2": "aut"
},
"PublishEventDate": "1998-01-09T14:13:48.8055889+01:00",
"PublishTo": "2025-01-25T14:13:48.8055889+01:00",
"PublishFrom": "2002-07-07T14:13:48.8055889+02:00",
"IsPublished": true,
"VisibleFor": [
{
"VisibleId": 208,
"Visibility": "All",
"DisplayValue": "enim"
},
{
"VisibleId": 208,
"Visibility": "All",
"DisplayValue": "enim"
}
]
}
Sample response
HTTP/1.1 200 DocumentEntity updated.
Content-Type: application/json; charset=utf-8
{
"DocumentId": 386,
"UpdatedBy": null,
"CreatedBy": null,
"Attention": "consequatur",
"Header": "perferendis",
"Name": "Douglas LLC",
"OurRef": "itaque",
"YourRef": "illo",
"CreatedDate": "2001-11-15T14:13:48.8212131+01:00",
"UpdatedDate": "2021-05-24T14:13:48.8212131+02:00",
"Description": "Open-source next generation definition",
"DocumentTemplate": null,
"Person": null,
"Associate": null,
"Contact": null,
"Project": null,
"Date": "2006-11-05T14:13:48.8212131+01:00",
"ExternalRef": "nulla",
"Completed": "Completed",
"ActiveLinks": 356,
"Type": "BookingForChecklist",
"Links": [
{
"EntityName": "Schmeler-Legros",
"Id": 728,
"Description": "Reduced logistical Graphical User Interface",
"ExtraInfo": "vel",
"LinkId": 608,
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 774
}
}
}
],
"LockSemantics": "Locking",
"Sale": null,
"SuggestedDocumentId": 954,
"Snum": 525,
"UserDefinedFields": {
"SuperOffice:1": "946686492",
"SuperOffice:2": "False"
},
"ExtraFields": {
"ExtraFields1": "quibusdam",
"ExtraFields2": "omnis"
},
"CustomFields": {
"CustomFields1": "sed",
"CustomFields2": "esse"
},
"PublishEventDate": "2005-10-03T14:13:48.8212131+02:00",
"PublishTo": "2009-02-20T14:13:48.8212131+01:00",
"PublishFrom": "2023-12-25T14:13:48.8212131+01:00",
"IsPublished": false,
"VisibleFor": [
{
"VisibleId": 63,
"Visibility": "All",
"DisplayValue": "eos",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 956
}
}
},
{
"VisibleId": 63,
"Visibility": "All",
"DisplayValue": "eos",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 956
}
}
}
],
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.String",
"FieldLength": 237
}
},
"_Links": {
"Self": "https://www.example.com/api/v1/project/321",
"Archive": "https://www.example.com/api/v1/project"
}
}