Question

With the mirror api you are able to push cards to your subscribers. But how do you select the subscribers that should receive the card?

Is it possible at all? Or is it always broadcasting?

This link describes how to insert a card into the timeline. https://developers.google.com/glass/v1/reference/timeline/insert

But I don't really see how to select the users that should receive it.

The only parameter that fits is: recipients But what to provide here?

Thanks for your help.

Was it helpful?

Solution

In order to issue a Mirror API call, you need to make that call on behalf of a particular user. Which user you're acting on behalf of determines which timeline you will be able to send the card to. You're never "broadcasting" - you're always targeting a specific (or several specific - see below) user's timeline to work against.

You don't indicate which language or library you're using, but in general, each library takes an OAuth auth token as part of setting up the commands to execute. This is how you determine which user will receive the message. See https://developers.google.com/glass/develop/mirror/authorization#using_oauth_20_credentials for more details.

If you're trying to send the same thing to multiple users at once, you may be able to take advantage of command and auth batching to be a little more efficient. You should get basic auth (outlined above) working first, but you can see https://developers.google.com/glass/batch for more details.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top