Back to Website
Show / Hide Table of Contents

AssetGenerator API

This API is used to create 3D mockups in the storage.

The Asset Generator service is designed to generate the following assets according to predefined specifications and parameters:

  • mockups
  • designs
  • images

Currently, only the generation of 3D mockups for packaging is supported.

Interactive API Docs

Tenant management

Asset generation is performed on behalf of a tenant. Therefore, the tenant is an integral part of the Asset Generator service. The ability to generate certain assets is determined by the tenant settings. To enable the packaging mockup generation, the AllowedSpecGroups array must contain the Packaging type.

Generation of mockups

3D mockups are generated according to the MockupSpecDto specifications from a backend library.

Since the values of all specification parameters are hard-coded, this API only allows you to read the available specifications and their parameters MockupSpecParamDto and apply them to mockups.

The 3D mockup generation is implemented through the following steps.

1. Get a specification

To get the list of all available specifications, use the endpoint GET /api/asset-generator/v1/mockups/specifications. To find a specification by name, use GET /api/asset-generator/v1/mockups/specifications/{name}.

This endpoint returns a list of supported parameters and the rules for filling them in. You can pass their values when generating a mockup or validating the parameters.

2. Validate input data

The data validation, including checking for a mockup with the specified name in Asset Storage, is performed before the generation by using the endpoint POST /api/asset-generator/v1/mockups/specifications/{name}/parameters/validate.

This helps you avoid re-generating the same drawing and skip generating for incorrect input data.

3. Generate a drawing

