Add or update multiple attributes for a product

How to add or update multiple attributes for a product in one request using Management API

Bluestone PIM has several attribute types that can be added to a product.

Read more about attributes in Bluestone PIM.

This endpoint to update multiple attributes supports all types except column and matrix.

URL

PUT https://api.bluestonepim.com/pim/products/{id}/attributes

Add multiple attributes to a product

Use the Bluestone product GUID as the {id} in the request. See this article if you need to find the id.

Request body

[
    {
        "definitionId": "5da7254de21b84000c6ed075",
        "value": "Example of a text value"
    },
    {
        "definitionId": "5f59cf80cff47e000c2ea630",
        "dictionaryValueIds": [
            "609e422dd60180000ce25ae3",
            "5f59cf80d60180000cb8c29d"
        ]
    },
    {
        "definitionId": "5db038d4590801000caa534e",
        "selectValueIds": [
            "5db038d4590801000caa534a",
            "5db038d4590801000caa534b"
        ]
    }
]

In this example request, three attributes are added to the product. Each attribute has a definitionId, see this article if you need to find the id

The first attribute in this request is a simple text type where the value can be set as a string. 

The second attribute is a dictionary type. This requires a list of dictionary option id's

The third attribute is a multi select type. This requires a list of select option id's which can be found in the attribute definition

Response

If successful, this will result in a 204 - No Content response. 

The request will fail with a 400 - Bad Request if there is anything wrong with the format or content of the body. In that case, no attributes will be added or updated for the product. 

Try it in readme.io