akeneo / pim-api-docs

Akeneo Web API documentation (contributions are welcomed!)
https://api.akeneo.com/
33 stars 70 forks source link

media-files POST for creation is not working #510

Open AkeneoUser opened 3 years ago

AkeneoUser commented 3 years ago

The form data looks ok to me and seems to comply with the specs of the media-files api, but I'm getting an error response.

invokehttp.response.body {"code":422,"message":"You should at least give one of the following properties: \"product\" or \"product_model\"."}

0x00000000 | 2D | 2D | 38 | 44 | 7A | 67 | 61 | 58 | 66 | 58 | 53 | 4C | 39 | 63 | 77 | 41 | --8DzgaXfXSL9cwA 0x00000010 | 41 | 41 | 65 | 4D | 74 | 66 | 69 | 43 | 59 | 45 | 66 | 43 | 35 | 4A | 59 | 56 | AAeMtfiCYEfC5JYV 0x00000020 | 68 | 64 | 6A | 6C | 57 | 66 | 4E | 76 | 64 | 67 | 0D | 0A | 43 | 6F | 6E | 74 | hdjlWfNvdg..Cont 0x00000030 | 65 | 6E | 74 | 2D | 44 | 69 | 73 | 70 | 6F | 73 | 69 | 74 | 69 | 6F | 6E | 3A | ent-Disposition: 0x00000040 | 20 | 66 | 6F | 72 | 6D | 2D | 64 | 61 | 74 | 61 | 3B | 20 | 6E | 61 | 6D | 65 | form-data; name 0x00000050 | 3D | 22 | 70 | 72 | 6F | 64 | 75 | 63 | 74 | 22 | 0D | 0A | 0D | 0A | 7B | 22 | ="product"....{" 0x00000060 | 69 | 64 | 65 | 6E | 74 | 69 | 66 | 69 | 65 | 72 | 22 | 3A | 22 | 53 | 47 | 36 | identifier":"SG6 0x00000070 | 39 | 30 | 32 | 32 | 53 | 50 | 22 | 2C | 20 | 22 | 61 | 74 | 74 | 72 | 69 | 62 | 9022SP", "attrib 0x00000080 | 75 | 74 | 65 | 22 | 3A | 22 | 69 | 6D | 61 | 67 | 65 | 5F | 61 | 22 | 2C | 20 | ute":"image_a", 0x00000090 | 22 | 73 | 63 | 6F | 70 | 65 | 22 | 3A | 6E | 75 | 6C | 6C | 2C | 22 | 6C | 6F | "scope":null,"lo 0x000000A0 | 63 | 61 | 6C | 65 | 22 | 3A | 6E | 75 | 6C | 6C | 7D | 0D | 0A | 2D | 2D | 38 | cale":null}..--8 0x000000B0 | 44 | 7A | 67 | 61 | 58 | 66 | 58 | 53 | 4C | 39 | 63 | 77 | 41 | 41 | 41 | 65 | DzgaXfXSL9cwAAAe 0x000000C0 | 4D | 74 | 66 | 69 | 43 | 59 | 45 | 66 | 43 | 35 | 4A | 59 | 56 | 68 | 64 | 6A | MtfiCYEfC5JYVhdj 0x000000D0 | 6C | 57 | 66 | 4E | 76 | 64 | 67 | 0D | 0A | 43 | 6F | 6E | 74 | 65 | 6E | 74 | lWfNvdg..Content 0x000000E0 | 2D | 44 | 69 | 73 | 70 | 6F | 73 | 69 | 74 | 69 | 6F | 6E | 3A | 20 | 66 | 6F | -Disposition: fo 0x000000F0 | 72 | 6D | 2D | 64 | 61 | 74 | 61 | 3B | 20 | 6E | 61 | 6D | 65 | 3D | 22 | 66 | rm-data; name="f 0x00000100 | 69 | 6C | 65 | 22 | 3B | 20 | 66 | 69 | 6C | 65 | 6E | 61 | 6D | 65 | 3D | 22 | ile"; filename=" 0x00000110 | 73 | 67 | 70 | 2D | 67 | 66 | 2D | 76 | 2D | 6E | 70 | 2E | 6A | 70 | 67 | 22 | sgp-gf-v-np.jpg" 0x00000120 | 0D | 0A | 43 | 6F | 6E | 74 | 65 | 6E | 74 | 2D | 54 | 79 | 70 | 65 | 3A | 20 | ..Content-Type: 0x00000130 | 61 | 70 | 70 | 6C | 69 | 63 | 61 | 74 | 69 | 6F | 6E | 2F | 6F | 63 | 74 | 65 | application/octe 0x00000140 | 74 | 2D | 73 | 74 | 72 | 65 | 61 | 6D | 0D | 0A | 0D | 0A | EF | BF | BD | EF | t-stream........ 0x00000150 | BF | BD | EF | BF | BD | EF | BF | BD | 00 | 18 | 45 | 78 | 69 | 66 | 00 | 00 | ..........Exif.. 0x00000160 | 49 | 49 | 2A | 00 | 08 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | II*............. 0x00000170 | EF | BF | BD | EF | BF | BD | 00 | 11 | 44 | 75 | 63 | 6B | 79 | 00 | 01 | 00 | ........Ducky... 0x00000180 | 04 | 00 | 00 | 00 | 3C | 00 | 00 | EF | BF | BD | EF | BF | BD | 04 | 0C | 68 | ....<..........h 0x00000190 | 74 | 74 | 70 | 3A | 2F | 2F | 6E | 73 | 2E | 61 | 64 | 6F | 62 | 65 | 2E | 63 | ttp://ns.adobe.c 0x000001A0 | 6F | 6D | 2F | 78 | 61 | 70 | 2F | 31 | 2E | 30 | 2F | 00 | 3C | 3F | 78 | 70 | om/xap/1.0/.<?xp 0x000001B0 | 61 | 63 | 6B | 65 | 74 | 20 | 62 | 65 | 67 | 69 | 6E | 3D | 22 | EF | BB | BF | acket begin="... 0x000001C0 | 22 | 20 | 69 | 64 | 3D | 22 | 57 | 35 | 4D | 30 | 4D | 70 | 43 | 65 | 68 | 69 | " id="W5M0MpCehi 0x000001D0 | 48 | 7A | 72 | 65 | 53 | 7A | 4E | 54 | 63 | 7A | 6B | 63 | 39 | 64 | 22 | 3F | HzreSzNTczkc9d"? 0x000001E0 | 3E | 20 | 3C | 78 | 3A | 78 | 6D | 70 | 6D | 65 | 74 | 61 | 20 | 78 | 6D | 6C | > <x:xmpmeta xml 0x000001F0 | 6E | 73 | 3A | 78 | 3D | 22 | 61 | 64 | 6F | 62 | 65 | 3A | 6E | 73 | 3A | 6D | ns:x="adobe:ns:m 0x00000200 | 65 | 74 | 61 | 2F | 22 | 20 | 78 | 3A | 78 | 6D | 70 | 74 | 6B | 3D | 22 | 41 | eta/" x:xmptk="A 0x00000210 | 64 | 6F | 62 | 65 | 20 | 58 | 4D | 50 | 20 | 43 | 6F | 72 | 65 | 20 | 35 | 2E | dobe XMP Core 5. 0x00000220 | 36 | 2D | 63 | 31 | 33 | 38 | 20 | 37 | 39 | 2E | 31 | 35 | 39 | 38 | 32 | 34 | 6-c138 79.159824 0x00000230 | 2C | 20 | 32 | 30 | 31 | 36 | 2F | 30 | 39 | 2F | 31 | 34 | 2D | 30 | 31 | 3A | , 2016/09/14-01: 0x00000240 | 30 | 39 | 3A | 30 | 31 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 22 | 3E | 20 | 09:01 "> 0x00000250 | 3C | 72 | 64 | 66 | 3A | 52 | 44 | 46 | 20 | 78 | 6D | 6C | 6E | 73 | 3A | 72 | <rdf:RDF xmlns:r 0x00000260 | 64 | 66 | 3D | 22 | 68 | 74 | 74 | 70 | 3A | 2F | 2F | 77 | 77 | 77 | 2E | 77 | df="http://www.w 0x00000270 | 33 | 2E | 6F | 72 | 67 | 2F | 31 | 39 | 39 | 39 | 2F | 30 | 32 | 2F | 32 | 32 | 3.org/1999/02/22 0x00000280 | 2D | 72 | 64 | 66 | 2D | 73 | 79 | 6E | 74 | 61 | 78 | 2D | 6E | 73 | 23 | 22 | -rdf-syntax-ns#" 0x00000290 | 3E | 20 | 3C | 72 | 64 | 66 | 3A | 44 | 65 | 73 | 63 | 72 | 69 | 70 | 74 | 69 | > <rdf:Descripti 0x000002A0 | 6F | 6E | 20 | 72 | 64 | 66 | 3A | 61 | 62 | 6F | 75 | 74 | 3D | 22 | 22 | 20 | on rdf:about="" 0x000002B0 | 78 | 6D | 6C | 6E | 73 | 3A | 78 | 6D | 70 | 4D | 4D | 3D | 22 | 68 | 74 | 74 | xmlns:xmpMM="htt 0x000002C0 | 70 | 3A | 2F | 2F | 6E | 73 | 2E | 61 | 64 | 6F | 62 | 65 | 2E | 63 | 6F | 6D | p://ns.adobe.com 0x000002D0 | 2F | 78 | 61 | 70 | 2F | 31 | 2E | 30 | 2F | 6D | 6D | 2F | 22 | 20 | 78 | 6D | /xap/1.0/mm/" xm 0x000002E0 | 6C | 6E | 73 | 3A | 73 | 74 | 52 | 65 | 66 | 3D | 22 | 68 | 74 | 74 | 70 | 3A | lns:stRef="http: 0x000002F0 | 2F | 2F | 6E | 73 | 2E | 61 | 64 | 6F | 62 | 65 | 2E | 63 | 6F | 6D | 2F | 78 | //ns.adobe.com/x 0x00000300 | 61 | 70 | 2F | 31 | 2E | 30 | 2F | 73 | 54 | 79 | 70 | 65 | 2F | 52 | 65 | 73 | ap/1.0/sType/Res 0x00000310 | 6F | 75 | 72 | 63 | 65 | 52 | 65 | 66 | 23 | 22 | 20 | 78 | 6D | 6C | 6E | 73 | ourceRef#" xmlns 0x00000320 | 3A | 78 | 6D | 70 | 3D | 22 | 68 | 74 | 74 | 70 | 3A | 2F | 2F | 6E | 73 | 2E | :xmp="http://ns. 0x00000330 | 61 | 64 | 6F | 62 | 65 | 2E | 63 | 6F | 6D | 2F | 78 | 61 | 70 | 2F | 31 | 2E | adobe.com/xap/1. 0x00000340 | 30 | 2F | 22 | 20 | 78 | 6D | 6C | 6E | 73 | 3A | 64 | 63 | 3D | 22 | 68 | 74 | 0/" xmlns:dc="ht 0x00000350 | 74 | 70 | 3A | 2F | 2F | 70 | 75 | 72 | 6C | 2E | 6F | 72 | 67 | 2F | 64 | 63 | tp://purl.org/dc 0x00000360 | 2F | 65 | 6C | 65 | 6D | 65 | 6E | 74 | 73 | 2F | 31 | 2E | 31 | 2F | 22 | 20 | /elements/1.1/" 0x00000370 | 78 | 6D | 70 | 4D | 4D | 3A | 4F | 72 | 69 | 67 | 69 | 6E | 61 | 6C | 44 | 6F | xmpMM:OriginalDo 0x00000380 | 63 | 75 | 6D | 65 | 6E | 74 | 49 | 44 | 3D | 22 | 75 | 75 | 69 | 64 | 3A | 36 | cumentID="uuid:6 0x00000390 | 35 | 45 | 36 | 33 | 39 | 30 | 36 | 38 | 36 | 43 | 46 | 31 | 31 | 44 | 42 | 41 | 5E6390686CF11DBA 0x000003A0 | 36 | 45 | 32 | 44 | 38 | 38 | 37 | 43 | 45 | 41 | 43 | 42 | 34 | 30 | 37 | 22 | 6E2D887CEACB407" 0x000003B0 | 20 | 78 | 6D | 70 | 4D | 4D | 3A | 44 | 6F | 63 | 75 | 6D | 65 | 6E | 74 | 49 | xmpMM:DocumentI 0x000003C0 | 44 | 3D | 22 | 78 | 6D | 70 | 2E | 64 | 69 | 64 | 3A | 38 | 31 | 34 | 44 | 36 | D="xmp.did:814D6 0x000003D0 | 37 | 35 | 37 | 34 | 39 | 46 | 37 | 31 | 31 | 45 | 37 | 41 | 34 | 38 | 46 | 41 | 75749F711E7A48FA 0x000003E0 | 42 | 34 | 37 | 39 | 36 | 44 | 44 | 33 | 44 | 33 | 34 | 22 | 20 | 78 | 6D | 70 | B4796DD3D34" xmp 0x000003F0 | 4D | 4D | 3A | 49 | 6E | 73 | 74 | 61 | 6E | 63 | 65 | 49 | 44 | 3D | 22 | 78 | MM:InstanceID="x 0x00000400 | 6D | 70 | 2E | 69 | 69 | 64 | 3A | 38 | 31 | 34 | 44 | 36 | 37 | 35 | 36 | 34 | mp.iid:814D67564 0x00000410 | 39 | 46 | 37 | 31 | 31 | 45 | 37 | 41 | 34 | 38 | 46 | 41 | 42 | 34 | 37 | 39 | 9F711E7A48FAB479 0x00000420 | 36 | 44 | 44 | 33 | 44 | 33 | 34 | 22 | 20 | 78 | 6D | 70 | 3A | 43 | 72 | 65 | 6DD3D34" xmp:Cre 0x00000430 | 61 | 74 | 6F | 72 | 54 | 6F | 6F | 6C | 3D | 22 | 41 | 64 | 6F | 62 | 65 | 20 | atorTool="Adobe 0x00000440 | 49 | 6C | 6C | 75 | 73 | 74 | 72 | 61 | 74 | 6F | 72 | 20 | 43 | 43 | 20 | 32 | Illustrator CC 2 0x00000450 | 30 | 31 | 37 | 20 | 28 | 4D | 61 | 63 | 69 | 6E | 74 | 6F | 73 | 68 | 29 | 22 | 017 (Macintosh)" 0x00000460 | 3E | 20 | 3C | 78 | 6D | 70 | 4D | 4D | 3A | 44 | 65 | 72 | 69 | 76 | 65 | 64 | > <xmpMM:Derived 0x00000470 | 46 | 72 | 6F | 6D | 20 | 73 | 74 | 52 | 65 | 66 | 3A | 69 | 6E | 73 | 74 | 61 | From stRef:insta 0x00000480 | 6E | 63 | 65 | 49 | 44 | 3D | 22 | 78 | 6D | 70 | 2E | 69 | 69 | 64 | 3A | 36 | nceID="xmp.iid:6 0x00000490 | 36 | 66 | 61 | 39 | 34 | 32 | 63 | 2D | 37 | 35 | 31 | 63 | 2D | 34 | 36 | 37 | 6fa942c-751c-467 0x000004A0 | 30 | 2D | 61 | 35 | 65 | 36 | 2D | 36 | 62 | 35 | 38 | 61 | 63 | 38 | 61 | 37 | 0-a5e6-6b58ac8a7 0x000004B0 | 32 | 39 | 63 | 22 | 20 | 73 | 74 | 52 | 65 | 66 | 3A | 64 | 6F | 63 | 75 | 6D | 29c" stRef:docum 0x000004C0 | 65 | 6E | 74 | 49 | 44 | 3D | 22 | 61 | 64 | 6F | 62 | 65 | 3A | 64 | 6F | 63 | entID="adobe:doc 0x000004D0 | 69 | 64 | 3A | 70 | 68 | 6F | 74 | 6F | 73 | 68 | 6F | 70 | 3A | 38 | 66 | 65 | id:photoshop:8fe 0x000004E0 | 33 | 30 | 33 | 30 | 35 | 2D | 39 | 32 | 36 | 31 | 2D | 31 | 31 | 37 | 61 | 2D | 30305-9261-117a- 0x000004F0 | 62 | 37 | 38 | 33 | 2D | 39 | 65 | 34 | 35 | 39 | 61 | 32 | 36 | 65 | 30 | 61 | b783-9e459a26e0a 0x00000500 | 32 | 22 | 2F | 3E | 20 | 3C | 64 | 63 | 3A | 74 | 69 | 74 | 6C | 65 | 3E | 20 | 2"/> 0x00000510 | 3C | 72 | 64 | 66 | 3A | 41 | 6C | 74 | 3E | 20 | 3C | 72 | 64 | 66 | 3A | 6C | <rdf:l 0x00000520 | 69 | 20 | 78 | 6D | 6C | 3A | 6C | 61 | 6E | 67 | 3D | 22 | 78 | 2D | 64 | 65 | i xml:lang="x-de 0x00000530 | 66 | 61 | 75 | 6C | 74 | 22 | 3E | 57 | 65 | 62 | 3C | 2F | 72 | 64 | 66 | 3A | fault">Web</rdf: 0x00000540 | 6C | 69 | 3E | 20 | 3C | 2F | 72 | 64 | 66 | 3A | 41 | 6C | 74 | 3E | 20 | 3C | li> </rdf:Alt> < 0x00000550 | 2F | 64 | 63 | 3A | 74 | 69 | 74 | 6C | 65 | 3E | 20 | 3C | 2F | 72 | 64 | 66 | /dc:title> </rdf 0x00000560 | 3A | 44 | 65 | 73 | 63 | 72 | 69 | 70 | 74 | 69 | 6F | 6E | 3E | 20 | 3C | 2F | :Description> </ 0x00000570 | 72 | 64 | 66 | 3A | 52 | 44 | 46 | 3E | 20 | 3C | 2F | 78 | 3A | 78 | 6D | 70 | rdf:RDF> </x:xmp 0x00000580 | 6D | 65 | 74 | 61 | 3E | 20 | 3C | 3F | 78 | 70 | 61 | 63 | 6B | 65 | 74 | 20 | meta> <?xpacket 0x00000590 | 65 | 6E | 64 | 3D | 22 | 72 | 22 | 3F | 3E | EF | BF | BD | EF | BF | BD | 00 | end="r"?>....... 0x000005A0 | 48 | 50 | 68 | 6F | 74 | 6F | 73 | 68 | 6F | 70 | 20 | 33 | 2E | 30 | 00 | 38 | HPhotoshop 3.0.8 0x000005B0 | 42 | 49 | 4D | 04 | 04 | 00 | 00 | 00 | 00 | 00 | 0F | 1C | 01 | 5A | 00 | 03 | BIM..........Z.. 0x000005C0 | 1B | 25 | 47 | 1C | 02 | 00 | 00 | 02 | 00 | 02 | 00 | 38 | 42 | 49 | 4D | 04 | .%G........8BIM. 0x000005D0 | 25 | 00 | 00 | 00 | 00 | 00 | 10 | EF | BF | BD | EF | BF | BD | 1F | EF | BF | %............... 0x000005E0 | BD | C8 | B7 | EF | BF | BD | 78 | 2F | 34 | 62 | 34 | 07 | 58 | 77 | EF | BF | ......x/4b4.Xw.. 0x000005F0 | BD | EF | BF | BD | EF | BF | BD | 00 | 0E | 41 | 64 | 6F | 62 | 65 | 00 | 64 | .........Adobe.d

AkeneoUser commented 3 years ago

--Ifb6p4_c_8njexJDDLKN7Waes5crz2-lNMB Content-Disposition: form-data; name="product"

{"identifier":"MY12200", "attribute":"display_product_image", "scope":null,"locale":null} --Ifb6p4_c_8njexJDDLKN7Waes5crz2-lNMB Content-Disposition: form-data; name="file"; filename="4812126_MYS_800x800.jpg" Content-Type: application/octet-stream