The drawing is generated based on the specification by using a backend solution and the endpoint [GET /api/asset-generator/v1/mockups/specifications/{name}/images/{imageName}](xref:backoffice/api/asset-generator#tag/mockupgenerator/GetSpecificationImage.

By default, the drawing contains only one element. For a composite box, for example, a box with a lid, the drawing will include two elements: one for the box and another for the lid.

Each drawing element can include the following files:

  • The main drawing file in the DXF format.
  • Optional 3D drawing file in the DXF format.
  • A file with information about bending lines (creases) in the CSV format.

4. Generate and save the mockup

The generation of a 3D mac is performed based on the drawing by using the endpoint POST /api/asset-generator/v1/mockups/generate.

The result of the generation is an M3D mockup file, which is saved in the Asset Storage. In the endpoint response, you can find the mockup ID, which can be used to download the M3D file from Assets Storage.

Api Clients

.Net Client

You can install it from Nuget as follows:

Install-Package Aurigma.AssetGenerator.ApiClient

See on Nuget

Angular Client

This client is compatible with Angular applications only. It won't work with NodeJS or other frontend JS frameworks. You can install the package to your Angular application as follows:

@aurigma/ng-asset-generator-client

See on npm

NodeJS Client (Axious)

This client can be used in a wide range of JavaScript applications. To make API calls, it uses Axios - a popular HTTP library. Although it is possible to use it in both frontend and backend projects, the primary target platform for this library is NodeJS.

Install the package as follows:

npm install @aurigma/axios-asset-generator-api-client

See on npm

PHP Client

PHP client for this API is coming soon.

BuildInfo

Provides information about the application, such as version, build date, etc.

HeadInfo

Returns build info.

Request
HEAD /api/asset-generator/v1/info
Responses
Status Code Type Description Samples
200

Success

Headers
X-Aurigma-Version string

A version number

X-Aurigma-Build-Date string

A build date (UTC)

X-Aurigma-Configuration string

A build configuration (Debug | Release)

X-Aurigma-App-Name string

A service name

X-Aurigma-Design-Atoms-Version string

An Aurigma.DesignAtoms version number

X-Aurigma-Design-Atoms-Model-Version string

An Aurigma.DesignAtoms.Model version number

GetInfo

Returns build info.

Request
GET /api/asset-generator/v1/info
Responses
Status Code Type Description Samples
200 BuildInfoModel

Success

MockupGenerator

Used to perform operations with mockup specifications.

GetAllSpecifications

Returns a list of all mockup specifications.

Request
GET /api/asset-generator/v1/mockups/specifications[?tenantId]
Parameters
Name In Type Default Notes
tenantId query

Tenant ID.

Responses
Status Code Type Description Samples
200 MockupSpecDto []

Success

401

Unauthorized

403

Forbidden

GetSpecification

Returns the mockup specification by name.

Request
GET /api/asset-generator/v1/mockups/specifications/{name}[?tenantId]
Parameters
Name In Type Default Notes
*name path

Specification name to search for.

tenantId query

Tenant ID.

Responses
Status Code Type Description Samples
200 MockupSpecDto

Success

404 ProblemDetails

Not Found

401

Unauthorized

403

Forbidden

GetSpecificationImage

Returns image of mockup specification by name.

Request
GET /api/asset-generator/v1/mockups/specifications/{name}/images/{imageName}[?tenantId]
Parameters
Name In Type Default Notes
*name path

Specification name.

*imageName path

Image name.

tenantId query

Tenant ID.

Responses
Status Code Type Description Samples
200 string

Success

404 ProblemDetails

Not Found

401

Unauthorized

403

Forbidden

GetSpecificationParameters

Returns parameters of mockup specification by name.

Request
GET /api/asset-generator/v1/mockups/specifications/{name}/parameters[?tenantId]
Parameters
Name In Type Default Notes
*name path

Specification name.

tenantId query

Tenant ID.

Responses
Status Code Type Description Samples
200 MockupSpecParamDto []

Success

404 ProblemDetails

Not Found

401

Unauthorized

403

Forbidden

ValidateSpecificationParameters

Validates the parameters of the mockup specification.

Request
POST /api/asset-generator/v1/mockups/specifications/{name}/parameters/validate[?tenantId]
Parameters
Name In Type Default Notes
*name path

Mockup specification name.

tenantId query

Tenant ID.

*body body object

Parameters of the mockup specification.

Responses
Status Code Type Description Samples
200 MockupSpecParamsValidationResultDto

Success

404 ProblemDetails

Not Found

401

Unauthorized

403

Forbidden

Generate

Generates a mockup file and saves it to the storage.

The tenant ID is required, it is obtained either from the query string or from the token.

Request
POST /api/asset-generator/v1/mockups/generate[?tenantId]
Parameters
Name In Type Default Notes
tenantId query

Tenant ID.

*body body MockupCreationModel

The model to create a mockup.

Responses
Status Code Type Description Samples
201 MockupGenerationResult

Created

400 BadRequestDto

Bad Request

409 ConflictDto

Conflict

401

Unauthorized

403

Forbidden

Tenants

Used to perform operations with tenants.

GetAll

Returns a list of all tenants.

Request
GET /api/asset-generator/v1/tenants
Responses
Status Code Type Description Samples
200 TenantDto []

Success

401

Unauthorized

403

Forbidden

Create

Creates a new tenant.

Request
POST /api/asset-generator/v1/tenants
Parameters
Name In Type Default Notes
*body body TenantCreationModel

The model to create a tenant.

Responses
Status Code Type Description Samples
201 TenantDto

Created

400 BadRequestDto

Bad Request

409 ConflictDto

Conflict

401

Unauthorized

403

Forbidden

Get

Returns a tenant by ID.

Request
GET /api/asset-generator/v1/tenants/{id}
Parameters
Name In Type Default Notes
*id path

Tenant ID.

Responses
Status Code Type Description Samples
200 TenantDto

Success

404 ProblemDetails

Not Found

401

Unauthorized

403

Forbidden

Update

Updates a tenant by ID.

Request
PUT /api/asset-generator/v1/tenants/{id}
Parameters
Name In Type Default Notes
*id path

Tenant ID.

*body body TenantUpdateModel

The model to create a tenant.

Responses
Status Code Type Description Samples
200 TenantDto

Success

400 BadRequestDto

Bad Request

409 ConflictDto

Conflict

404 ProblemDetails

Not Found

401

Unauthorized

403

Forbidden

Delete

Deletes a tenant by ID.

Request
DELETE /api/asset-generator/v1/tenants/{id}
Parameters
Name In Type Default Notes
*id path

Tenant ID.

Responses
Status Code Type Description Samples
200 TenantDto

Success

400 BadRequestDto

Bad Request

404 ProblemDetails

Not Found

401

Unauthorized

403

Forbidden

Definitions

BuildInfoModel

Model with information about the application.

Name Type Notes
version string

Version number.

buildDate string

Build date (UTC).

configuration string

Build configuration (Debug or Release).

appName string

Application name.

designAtomsVersion string

Aurigma.DesignAtoms version.

designAtomsModelVersion string

Aurigma.DesignAtoms.Model version.

MockupSpecDto

Name Type Notes
name string

Unique name.

group SpecGroupType

Group.

imageNames array

Image names.

licensed boolean

Indicates if a license is required.

SpecGroupType

Group.

Enum Values

Packaging

ProblemDetails

Name Type Notes
type string
title string
status integer (int32)
detail string
instance string

MockupSpecParamDto

Name Type Notes
name string

Short name.

alias string

Alias.

description string

Description.

type string

Data type (e.g. "float").

acceptableValues array

Set of acceptable values. Optional.

rules MockupSpecParamRulesDto

Parameter rules. Optional.

dependency object

Dependence on other parameters. Optional.

MockupSpecParamRulesDto

Parameter rules. Optional.

Name Type Notes
default string

Default value. Optional.

min string

Minimum value.

max string

Maximum value.

lessOrEqual array

Expression of "less than or equal to". Optional.

greaterOrEqual array

Expression of "greater than or equal to". Optional.

equal string

Expression of "equal to". Optional.

MockupSpecParamsValidationResultDto

Result of validation the parameters of the mockup specification.

Name Type Notes
isValid boolean

Indicates if the the parameters of the mockup specification are valid.

errorInfo string

Error information.

failedParameter MockupSpecParamDto[]

Failed specification parameter.

failedValue string

Failed value of the specification parameter.

MockupCreationModel

Model for creating a mockup.

Name Type Notes
specName string

Specification name.

specParameters object

Specification parameters.

mockupFileName string

Mockup file name.

mockupFilePath string

Path to the mockup file.

privateStorageOwner string

Storage owner for saving the mockup file in private storage. Optional. If the owner is not specified, the mockup file is saved in a public storage.

MockupGenerationResult

The result of generating the mockup file.

Name Type Notes
id string

ID.

name string

Name.

folderId string

Folder ID.

isPrivate boolean

Indicates if the mockup file is saved in the private storage.

privateStorageOwner string

Owner of the private storage in which the mockup file is saved. Optional. If the owner is not specified, the mockup file is saved in a public storage.

BadRequestDto

Information about a client error that caused the request not to be processed.

Name Type Notes
propertyName string

Name of a property with an invalid value.

propertyValue string

Invalid property value.

description string

Description of the reason for the client's error.

ConflictDto

Information about the conflict.

Name Type Notes
propertyName string

The name of the property that the conflict is associated with.

propertyValue string

Value of the property that the conflict is associated with.

description string

Description of the conflict.

TenantDto

Name Type Notes
id integer (int32)

Tenant ID.

allowedSpecGroups SpecGroupType[]

Allowed specification groups.

TenantCreationModel

Model for creating a tenant.

Name Type Notes
id integer (int32)

Tenant ID.

allowedSpecGroups SpecGroupType[]

Allowed specification groups.

TenantUpdateModel

Model for updating a tenant.

Name Type Notes
allowedSpecGroups SpecGroupType[]

Allowed specification groups.

Was this page helpful?
Thanks for your feedback!
Back to top Copyright © 2001–2024 Aurigma, Inc. All rights reserved.
Loading...
    Thank for your vote
    Your opinion is important to us. To provide details, send feedback.
    Send feedback