Mirror API - status of whether a user has their account enabled for Mirror API / owns Glass - google-mirror-api

Is it possible to check via MirrorAPI if a user actually owns Glass or if their account has the Mirror API functionality enabled?

There is currently (As of XE10) no way to do this. It is, however, a requested feature, so you may wish to star https://code.google.com/p/google-glass-api/issues/detail?id=107 to register your desire for the feature and to follow progress on it.
The suggestion there, and in other related SO questions, is to do a double-opt-in with the welcome card. This continues with the best practice of creating a welcome card, and also gives it a use to verify that the person can see it.

I think I also read in the mirror api docs, that a user cannot enable the mirror api if they are not a glass explorer: (right under step 2 on https://developers.google.com/glass/quickstart/php):
During this stage of the Mirror API Developer Preview, the API is only available to developers who have Glass as part of the Explorer Program.
If you are not an Explorer with Glass, the toggle is not displayed and you cannot enable the Mirror API.

Related

What is the google pay equivalent of Apple Pay canMakePayments() method?

I want to see if there is a way to quickly check on the mobile web on chrome whether or not a user has Google Pay enabled. On IOS, I can call window.ApplePaySession.can make payments() method on safari dev tools to instantly know if the user has apple pay enabled.
Is there an equivalent code snippet I can call on Chrome dev tools to figure out if the user has Google pay enabled? I don't need to be able to make a transaction or anything complicated, I just need to know if a user has that functionality enabled.
As far as my research, I found that window.PaymentRequest(methodData).canMakePayments() should do the trick, but the problem with that route is that methodData needs information such as the merchant ID and merchant name, which I don't have. On apple's side, I do need that info to make a transaction, but I don't need it to simply check if apple pay is possible. Is there a way (maybe similar to the previous code snippet I shared) to ask the browser if Google pay is enabled without providing extra info such as merchant ID?
Google Pay has a similar functionality to determine the readiness of the payment method to Apple Pay. Though it is not simple as finding out in Apple Pay, you had to set some data to determine the readiness as given in the link - https://developers.google.com/pay/api/web/guides/tutorial#isreadytopay
However, you do not require any explicit requirement of Merchant ID here to fulfil this isReadyToPay API.

Google smart home action : where to trigger a requestSync?

I created a smart home action and I have to implement the requestSync feature for certification.
But I don't understand from where to call it : from my backend fulfillment ? or from elsewhere ?.
In the documentation, I saw :
You must trigger a SYNC request:
- If the user adds a new device.
- If the user removes an existing device.
- If the user renames an existing device.
- If you implement a new device type, trait, or add a new device feature.
But all these user interactions are from the Google side (in the Google Home app), so I don't understand why Google doesn't trigger the sync itself, and how could my backend know that the user changed something ?
Can someone help me with this feature ?
Thank you !
But I don't understand from where to call it : from my backend fulfillment ? or from elsewhere ?
It definitely should come from backend.
But all these user interactions are from the Google side (in the Google Home app), so I don't understand why Google doesn't trigger the sync itself, and how could my backend know that the user changed something ?
This isn't a case to use the "requestSync". And your backend doesn't need to know about it if your users operate their devices from Google Home app
Here I will explain some example use case for you.
Imagine that you have your own application for controlling your devices. Then you develop the smarthome action project to make your device be able to controlled over voice. When your devices are linked with HomeGraph and you change your device's name, add or remove it from your own application. This is the time that your backend system should make "requestSync".
Even if your system doesn't allow user to make such of those changes on the device unless using Google Home app, google requires your system to be able to send them the "requestSync" for the case that when you "Implement a new device type, trait, or add a new device feature". This is the way that allows you(as developer) to update your users' devices without them(your users) unlinking and relinking their account.
And if you are not clear about "Implement a new device type, trait, or add a new device feature". Just thinking of case that you want to add more traits for your devices and you want to make update on all devices that has been linked before to be able to use a functionality from your new trait. You will need "rquestSync"
Hope this help. Goodluck :)

Is there any way to get the user SERVER banner in discord.js

I want to get the user server banner but i dont know if thats possible with discord.js is there any way i get get the banner the user sets for a server?
Im using discord.js v13, and found that the url for getting the user server banner is
https://cdn.discordapp.com/guilds/{GuildId}/users/{MemberId}/banners/{Banner}
I just dont know how to get the banner name.
I do not believe this is possible yet. Looking at the Discord API itself, it does not appear to support server profiles yet. It isn't possible to retrieve a member's server profile banner via the API (or at least, it isn't officially possible and any way to do so isn't documented). And since the API itself doesn't support it, it's probably not possible to do this at all yet.
You can retrieve the user's global banner via API or djs, but not their server-specific banners. Unless you know the name of the banner already, the URL you provided in your question won't do you much good either.
See for yourself in the API docs for guild members. No server profile or banner properties to be found. Same goes for djs' GuildMember object as well, of course, since there is no API support. You will just have to wait for the Discord API to be updated to support this, if they plan to do so; it's been at least 4-5 months now since the feature released, though, so support may not be coming anytime soon.

