I’m looking to Return data from API in a certain json format.
Basically I have users with an “ID”, as well as a variable in user containing the users “duties” as a list, each with it’s own “ID”. How would I go about returning such that it looks like:
{
"users": {
"1": ["2142", "5235"],
"2": ["3241"].
"3": ["2944", "2314", "0323"]
}
}
This is what I have now but I don’t know how to move on from here…
From my understanding, it would be something like (search for users)-each items id, joined with said users duties list-each item id
I can’t get it to work…