Can I extend the attributes field to another level 1 in the product request? I would like to receive a comment besides the name in the value field. Is there a way to get this field through expand?

Or do I have to make an additional request / create an additional attribute with the data so that I can receive it with a normal request?

UPD: Request after using expand = attributes.value

UPD2: The directories are additional and as you can see from the screenshot I have several attributes in the object, but none of them comes advanced.

  • Did the answer help you? If yes, please mark it as correct. - Trufanov Dmitrii 1:23 pm

1 answer 1

When prompted, specify? Expand = attributes.value, then the value field of the additional field will return completely (not just the meta and name).

https://online.moysklad.ru/api/remap/1.1/entity/product/ade4468e-4409-11e9-ac12-000d000000c0?expand=attributes.value

The answer will be

 "attributes": [ { "meta": { "href": "https://online.moysklad.ru/api/remap/1.1/entity/product/metadata/attributes/8b0bfb6c-459e-11e9-ac12-000d0000001f", "type": "attributemetadata", "mediaType": "application/json" }, "id": "8b0bfb6c-459e-11e9-ac12-000d0000001f", "name": "Π‘ΠΏΡ€Π°Π²ΠΎΡ‡Π½ΠΈΠΊ", "type": "customentity", "value": { "meta": { "href": "https://online.moysklad.ru/api/remap/1.1/entity/customentity/906e24fb-459d-11e9-ac12-000d00000018/795f38c1-459e-11e9-ac12-000d0000001c", "metadataHref": "https://online.moysklad.ru/api/remap/1.1/entity/companysettings/metadata/customEntities/906e24fb-459d-11e9-ac12-000d00000018", "type": "customentity", "mediaType": "application/json", "uuidHref": "https://online.moysklad.ru/app/#custom_906e24fb-459d-11e9-ac12-000d00000018/edit?id=795f38c1-459e-11e9-ac12-000d0000001c" }, "id": "795f38c1-459e-11e9-ac12-000d0000001c", "accountId": "56c92164-40d9-11e9-ac12-000a00000001", "updated": "2019-03-13 17:44:15", "name": "Π•Π΄ΠΈΠ½ΠΈΡ†Π°", "description": "ОписаниС Π΅Π΄ΠΈΠ½ΠΈΡ†Ρ‹", "externalCode": "O86DR1gHha9dNwBS-jW253" } } ] 
  • I apologize, I did, but the answer is still the same. Perhaps the fact is that there are no codes in the directory? Or is it that I have several attributes? Anyway, the answer is different. - Fedaikin 3:21 pm
  • Does the fact that the directory is additional to expand? - Fedaikin pm
  • Perhaps you are using the product id, which is visible in the main interface. In the API, the id of the goods is different. In this case, you get a redirect to id used in the API. But at the same time request parameters are lost and you receive the goods without expand. If this is so, then it will be seen in the answer - in the id field there will be a different value than in the request. - Trufanov Dmitrii