Alias Layer REST Endpoint

CRUD support for alias layers is now available through the REST api.

This blog post describes how to use it.

Create an alias layer

Creating a new alias layer requires 2 pieces of information:

  • the name of the layer
  • a list of product aliases with the product number and the aliases
POST /alias-layers

{
        "name": "Test",
        "productAliases": [
            {
              "productNumber": "1",
                "nameAlias": "alternative product name",
                "descriptionAlias": "alternative description"
            },
            {
                "productNumber": "2",
                "nameAlias": "alternative product name",
                "descriptionAlias": "alternative description"
            }
        ]
}

A successful response would contain the newly created resource, with the generated aliasLayerNumber.

Update an alias layer

The alias layer can be updated by issuing a PUT request using the aliasLayerNumber and the updated alias layer in the body of the request:

PUT /alias-layers/:aliasLayerNumber

The list of product aliases can be modified in this way.

Delete an alias layer

DELETE /alias-layers/:aliasLayerNumber

Alias layers with defined product aliases cannot be deleted.

Create / Update / Delete product aliases

It is also possible to use CRUD operations directly on the product aliases:

POST /alias-layers/:aliasLayerNumber/product-aliases/
PUT /alias-layers/:aliasLayerNumber/product-aliases/:productNumber
DELETE /alias-layers/:aliasLayerNumber/product-aliases/:productNumber
GET /alias-layers/:aliasLayerNumber/product-aliases/:productNumber

The create method can both handle creating one product alias by using one object in the body and multiple by using an array as shown here:

POST /alias-layers/:aliasLayerNumber/product-aliases/

[
    {
        "productNumber": "1",
        "nameAlias": "alternative product name",
        "descriptionAlias": "alternative description"
    },
    {
        "productNumber": "2",
        "nameAlias": "alternative product name",
        "descriptionAlias": "alternative description"
    }
]

For additional information, please refer to the API docs or contact us at api@reviso.com.