[webapi] Use pkgcmd to get pkgids for widget02

- Update pkgcmd to get pkgids, and need to update the awk rule