Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Create an artifact document

Description

The Create() method is used to create artifact documents. The current types of documents that can be created are:

  • JsonMetadata

  • JsonDocument

  • SignedJsonDocument

Package Details

Interface

IArtifactManager

Syntax

_artifactManager.Create<T>(T artifact, ArtifactType artifactType, string documentVersion, int serviceRequestId, int userId)

Returns

MTOA.DomainObjects.ArtifactInfo

API

[POST] /api/v1/artifacts

  • serviceRequestId: [Integer]- A service request id.

  • artifactType: [ArtifactType]- An artifact type. Possible values are:
    o Image = 1,
    o Pdf = 2,
    o JsonMetadata = 3,
    o JsonDocument = 4,
    o SignedJsonDocument = 5,
    o None

  • version: [String] - version number.

  • userId: [Integer] - current user id.

  • artifact: [string] - artifact information

Returns

HTTP 200 OK if successful, 401 if unauthorized, 400 otherwise.

Example

using MTOA.BLL.Interfaces;

string MyDocumentVersion = "MySrv_1.0.0";
int serviceRequestId = 12345;

var signature = new DTO.ESignature
{
    UserId = CurrentUser.Id.ToString(),
    FirstName = CurrentUser.FirstName,
    LastName = CurrentUser.LastName,
    SignatureDateTime = DateTime.Now,
    IpAddress = WebRequestExtension.GetUserIPAddress(),
    HostName = WebRequestExtension.GetHostName(),
    BrowserDetails = WebRequestExtension.GetBrowserDetails()
};

await _artifactManager.Create( signature, ArtifactType.SignedJsonDocument, MyDocumentVersion, serviceRequestId, CurrentUser.Id);


  • No labels