how to get users data who replies,plusoners and resharers any google plus page? - google-plus

I have used this api
https://www.googleapis.com/plus/v1/people/page-id/activities/public?key=app-id
and getting all public data of a particular google plus page and in that same json structure i get this
"replies": {
"totalItems": 0,
"selfLink": "googleapis.com/plus/v1/activities/replies-id/comments"
},
"plusoners": {
"totalItems": 1,
"selfLink": "googleapis.com/plus/v1/activities/plusoners-id/people/plusoners"
},
"resharers": {
"totalItems": 0,
"selfLink": "googleapis.com/plus/v1/activities/reshare-id/people/resharers"
}
But when I call one of the above api i get this :
"code": 403 "message": "Daily Limit for Unauthenticated Use Exceeded.
Continued use requires signup."

Make sure you add your APIkey to the end of each of the URLs.
googleapis.com/plus/v1/activities/plusoners-id/people/plusoners?key=app-id

Related

Linkedin endpoint adAnalyticsV2

I am having an issue in getting the data from LinkedIn API , I have got the permissions and trying postman to test endpoint to get data mention below is my get request , every time the response is an empty elements list with 200 ok. any help in this regard will be highly appreciated. I am sure that their is data its not that there is no activity but cant retrieve via api request.
https://api.linkedin.com/v2/adAnalyticsV2?q=analytics&dateRange.start.year=2019&dateRange.start.month=5&dateRange.start.day=28&dateRange.end.year=2021&dateRange.end.month=9&dateRange.end.day=30&timeGranularity=DAILY&pivot=MEMBER_COMPANY&projection=(*,elements*(externalWebsiteConversions,dateRange(*),impressions,landingPageClicks,likes,shares,costInLocalCurrency,pivot,pivotValue~(localizedName)))&fields=externalWebsiteConversions,dateRange,impressions,landingPageClicks,likes,shares,costInLocalCurrency,pivot,pivotValue&accounts[0]=urn:li:sponsoredAccount:123456789
and this is the response every time
{
"paging": {
"count": 10,
"start": 0,
"links": []
},
"elements": []
}

Missing page content when using generator in Wikipedia API

I'm using the categorymembers generator in Wikipedia API to retrieve all pages in a category efficiently, for example:
https://en.wikipedia.org/w/api.php?action=query&format=json&prop=revisions&generator=categorymembers&rvprop=content&rvslots=*&gcmtitle=Category%3AAirports%20in%20Chad&gcmlimit=5000
(sandbox link)
But some articles are missing content, for instance page id 40376021 "Tchagen Airport":
"40376021": {
"pageid": 40376021,
"ns": 0,
"title": "Tchagen Airport"
},
However, when I retrieve the individual page, it does have content:
https://en.wikipedia.org/w/api.php?action=query&format=json&prop=revisions&titles=Tchagen%20Airport&formatversion=2&rvprop=content&rvslots=*
(sandbox link)
{
"batchcomplete": true,
"query": {
"pages": [
{
"pageid": 40376021,
"ns": 0,
"title": "Tchagen Airport",
"revisions": [
{
"slots": {
"main": {
"contentmodel": "wikitext",
"contentformat": "text/x-wiki",
"content": "page content here (long, ommited)"
}
}
}
]
}
]
}
}
I don't know what's going on here. It's not a recently created page so it can't be a caching issue. How to ensure that content for all pages can be seen in bulk results?
You only see the content of the first 50 pages.
Thus, it's best practice to set gcmlimit=50 in your request:
https://en.wikipedia.org/w/api.php?action=query&format=json&prop=revisions&generator=categorymembers&rvprop=content&rvslots=*&gcmtitle=Category%3AAirports%20in%20Chad&gcmlimit=50
In the response, you will see a continue>gcmcontinue value. Use this value in a next request to get the content of another 50 pages:
https://en.wikipedia.org/w/api.php?action=query&format=json&prop=revisions&generator=categorymembers&rvprop=content&rvslots=*&gcmtitle=Category%3AAirports%20in%20Chad&gcmlimit=50&gcmcontinue=page|482a402a042a3a4c48464c50011001dcc2dc0a|21079773
If the response does not contain a continue value, you know that you retrieved all data.

403 Error creating dataSource for com.google.blood_pressure in Google Fit REST API