Salesforce: How to automate report extraction as JSON/CSV

I am new to Salesforce, but am an experienced developer. I am provided a link to a Salesforce report, which mostly has the right filters (query). I would like to use an REST API to pull that information as CSV or JSON so that I can do further processing on it.
Here are my questions:
Do I need special permissions to make API calls? What are they?
Do I need to create an "app" with client-key & secret? Does my admin need to grant me permission for this too?
There are a lot of REST APIs from Salesforce, which one do I need to get the info from the report? Analytics?
How do I authenticate in code?
You'd have to work with the System Administrator on the security pieces. Anybody who knows how the company works, can all users see everything, is there Single Sign-On in place, how likely is the report to change...
You will need an user account to pull the data. You need to decide if it'll be some "system account" (you know username and password and have them stored in your app) or can it run for any user in this org. It might not matter much but reports are "fun". If there will be data visibility issues 6 months from now, you'll be asked to make sure the report shows only French data to French users etc... you can make it in report filters or have multiple reports - or you can just use current users access and then it's the sysadmin that has to set the sharing rules right. (would you ever think about packaging what you did and reusing in another SF instance? Making a mobile app out of it? Things like that, they may sound stupid now but will help you decide on best path)
The user (whether it'll be system account or human) needs Profile permissions like "API Enabled" + whatever else you'd need normally ("Run Reports" etc). If you're leaning towards doing it with system user - you might want to look at Password Policies and maybe set password to Never Expires. Now this is bit dangerous so there would be other things you might want to read up about: "API only user" (can't login to website), maybe even locking down the account so it can login only from certain IP ranges or at certain times when the job's supposed to be scheduled...
Connected App and OAUth2 stuff - it's a good idea to create one, yes. Technically you don't have to, you could use SOAP API to call login, get session id... But it's bit weak, OAuth2 would give you more control over security. If you have sandboxes - there's little-known trick. You can make connected app in production (or even totally unrelated Developer Edition) and use client id & secret from it to login to sandboxes. If you create app in sandbox and you refresh it - keys stop working.
(back to security piece - in connected app you can let any user allow/deny access or sysadmin would allow only say these 3 users to connect, "pre-authorize". Could be handy)
Login - there are few REST API ways to login. Depends on your decision. if you have 1 dedicated user you'll probably go with "web server flow". I've added example https://stackoverflow.com/a/56034159/313628 if you don't have a ready SF connection library in your programming language.
If you'll let users login with their own credentials there will be typical OAuth "dance" of going to the target page (Google login, LinkedIn, Twitter...) and back to your app on success. This even works if client has Single Sign-On enabled. Or you could let people type in their username and pass into your app but that's not a great solution.
Pull the actual report already
Once you have session id. Official way would be to use Reporting API, for example https://developer.salesforce.com/docs/atlas.en-us.api_analytics.meta/api_analytics/sforce_analytics_rest_api_get_reportdata.htm
A quick & dirty and officially not supported thing is to mimic what happens when user clicks the report export in UI. Craft a GET request with right cookie and you're golden. See https://stackoverflow.com/a/57745683/313628. No idea if this will work if you went with dedicated account and "API access only" permission.

how to pull data from salesforce marketing cloud objects using API

I am trying to pull data from salesforce marketing cloud object using API calls.
data: all available instances for the passed object.
I did this for salesforce objects using bulk api call.
I am very new to sfmc.
Glad if someone can share the example link.
Not sure if this is what you want, there are several trailheads to get started with MC.
Log in to your MC account
Hover on Audience Builder
Click Contact Builder
Click on tab Data Sources
Click sub tab Synchronised
(if you have already connected your CRM to MC) A box with your connected user should appear. Click on it.
Here you can see all your sObjects that are connected and synced. If you dont have any or want to connect some or more then:
click Set up Object button on the top right
Now all the sObjects that are available will appear and you can sync them. This will make them available in the MC environment.
Some will be unavailable at the moment, this is because they require others to be synced first. Once you start syncing the most basic ones, others will become available.
Hope this is what you were looking for.

Resources