I think assigning SAM templates via the API is not currently supported. We use dynamic groups and assign the template to the group. If you find a way to assign either templates, or create components under a template with the API I would be very interested.
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 150,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process. Learn more today by joining now.