Create From JSON
Description
Create an artifact from JSON payload.
Package Details
Interface
IArtifactManager
Syntax
Task<ArtifactInfo> CreateFromJson(string artifact, ArtifactType artifactType, string documentVersion, int serviceRequestId, int userId);
Returns
Task<ArtifactInfo>
API Endpoint
[POST] /api/v1/artifacts
Parameters
Parameter | Description | Parameter Type |
---|---|---|
serviceRequestId | Service request id | Query string |
artifactType | An artifact type.
| Query string |
version | Version number | Query string |
userId | Current user id | Query string |
artifact | Artifact information (JSON payload) | Request body |
Returns
On success, 200 Ok
On error, 400 Bad Request
On authorization error, 403 Forbidden
Example
const int serviceRequestId = 100; const ArtifactType artifactType = ArtifactType.JsonDocument; const string version = "1.0"; const int userId = 100; const string artifact = "{\"Rk\": \"L - 1\",\"Gcar\": \"G - 467\",\"Gtm\": \"M - 1\",\"Date\": \"Apr 6\",\"Tm\": \"CLE\",\"Where\": \"@\",\"Opp\": \"HOU\",\"Rslt\": \"L0 - 2\"}"; var artifact = await ArtifactManager.CreateFromJson(artifact, artifactType, version, serviceRequestId, userId);