Pim-community-dev: API - PATCH product content type

Created on 30 Mar 2017  路  3Comments  路  Source: akeneo/pim-community-dev

I'm reporting a Bug

Just updated to latest official 1.7 community.

API access is working, I can list and create products.
Using the PATHC method to update products I'm getting an error about the content type. Sending

PATCH /api/rest/v1/products HTTP/1.1
Host: myakeneo.test.it
Content-Type: application/json
Authorization: Bearer YjFkODg2MDRmNTgyNWE2Zjg4YjliMWE5MWI4ZDk1ODU5YjFjZjA1OGQ3MzA5Nzg3ZGNlM2ZlNDkxOWViOTI0YQ
Cache-Control: no-cache
Postman-Token: 2574016d-6a4f-efe1-0167-4f0cbfd547b8

{
"identifier": "testblu",
"enabled": true,
"family": null,
"categories": [
"originali_as400"
],
"groups": [],
"variant_group": null,
"values": {
"nome_articolo": [
{
"data": "test blu it as",
"locale": "it_IT",
"scope": "as400"
},
{
"data": "test blu it b2b",
"locale": "it_IT",
"scope": "acme_b2b"
}
]
},
"associations": []
}

I'm getting the error

{
"code": 415,
"message": "\"application/json\" in \"Content-Type\" header is not valid. Only \"application/vnd.akeneo.collection+json\" is allowed."
}

Trying with the reported "application/vnd.akeneo.collection+json" I get only "Syntax error"

Most helpful comment

Thanks to all, sorry for the wrong report.

All 3 comments

'+' sign?

The route used to update 脿 single product is not the good one. In your example, the route is used to update multiple products in one request (this route use a specific content).

If you want to update one product by request, please add the identifier at the end if your route.

/api/rest/v1/products/{identifier}

Thanks to all, sorry for the wrong report.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nowiko picture nowiko  路  6Comments

wakqasahmed picture wakqasahmed  路  4Comments

grabelle picture grabelle  路  3Comments

a2xchip picture a2xchip  路  5Comments

oliverde8 picture oliverde8  路  3Comments