couldn't receive google glass notification after subscription? - google-glass

I have created a timeline card with menu item and subscribed the same.When i try it(clicked the menu item) from mirror api playground ,it shows notification send but my service couldn't receive any notification.Its not showing any sign of hitting my service log also.
Below is my subscription json.
{
"kind": "mirror#subscription",
"id": "timeline",
"updated": "2013-12-19T06:27:20.269Z",
"collection": "timeline",
"operation": [
"UPDATE"
],
"callbackUrl": "https://mirrornotifications.appspot.com/forward?url=http://192.xxx.xx.xxx:8080/GlassService/google/service/get_balance",
"verifyToken": "example_user",
"userToken": "email"
}
instead of ip address in the callback url i tried with localhost also.i got same result.
Please help me with this.
Thanks in advance.

Google subscription does not support local url or proxy. You have to submit public url with SSL support for callback Like "https://www.yourdomain.com/yourmethod".
Another way is, you can use "Introspected tunnels to localhost". then your local url become public and you will get notification after subscription.

Related

Authorize.net Accept Hosted Redirect Methods webhook response have responseCode 0

We are using Accept Hosted Redirect Methods for our payment.
Some transaction's webhook callback have responseCode 0.
But these transactions are listed as approved in ANET account.
In our webhook code , we are processing only the responses with responseCode 1.
But when we take the transaction details using the ANET PHP SDK(Method GetTransactionDetails ) , it returns response code as 1.
Can any one help us to identify why the responseCode parameter have value 0.
Response received via hook callback
{
"notificationId": "************",
"eventType": "net.authorize.payment.authcapture.created",
"eventDate": "2021-04-14T21:52:39.1188391Z",
"webhookId": "********************",
"payload": {
"responseCode": 0,
"authAmount": 115.00,
"merchantReferenceId": "******************",
"invoiceNumber": "**********",
"entityName": "transaction",
"id": "************"
}
}
During the day "2021-04-14T21:52:39.1188391Z" there is some update happens from the ANET Side. As per the feedback from the ANET Support team they are worked on the WEBHOOK section exactly on the same day

GMB MyBusiness API - How to set up real-time PubSub notifications?

I am working on integrating GMB into some of our internal apps, and would like to set up to receive real-time notifications for reviews and questions.
I have created a topic, and a subscription with a valid URL.
The next step is to tell GMB to send the notifications to the topic, and I believe the endpoint is the one below. However, it is very vague about the parameters it wants.
This is the documentation
https://developers.google.com/my-business/reference/rest/v4/accounts/updateNotifications
It wants a "Notification Settings Resource Name" in the URL, but it's not explained anywhere what that actually is. I have tried every possible value, but always get a 404 error response with the message "Requested entity was not found."
Has anyone successfully set this up? What values does the "getNotifications" endpoint want, and where in the various dashboards can this be found or created?
Any help is much appreciated!
As mentioned in the comments, you need to send the accountId as part of the URL.
To find this, you will first need to send a GET request to
https://mybusiness.googleapis.com/v4/accounts
This will return something along the following lines:
{
"accounts": [
{
"name": "accounts/102647145453118950380",
"accountName": "Tom Spencer",
"type": "PERSONAL",
"state": {
"status": "UNVERIFIED",
"vettedStatus": "NOT_VETTED"
},
"profilePhotoUrl": "//lh3.googleusercontent.com/a-/AOh14GgPkuJj03DeCa1isBAJALY4eOl09WGYVFrM4mG5=s132"
},
]
}
You can see here that accounts/102647145453118950380 is returned in the name field. Take this field, and construct the following URL:
https://mybusiness.googleapis.com/v4/accounts/102647145453118950380/notifications
Send a PUT request to this URL, with a request body resembling the following:
{
"topicName": "projects/{projectId}/topics/{topicId}",
"notificationTypes": [
"NEW_REVIEW",
"UPDATED_REVIEW"
]
}
Assuming you have pub/sub setup as per the documentation, this should send a message to your topic/subscribers whenever a new review is created or a review is updated.

Facebook Graph API get page_impressions

I've been using the graph api to get insights for our page. I log in, authorise and get a page access token. Recently, Facebook made it impossible to get any data without getting your app reviewed. I've managed to get my app reviewed with the following permissions:
manage_pages, email, read_insights, default:
These are found here: https://developers.facebook.com/docs/facebook-login/permissions/
This is my call:
https://graph.facebook.com/v3.0/me/insights/page_impressions_by_age_gender_unique
And this is the response:
{
"data": [
],
"paging": {
"previous":
"https://graph.facebook.com/v3.0/300196376675661/insights?access_token=xxx&pretty=0&metric=page_impressions_by_age_gender_unique&since=1532674800&until=1532847600",
"next": "https://graph.facebook.com/v3.0/300196376675661/insights?access_token=xxx&pretty=0&metric=page_impressions_by_age_gender_unique&since=1533020400&until=1533193200"
}
}
Are there additional permissions that I need to get in my app? Has anyone managed to get these insights?
Looking for these items:
[
("page_impressions_by_age_gender_unique", "day"),
("page_impressions", "day"), ("page_impressions_unique", "day"),
("page_impressions_paid", "day"),
("page_views_by_age_gender_logged_in_unique", "day")
]
This might help!
Your query should be like this =>
"<your_page_id>/insights?metric=page_impressions_by_age_gender_unique&accessToken=<your_page_access_token>"
Make sure to pass the Page Access Token, not user token.

Send push notification with Parse and a webservices with django

Is there some way to send push notifications using Parse and a web service built in Django? I mean, I have a dashboard built in django, in this dashboard I can set it up some parameters, when I create for example a new news, this has to be notified to the user through a push notifications. How can I achieve this?
See that page... https://www.parse.com/docs/rest/guide you should try make a request similar to this....every time you make some news
import json,httplib
connection = httplib.HTTPSConnection('api.parse.com', 443)
connection.connect()
connection.request('POST', '/1/classes/GameScore', json.dumps({
"score": 1337,
"playerName": "Sean Plott",
"cheatMode": False
}), {
"X-Parse-Application-Id": "${APPLICATION_ID}",
"X-Parse-REST-API-Key": "${REST_API_KEY}",
"Content-Type": "application/json"
})
results = json.loads(connection.getresponse().read())
print results

Get user email server-side facebook

So I want to get users email address with my server-side code.(I can get it on client side) My apps scope is set to:
"scopes":["public_profile","email"]}
What I'm able to-do at the moment is verify that the users token is valid. But I'd like to request the email as well - just to make sure on server side, that i can log the person in to my website.
I use this address to verify the token belongs to my app:
https://graph.facebook.com/debug_token?input_token=%REPLACE%&access_token=%REPLACE%
How should my request look like if I'd like to next ask for users email on server side?
Appears another option (once/if you know the token belongs to your app) is:
https://graph.facebook.com/me&access_token=USER_ACCESS_TOKEN
by default it only returns id, if you want more, ex email:
https://graph.facebook.com/me?fields=email&access_token=USER_ACCESS_TOKEN
which returns both id and email.
One solution is:
https://graph.facebook.com/v2.1/<user_id>?access_token=<your_app_access_token>
will return:
{
"id": "<id>",
"email": "mihkel\u0040gmail.ee",
"first_name": "Mihkel",
"gender": "male",
"last_name": "Lastname",
"link": "https://www.facebook.com/app_scoped_user_id/<id>/",
"locale": "en_US",
"name": "Mihkel Lastname"
}
if you need only email you can set fields=email parameter :)
You need USER ACCESS TOKEN to get user mail Id,
you can the access token from the response of API call
response.authResponse.accessToken;