Goal:
I have a simple web application where I submit my Blood Pressure and Heart Rate measurements.
Now I'd like to submit these measurements to my Google Fit Account.
I tried Googles tutorial: https://developers.google.com/fit/scenarios/write-bp-data
OAuth2 Setup
I created new credentials in one of my existing Cloud Console Projects. And then requested a new authorization code using the following scopes (The project is in Testing State and my account is registered as tester):
https://www.googleapis.com/auth/fitness.blood_pressure.write
https://www.googleapis.com/auth/fitness.heart_rate.write
Requesting the token returns the following response:
{
"access_token": "ya29.XXXXXXXXXXXXXXXX",
"expires_in": 3599,
"refresh_token": "1//XXXXXXXXXXXXXXXX",
"scope": "https://www.googleapis.com/auth/fitness.heart_rate.write https://www.googleapis.com/auth/fitness.blood_pressure.write",
"token_type": "Bearer"
}
As you can see, both write scopes are granted.
Additionally, if I check the permissions in my Google Account, both scopes are set.
Create dataSource
Now I create two dataSources (one for com.google.heart_rate.bpm and one for com.google.blood_pressure).
creating the Heart Rate dataSource works as expected, but creating a dataSource for Blood Pressure returns a 403 PERMISSION_DENIED Error:
Request (POST https://www.googleapis.com/fitness/v1/users/me/dataSources)
{
"dataStreamName": "BPA-BloodPressure",
"type": "raw",
"application": {
"detailsUrl": "https://aaa.bbb.ccc",
"name": "Blood Pressure App",
"version": "1"
},
"dataType": {
"name": "com.google.blood_pressure"
}
}
Response
{
"error": {
"code": 403,
"message": "Scope not included to modify data of type com.google.blood_pressure. Possible scopes: https://www.googleapis.com/auth/fitness.blood_pressure.write",
"errors": [
{
"message": "Scope not included to modify data of type com.google.blood_pressure. Possible scopes: https://www.googleapis.com/auth/fitness.blood_pressure.write",
"domain": "global",
"reason": "forbidden"
}
],
"status": "PERMISSION_DENIED"
}
}
The Google Fit REST API tells me that the Scope fitness.blood_pressure.write is missing, but as you can see the Scope is given for the used access token.
Notes
I am working with Postman to test all requests. Later a Java/Groovy or PHP backend will used.
I also tried with read and write scopes for both data types.
I can see my app with both write scopes in Google Fit under "Connected apps".
Change dataType name to "fitness.blood_pressure" instead of "com.google.blood_pressure"
The body will be like this.
{
"dataStreamName": "BPA-BloodPressure",
"type": "raw",
"application": {
"detailsUrl": "https://aaa.bbb.ccc",
"name": "Blood Pressure App",
"version": "1"
},
"dataType": {
"name": "fitness.blood_pressure"
}
}

Foursquare API - Tastes

When I try to send a GET request to Foursquare API below, I get "No matching endpoint." error.
I have validated my tokens and everything seems normal. Any advices?
REQUEST URL
https://api.foursquare.com/v2/users/USER_ID/tastes
RESPONSE MESSAGE
{
"meta": {
"code": 404,
"errorType": "endpoint_error",
"errorDetail": "No matching endpoint"
},
"notifications": [
{
"type": "notificationTray",
"item": {
"unreadCount": 0
}
}
],
"response": {}
}
FoursquareAPI twitter account has told me that I needed to pass m=foursquare in addition to version information.
The correct endpoint information is like
https://api.foursquare.com/v2/users/USER_ID/tastes?oauth_token=TOKEN&v=20150420&m=foursquare
The detailed information about v and m parameters are below.
https://developer.foursquare.com/overview/versioning

Instagram API getting error on UTF-8 characters (tested on /tags/{TAGNAME}/media/recent)

Shamelessly stolen from this ( https://groups.google.com/forum/#!topic/instagram-api-developers/tRfU444ZyhU ) thread as I have the exact same issue and hoping for better responses here.
Long story short, a few hours ago this was working, now it isn't.
The test platform can be found at both from my website and https://apigee.com/console/instagram
Sending https://api.instagram.com/v1/tags/türkiye/media/recent (careful with the "ü")
result: {
"meta": {
"error_type": "OAuthParameterException",
"code": 400,
"error_message": ""client_id" or "access_token" URL parameter missing. This OAuth request requires either a "client_id" or "access_token" URL parameter."
}
}
Sending https://api.instagram.com/v1/tags/turkiye/media/recent (now with "u")
result: {
"pagination": {},
"meta": {},
"data": [
{},
{},
{},
{},.. .. .. ... and so on
Sending https://api.instagram.com/v1/tags/türkiye/media/recent?client_id=7176aa6ef2fd47fd9cb373a5354bd30f ("ü" again and this time manually attached client_id)
result: {
"meta": {
"code": 200
},
"data": {
"media_count": 1471127,
"name": "t"
}
}
This time I'm getting the name as "t". It seems the query is broken just before the "ü" letter which is UTF-8 (Turkish if needed).
This is a bug on Instagram-side. There's an open discussion on Instagram Developers Google group. Although, from what I've seen in my application, the bug now resolve.