question

pickyeater avatar image
pickyeater asked Jacob Abrams answered

GET Modifier Group's Item IDs without getting all Item details

When I call `GET` on `/modifier_groups`, the only way I know how to get the relationship between the modifier groups and their items is through `/modifier_groups?expand=items`.


This gives me what I need, but a lot more so -- the expanded items relationship contains a lot of information on the items, which makes it slightly slower and consumes more memory.


Is there a way to retrieve just the item IDs associated with the modifier groups? I expect that providing that data instead of the entire expansion would also be easier on Clover's database servers.

REST API
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jacob Abrams avatar image Jacob Abrams ♦♦ commented ·

Just to confirm, is the code issuing this http get running in a Clover device or elsewhere?

0 Likes 0 ·

1 Answer

·
Jacob Abrams avatar image
Jacob Abrams answered

Unfortunately there is no way to reduce the response to only item ids. Upon parsing the json response you can drop the data you don't need. You can also use limit and offset parameters to make multiple smaller requests if you are running very low on RAM while parsing the response.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community