2

I need help in creating products in akeneo product api usi api call. when i add product in that api It always give error "This value should not be blank." I have changed all the parameters given in the documentation but with no result

parameters {
    "identifier": "AT-TN-136-B-NCAL",
    "enabled": true,
    "family": "camcorders",
    "categories": [
        "master"
    ],
    "groups": [],
    "parent": null,
    "values": {},
    "associations": {}
}

result
{
    "code": 422,
    "message": "Validation failed.",
    "errors": [
        {
            "property": "identifier",
            "message": "This value should not be blank."
        }
    ]
}
EzLo
  • 13,780
  • 10
  • 33
  • 38
Expinator
  • 21
  • 3

1 Answers1

0

There is a key:value pair probably missing inside your parameters.

Try using the akeneo api with Postman to see the in and outs for the api.

Link to api docs => https://api.akeneo.com/getting-started/your-first-tutorial-4x/welcome.html

Here is an example i took trough postman, it might give you a better look at how an api Product Post should look.

{
  "identifier": "new_product",
  "family": "tshirts",
  "groups": [],
  "parent": null,
  "categories": [
    "tvs_projectors"
  ],
  "enabled": true,
  "values": {
    "clothing_size": [
      {
        "locale": null,
        "scope": null,
        "data": "s"
      }
    ],
    "description": [
      {
        "locale": "en_US",
        "scope": "mobile",
        "data": "Akeneo T-Shirt"
      },
      {
        "locale": "en_US",
        "scope": "print",
        "data": "Akeneo T-Shirt with short sleeve"
      }
    ],
    "main_color": [
      {
        "locale": null,
        "scope": null,
        "data": "black"
      }
    ],
    "name": [
      {
        "locale": null,
        "scope": null,
        "data": "Akeneo T-Shirt black and purple with short sleeve"
      }
    ],
    "secondary_color": [
      {
        "locale": null,
        "scope": null,
        "data": "purple"
      }
    ],
    "tshirt_materials": [
      {
        "locale": null,
        "scope": null,
        "data": "cotton"
      }
    ],
    "tshirt_style": [
      {
        "locale": null,
        "scope": null,
        "data": [
          "crewneck",
          "short_sleeve"
        ]
      }
    ],
    "price": [
      {
        "locale": null,
        "scope": null,
        "data": [
          {
            "amount": 10,
            "currency": "EUR"
          },
          {
            "amount": 14,
            "currency": "USD"
          }
        ]
      }
    ]
  },
  "created": "2017-03-30T14:55:26+02:00",
  "updated": "2017-05-04T23:56:09+02:00",
  "associations": {
    "SUBSTITUTION": {
      "groups": [],
      "products": [
        "AKNSTK"
      ]
    }
  }
}
Keutelvocht
  • 670
  • 2
  • 10
  • 28