Mirror API Custom menu item voice trigger - google-glass

I am currently developing an app for Glass using the Mirro API.
An example of a call to Google is (Raw HTTP):
POST /mirror/v1/timeline HTTP/1.1
Host: www.googleapis.com
Authorization: Bearer auth token
Content-Type: application/json
Content-Length: length
{
"text": "Hello world",
"menuItems": [
{ "action": "DELETE" },
{
"action": "CUSTOM",
"id": "complete"
"values": [{
"displayName": "Complete",
"iconUrl": "http://example.com/icons/complete.png"
}]
}
}
This results in a new card on my timeline. After receiving it, I can say "OK Glass" to enter the voice menu (This is only available directly after receiving the card). However, I only see delete as an option in this menu. Is it possible to add my custom menu items to the voice menu?
General information can be found here: https://developers.google.com/glass/v1/reference/timeline/insert
I might have overlooked something.

Related

DocuSignAPI - Sign an envelope via API

We are creating an application that processes signed documents. As part of the testing process, I'd like to automate the creation and signing of sample documents. How can I sign the documents via postman?
Using the Postman scripts located at the DocuSign/blog, I can authenticate:
https://{{hostenv}}/restapi/{{apiVersion}}/login_information?api_password=true
{
"loginAccounts": [
{
"name": "Personal",
"accountId": "9",
"baseUrl": "https://demo.docusign.net/restapi/v2.1/accounts/9",
"isDefault": "true",
"userName": "Chris",
"userId": "",
"email": "",
"siteDescription": ""
}
],
"apiPassword": "="
}
and then create an envelope to be signed...
{{baseUrl}}/envelopes
{
"recipients": {
"signers": [
{
"email": "{{signer1Email}}",
"name": "{{signer1Name}}",
"recipientId": 1,
"tabs": {
"signHereTabs": [
{
"xPosition": "100",
"yPosition": "100",
"documentId": "1",
"pageNumber": "1"
}
]
}
}
]
},
"emailSubject": "DocuSign API - Signature Request on Document Call",
"documents": [
{
"documentId": "1",
"name": "blank1.pdf",
"documentBase64": "JVBERi0x..."
}
],
"status": "sent"
}
Is there a way - via postman - to sign the envelope that was just created?
I've been exploring a more involved setup (Selenium, etc) but was wondering if documents can be signed via postman.
As Inbar states, you can't automatically sign an envelope using the DocuSign API. One alternative is to Correct the envelope to change the Signer to a Carbon Copy recipient, which would immediately complete their role in the envelope.
You cannot sign envelopes via the REST API (or any other API).
You can use UI automation techniques to click things on the page and sign envelopes this way.
there's a similar question that was asked here, it has an answer from an automation expert who did this - DocuSign integration tests

How do I find which facebook messenger apps are linked with a facebook page through the facebook graph api?

I have been trying this out in the graph api explorer. Here are the steps I have been following:
Get a user access token with the permissions publish_actions, ads_management, manage_pages, publish_pages, pages_messaging, pages_messaging_phone_number, pages_messaging_subscriptions, pages_show_list, and user_events.
I GET the me/accounts endpoint and get this object:
{
"data": [
{
"access_token": "thisIsWhereTheAccessTokenGoes",
"category": "Shopping & Retail",
"category_list": [
{
"id": "200600219953504",
"name": "Shopping & Retail"
}
],
"name": "Some Page",
"id": "123456789",
"perms": [
"ADMINISTER",
"EDIT_PROFILE",
"CREATE_CONTENT",
"MODERATE_CONTENT",
"CREATE_ADS",
"BASIC_ADMIN"
]
}
],
"paging": {
"cursors": {
"before": "MTk1NDA4MDM2NDYyMDY5MAZDZD",
"after": "MTk1NDA4MDM2NDYyMDY5MAZDZD"
}
}
}
I copy the access token and page id from the above page object and paste it into the graph api explorer in the appropriate places.
I GET the endpoint {page-id}/subscribed_apps
I get this empty array:
{
"data": [
]
}
However if I go to my facebook app dashboard and go to the messenger settings and generate a page access token for the same page that I was getting in the graph api explorer, and then I paste that token into the explorer and get the {page-id}/subscribed_apps endpoint I actually get the app info that I was looking for. Something like this:
{
"data": [
{
"link": "https://www.facebook.com/games/?app_id=555555555555",
"name": "Test Messenger Bot",
"id": "555555555555"
}
]
}
I thought this could be because my app was in testing mode, but I tried to create a bot on chatfuel and linked it to the same facebook page and could not see that app listed under subscribed_apps either. I am thinking there is maybe some kind of permissions issue? I appreciate any help on this.

How can we get the phone number with Google OAuth API and facebook API used for social login?

How can we get the phone number with Google OAuth API login.
I am using scopes as
'scope' : 'https://mail.google.com https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/plus.login '
and the request is as
var request = gapi.client.plus.people.get({'userId': 'me'});
Is there any scope we can use to get it.
I am getting response as with no sight of phone number :
{
"kind": "plus#person",
"etag": "\"vPymIyv1bT9LfmoUujkgN2yLMK0\"",
"gender": "male",
"emails": [
{
"value": "XXX#gmail.com",
"type": "account"
}
],
"urls": [
{
"value": "http://picasaweb.google.com/XXX",
"type": "otherProfile",
"label": "Picasa Web Albums"
}
],
"objectType": "person",
"id": "4354354334435465",
"displayName": "XXXXX YYYY",
"name": {
"familyName": "XXX",
"givenName": "YYYYY"
},
"url": "https://plus.google.com/1100335464643327",
"image": {
"url": "https://lh3.googleusercontent.com/-fgsdgfgU9-jU/AAAAAAAAAAI/AAAAAAAADkM/fgffdgdkM/photo.jpg?sz=50",
"isDefault": false
},
"isPlusUser": true,
"language": "en",
"ageRange": {
"min": 21
},
"circledByCount": 59,
"verified": false
}
if you want to get user phone numbers you have to have authorization from the user: see the following info page : https://developers.google.com/admin-sdk/directory/v1/guides/authorizing
ask the user for this scope of authorization :
https://www.googleapis.com/auth/admin.directory.user.readonly
after you have authorization from user run the folowing request :
GET https://www.googleapis.com/admin/directory/v1/users/userKey
the response will be a JSON response formatted as followed:
https://developers.google.com/admin-sdk/directory/v1/reference/users#resource
one of the attributes is phone list.
hope it helps.
You can use google's people API to get the user's phone numbers.
To explore more you can try yourself.
Steps to explore:
Visit this link.
Select https://www.googleapis.com/auth/user.phonenumbers.read permission in People API v1 section
Click on Authorize API
Choose the account to log in
Grant permission
Click Exchange authorization code for tokens
Enter https://people.googleapis.com/v1/people/138262720636785143353?personFields=phoneNumbers,emailAddresses link, make sure you replace the UID
Click on send request to see the response

Mirror API Multiple OPEN_URI Intents not appearing on menu

The mirror api's menu items are only displaying 1 of two open URI intents.
Is there a way to get the behavior so that a user can own have two different URI_OPEN payloads on the same card?
I have it properly configured from this referenced question, but it only shows the first available OPEN_URI.
Menu Item for "OPEN_URI" not present in menuItems return
If 'fooApp' shows up first, it is the only one available but if 'barApp' appears first it is shown.
Returns
(Foo App, Reply, Delete)
OR
(Bar App, Reply, Delete)
but not Foo App, Bar App, Reply, Delete (desired)
"menuItems": [
{
"action": "OPEN_URI",
"id": "1",
"payload": "fooApp://",
"values": [{
"displayName": "Foo App",
"iconUrl":"http://www.image.com/x.png"
}]
},
{
"action": "OPEN_URI",
"id": "2",
"payload": "barApp://",
"values": [{
"displayName": "Bar App",
"iconUrl":"http://www.image.com/x.png"
}]
},
{"action": "REPLY"},
{"action": "DELETE"},
],
Both of your menu items seem to have the same id. Try using a different id value for each one.
I had a similar problem but enduring that the menu value had at least a DEFAULT state worked for me. This was mentioned by John Fontaine in his comments.

Get information about friends of friends using the graph API

I need to get some information about friends of friends of my user.
Specifically, I would like to get their name, age, picture, friends list, groups, interests, likes etc.
I'm fairly new to the whole FB API, and I'd be very thankful for any help.
Thanks. :)
Check out the Graph API Explorer.
It is basically a sandbox for building up api calls to get information about your users.
Here is an example of the request you can send off to Facebook and the response you can get back:
https://graph.facebook.com/<FBID>?fields=id,name,friends.fields(last_name)&method=GET&format=json&access_token=<ACCESS_TOKEN>
And the response:
{
"id": "<MY FBID>",
"name": "<MY NAME>",
"friends": {
"data": [
{
"last_name": "<FRIEND LAST NAME>",
"id": "<FRIEND FBID>"
},
{
"last_name": "<FRIEND LAST NAME>",
"id": "<FRIEND FBID>"
},
etc...