Create a new document
Description
Creates a new document.
Package Details
Interface
IDocumentManager
Syntax
Task Create<TDocument, TMetadata>(TDocument document, TMetadata metadata, string serviceRequestNameEnglish, string serviceRequestNameFrench, string documentVersion, int serviceRequestId, int userId);
Returns
Task
API Endpoint
Parameters
...
Parameter
...
Description
...
Parameter Type
Sample request body
Not applicable
Example
Code Block | ||
---|---|---|
|
Returns
On success, 200 Ok
On error, 400 Bad Request
On authorization error, 403 Forbidden
Example
Code Block | ||
---|---|---|
| ||
const string version = "1.0";
const int serviceRequestId = 100;
const int userId = 500;
// Initiate your data model with some basic data.
var document = new MyServiceRequestData()
{
DisplayNameEn = "displayNameEn",
DisplayNameFr = "displayNameFr"
};
// Provide some metadata that helps to describe this particular service request.
var metadata = new { MetaData = "metadata" };
// Create the "document" that will hold the data for your service request.
await documentManager.Create(document, metadata, document.DisplayNameEn, document.DisplayNameFr, version, serviceRequestId, userId); |