Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Task Update<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 bodyNot applicable.

Example

Code Block
languagejson

Returns

On success, 200 Ok

On error, 400 Bad Request

On authorization error, 403 Forbidden

Example

Code Block
languagec#c#
public class MyServiceRequestData
{
     public string DisplayNameEn { get; set; }
     public string DisplayNameFr { get; set; }
     public string DataFieldA { get; set; }
}  

const int userId = 100;
const int serviceRequestId = 100;
// Provide some metadata that helps to describe this particular service request.
var metadata = new { MetaDataFieldA = "test" };
     
// Retrieve the service request document.
//This function accepets a generic parameter, it's not limited to MyServiceRequestData
const int serviceRequestId = 100;
var serviceRequest = await documentManager.Get<MyServiceRequestData>(serviceRequestId);

// Update the service request document with some new data.
serviceRequest.DataFieldA = "Test 123";

// Update the service request document.
await _documentManager.Update(serviceRequest, metadata, serviceRequest.DisplayNameEn, serviceRequest.DisplayNameFr, "1.1", serviceRequestId, userId);