REst Api insert prodct to special category

Hi,

i need to add some products into special categories. How should i get the correct categorie from REst API.

 

For example i have 2 categories called „Keyboards“ The category tree looks like:

Apple 

    • extensions
  • - - keyboards

HP

    • wired extensions
    • keyboards

I want to put a new product in Apple > extensions > Keyboards

From the API i get all Kategories, but how schould i use them?

Is there a best pratic how to do this?

Your script have to know the categoryID. Either you have a mapping table, you store the categoryID in your PIM. Or you look up the categories via api on the fly.