How does the /widgets/12
form allow guests to read the widgets—or allow users to read the widgets of other users? Or are you planning on implementing multiple forms?
Personally, I would do something like:
/widget/id:12/user:665
/widget/12/665
/widget/12?user=665
Ultimately though, the URL doesn't matter unless this is going to be something that users are gonna want to access directly. If it's just a location to an embeddable script, data feed, or some other type of service, then you can use any URL you want, in which case I'd just go with something like:
/widget?id=12&uid=665
Edit:
I prefer to just serve the widget under /widget
since that is what the resource is. I assume that the user-widget relationship is implied by the type of widget it is. So adding users
into the path hierarchy is unnecessary.
Now, if you wanted people to be able to browse the widgets of a particular user, then the /users/34/widgets/12
form would be preferable.