Google Play Games: different player ids - google-play-games

I use Games scope to login in my game (addScope(Games.SCOPE_GAMES)), and then call Games.getCurrentPlayerId(), which returns a string that contains digits only, and when I try to send a gift to this player from another, using Games.Requests.getSendIntent(), the request.getRecipients() returns an id string which is starting with 'g'. Why are the identifiers different?

According to the getCurrentPlayer reference,
this gets the current signed in player, if available. It is referring to a specific user.
However, getRecipients
retrieves the information about all the players that the request was sent to. So this is more than one user. GPGS has its own reasons why it starts with 'g'. You can also do your own naming convention if ever you come up with your own API.

Related

Find Place requests Returns Only One Result

I'm using the Google Places API endpoint "findplacefromtext" and tried a search similar to the example.
https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=mongolian%20grill&inputtype=textquery&fields=photos,formatted_address,name,opening_hours,rating&locationbias=circle:2000#47.6918452,-122.2226413&key=YOUR_API_KEY
However, when you use this it only ever returns one result. There is a cafe near me that's called "Cream" but when you pass that as the "input" parameter it returns shops that have a category of "Ice Cream". I thought it should only search the name of the business.... If I can't find the place by name does it search the category type as a fall back? When I execute the same search in Google Maps it returns the same data but I get multiple results and I can see the place I am trying to retrieve 3rd on the search result list.
Is it possible to make it return more than one result? The documentation doesn't mention anything about this.
I believe what you need is the Text Search request. The Find Place request is meant for exact addresses.
The Google Places API Text Search Service is a web service that
returns information about a set of places based on a string — for
example "pizza in New York" or "shoe stores near Ottawa" or "123 Main
Street". The service responds with a list of places matching the text
string and any location bias that has been set.
The service is especially useful for making ambiguous address queries
in an automated system, and non-address components of the string may
match businesses as well as addresses. Examples of ambiguous address
queries are incomplete addresses, poorly formatted addresses, or a
request that includes non-address components such as business names.
Taken from https://developers.google.com/maps/documentation/places/web-service/search#TextSearchRequests

Using the Google Classroom API, is it possible to change a grade without a turn in?

I'm looking to create an assignment in Google classroom's gradebook, then automatically grade it (without a student turning in an assignment).
This seems to indicate that this is feasible, but the conversation there is a bit jumbled: Google Apps Script to turn in, grade, and return a Google Classroom Assignment
To utilize the PATCH endpoint to grade an assignment, you must have a submission id. https://developers.google.com/classroom/reference/rest/v1/courses.courseWork.studentSubmissions/patch . And at first glance, you wouldn't have a submission id if the student hasn't submitted anything. However, the previous stackoverflow link shows that this may be possible. They appear to get it from the submissions list. https://developers.google.com/classroom/reference/rest/v1/courses.courseWork.studentSubmissions/list . However, if this were the case, then the submissions list would need to include submission IDs for students who haven't even submitted the assignment yet.
Is this the case, or am I missing another way of going about this?
The submissions list does include submission IDs even for students who haven't submitted the assignment.

Which part of Id token i can used to identify one domain

The document https://learn.microsoft.com/en-us/outlook/add-ins/inside-the-identity-token, it introduces the content in the outlook AddIn id token, and i found there are two different keys "ISS" and "APPCTXSender", i want to know what's the different usage between them. Also I want to know which part of them i can used to identity one domain/org/tenant.
To uniquely identify a user via identity token, we recommend that you combine the msexchuid and amurl properties in the response (see "Generating a unique ID"
on this page.) As for the other half of your question, could you tell us more about your scenario and why you are looking for tenant/domain?

How can I get ESPN Developer to return more golfers?

I just created an account with ESPN Developer, and I'm trying to get a list of all the Professional Golfers. I made the following request:
http://api.espn.com/v1/sports/golf/athletes?&apikey=[mykey]
Unfortunately, the browser only shows a handful of names (which are in alphabetical order). How can I get the API request to return all the golfers?
According to my research, you should be seeing all of the Golfers that they have.
If you use http://api.espn.com/v1/sports/golf?apikey=KEY, you will get a list of "all organizing bodies" in the sport. You can (if you have the patience) go through that list, and check to see if they are listed in the data returned from your (correct) API URI, along with the members of each section.
You can also use http://api.espn.com/v1/sports/golf/pga/athletes?apikey=KEY to get a list of athletes in that organization. Be sure to replace "pga" if you are looking for something else.
I just now created a Developer account there and requested a key to assist you with your question, so I could be wrong. If I am I will certainly come back to better answer your question.
I am reading this post http://www.javacodegeeks.com/2013/06/parsing-espn-api-using-java-and-google-gson.html
The NBA request http://api.espn.com/v1//sports/basketball/nba/athletes?apikey=KEY returns only 50 athletes, you have to use the offset parameter to get more
http://api.espn.com/v1//sports/basketball/nba/athletes?apikey=KEY&offset=51
So in your case
http://api.espn.com/v1/sports/golf/athletes?&apikey=KEY&offset=51
I am still reading the post but now I see I can return more players and the first request only got to players last name ending with B so geeze to get all athletes the JSON response would be huge!
I can't find this on the ESPN docs, so I don't know how developers are supposed to know this, there may be a better way but at least now I know how to get all the players.

Is this possible to valid the domain is belongs to somebody?

For example, I have a field that give user to type their domain, the user can type any domain on this, but I don't valid this domain is belong that user. Of course, I can generate a random number text file for user to upload, and when I get the random number text file, if it is match, I can just treat it as a valid domain holder. But, except from this method, is that anyway to do so? Thanks.
Options I have seen:
Have user Create a Text file in document root, check for it
Send Email to contacts listed in whois (Or other ROLE type accounts (postmaster, hostmaster, etc...), with token they need to
return
Have them create an 'A' record in their DNS that is unique and you can query for.
There really isn't any other way of telling if they have control over the domain. Using whois information isn't 100% accurate as people don't update it, or their info isn't registered to them, or is hidden behind something like domains by proxy. There is no standard information in DNS, that can tell you ownership. Since google uses the DNS method and the text file method (I think), you can probably safely assume that is a good way to verify it.

Resources