Share printer with Google API Service Account
As you yourself shared the printer with the service account, we can assume you know the "Printer ID" of the printer to which the service account has been invited.
Have the service account call the /processinvite
request, with these (mandatory) parameters:
printerid
= the-known-printer-idaccept
=true
After that, the printer will appear in /search
Happy printing!
I believe you are encountering the "is pending" problem.
Namely, you did share your printer with the [email protected] account but the other user (in this case [email protected]) has to accept the invitation to share the printer.
You can check this by issuing the /print
request and you will see an
"is_pending": true
element in the access
section for your user ([email protected]) in this case.
Needless to say that accounts that have this element set to true cannot print - hence the "User is not authorized." message.
I know no way to accept the invitation for the given service account however there is a workaround:
- You can create a private google group with an account that can accept shared printers (e.g. your gmail account).
- Then you add the service account ("[email protected]") to the group et voila. You can print with the service account ;).
When you share the printer you must share it with the google group (use the group's email address which you can find somewhere in the group management console) and the group manager (e.g. your gmail account) must accept the invitation for the whole group.
More info on how to create the group can be found here.
I have tried this with a GAE service account and it works. If you need any clarification do not hesitate to ask. Good luck.