Do you need those two in the same retrieval OR one at a time? If it’s the latter then just find whatever you need in the resource classes (documentation).
If you need them in a single query then it’s a matter of selecting the resource which you want to start with (generally, it should be the one you plan to apply filters on - for example if you want to narrow down the machine names/products/etc) and then look into extending the class you are using with the available associations.
Here is an example that uses “Software Instances” resource to retrieve data filtered out to: (Publisher = Oracle OR Publisher = Sun) AND (Component contains “Java” OR Component contains “JDK”), and then using association properties to add usage & details on top of what is in the software instance resource only…Generally the associations are in the formation <associated_resource>.<name_of_property> format. Hope this helps you…
GET https://BFIURL:BFIPORT/api/sam/v2/software_instances?token=Some-Token;criteria={"and":[{"or":[["product_publisher_name", "=", "Oracle"], ["product_publisher_name", "=", "Sun"]]}, {"or":[["component_name", "contains", "java"], ["component_name", "contains", "jdk"]]}, ["is_present", "=", "1"]]};columns[]=computer_id;columns[]=computer_name;columns[]=product_publisher_name;columns[]=component_name;columns[]=component_detailed_version;columns[]=discovery_details.discovery_path;columns[]=usage_data.total_runs;columns[]=usage_data.last_used;columns[]=usage_data.avg_runs_per_day