is Foursquare herenow items down? - web-services

I am used to get check-ins with
https://api.foursquare.com/v2/venues/4b64c88af964a520d4cf2ae3/herenow?oauth_token=XXXXXXX&v=20120725
but yesterday, I realize that my app is not working properly. I can not get the items[](people who cheked in specific venue). Web service retrieving json like this;
{
meta: {
code: 200
}
notifications: [
{
type: "notificationTray"
item: {
unreadCount: 0
}
}
]
response: {
hereNow: {
count: 16
items: [ ]
}
}
}

seriakillaz is right -- the behavior you're seeing is intentional, and is described by the email he links to.
In general though, the hereNow is working as before if you're checking into a place (the official foursquare apps use the same endpoints we document publicly).
If you're having trouble with it after accounting for the new policy, checkout my response to seriakillaz question:
hereNow not working as expected

They've just changed the hereNow endpoint: https://groups.google.com/forum/?fromgroups#!topic/foursquare-api/rmS0DbKKOHo
However it is not working for me even if I check-in to a place...

Related

Power Bi filtered export API is not working

I am working on a embeded powerbi within salesforce where i am using filtere which doing a export of file using rest api. The filter json looks like below . This is passed in the body of the POST request callout
{
"format": "PDF",
"powerBIReportConfiguration": {
"ReportLevelFilters": [
{
"Filter": "User / Id in ('0055700000633IsAAI')"
}
]
}
}
Endpoint which i am calling is
https://api.powerbi.com/v1.0/myorg/groups/XXXX-XXXX-XXXX-XXXX/reports/XXXX-XXXX-XXXX-XXXX/ExportTo
When the file is getting downloaded , i am getting all the data instead the filtered data. Anyting i am missing in the configuration
Take the spaces out of the Table/Column expression, per the examples here, also some of your JSON names don't have the correct case. Here's the Fiddler capture of a successful request using the Power BI .NET Client:
{
"format": "PDF",
"powerBIReportConfiguration": {
"reportLevelFilters": [
{
"filter": "DimCustomer/CustomerAlternateKey in ('AW00011000')"
}
]
}
}
So something like
{
"format": "PDF",
"powerBIReportConfiguration": {
"reportLevelFilters": [
{
"filter": "User/Id in ('0055700000633IsAAI')"
}
]
}
}
I am having this same issue. I saw a post regarding a Power Automate flow which highlighted that when the report is published the filters need to be cleared. However even with this done, the reportLevelFilters do not seem to have an effect.
I have also tested the URL string params which work fine as per these docs.

Google my business not fetching reviews correctly

I'm currently using Google's api for fetching reviews of a Google My Business Account. We do this for our clients, which have to enable oauth for us, so we can have an access token and a refresh token.
The response we get, has the following structure:
url: https://mybusiness.googleapis.com/v4/accounts/{account_id}/locations/{location_id}/reviews
{
"reviews": [
{
"reviewId": "some-id,
"reviewer": {
"profilePhotoUrl": "some-url",
"displayName": "Some Sample Name"
},
"starRating": "FOUR",
"comment": "Some long comment left by the user.",
"createTime": "2021-02-15T14:35:19.252Z",
"updateTime": "2021-02-15T14:35:19.252Z",
"reviewReply": {
"comment": "Some long reply by the business.",
"updateTime": "2021-03-04T16:49:32.973Z"
},
"name": "accounts/{account_id}/locations/{location_id}/reviews/{review_id}"
},
...
],
"averageRating": 4.5,
"totalReviewCount": 1312,
"nextPageToken": "some-page-token"
}
The problem is, for some set of clients, we are getting just an empty object (literally, we are receiving {} as the response body). We are not sure why this is happening, since we are able to see reviews on the client's web site, and we are not getting any error. We've refreshed tokens and refreshed tokens without any success.
I've tried posting a support ticket with GCP in order to get some guidance, but it seems that you don't get any help in this kind of issues if you don't have the right support plan.
Anyhow, any help on this issue (why is happening? can it be fixed? is it a setup problem? etc.) is very much appreciated.

How can I do Google drive data migration?

I am trying to do drive data migration from one user to another using https://developers.google.com/admin-sdk/data-transfer/v1/reference/transfers/insert
Code Block:
{
"newOwnerUserId": "new user id",
"oldOwnerUserId": "old user id",
"applicationDataTransfers": [
{
"applicationId": 122344
}
]
}
I am getting 200 response but I don't see any new folder in newOwnerUserId with oldOwnerUser Data.
Can somebody please suggest what am I doing wrong?
Define Privacy level otherwise it will not work

"We can not access the URL currently."

I call google api when the return of "We can not access the URL currently." But the resources must exist and can be accessed.
https://vision.googleapis.com/v1/images:annotate
request content:
{
"requests": [
{
"image": {
"source": {
"imageUri": "http://yun.jybdfx.com/static/img/homebg.jpg"
}
},
"features": [
{
"type": "TEXT_DETECTION"
}
],
"imageContext": {
"languageHints": [
"zh"
]
}
}
]
}
response content:
{
"responses": [
{
"error": {
"code": 4,
"message": "We can not access the URL currently. Please download the content and pass it in."
}
}
]
}
As of August, 2017, this is a known issue with the Google Cloud Vision API (source). It appears to repro for some users but not deterministically, and I've run into it myself with many images.
Current workarounds include either uploading your content to Google Cloud Storage and passing its gs:// uri (note it does not have to be publicly readable on GCS) or downloading the image locally and passing it to the vision API in base64 format.
Here's an example in Node.js of the latter approach:
const request = require('request-promise-native').defaults({
encoding: 'base64'
})
const data = await request(image)
const response = await client.annotateImage({
image: {
content: data
},
features: [
{ type: vision.v1.types.Feature.Type.LABEL_DETECTION },
{ type: vision.v1.types.Feature.Type.CROP_HINTS }
]
})
I have faced the same issue when I was trying to call the api using the firebase storage download url (although it worked initially)
After looking around I found the below example in the api docs for NodeJs.
NodeJs example
// Imports the Google Cloud client libraries
const vision = require('#google-cloud/vision');
// Creates a client
const client = new vision.ImageAnnotatorClient();
/**
* TODO(developer): Uncomment the following lines before running the sample.
*/
// const bucketName = 'Bucket where the file resides, e.g. my-bucket';
// const fileName = 'Path to file within bucket, e.g. path/to/image.png';
// Performs text detection on the gcs file
const [result] = await client.textDetection(`gs://${bucketName}/${fileName}`);
const detections = result.textAnnotations;
console.log('Text:');
detections.forEach(text => console.log(text));
For me works only uploading image to google cloud platform and passing it to URI parameters.
In my case, I tried retrieving an image used by Cloudinary our main image hosting provider.
When I accessed the same image but hosted on our secondary Rackspace powered CDN, Google OCR was able to access the image.
Not sure why Cloudinary didn't work when I was able to access the image via my web browser, but just my little workaround situation.
I believe the error is caused by the Cloud Vision API refusing to download images on a domain whose robots.txt file blocks Googlebot or Googlebot-Image.
The workaround that others mentioned is in fact the proper solution: download the images yourself and either pass them in the image.content field or upload them to Google Cloud Storage and use the image.source.gcsImageUri field.
For me, I resolved this issue by requesting URI (e.g.: gs://bucketname/filename.jpg) instead of Public URL or Authenticated URL.
const vision = require('#google-cloud/vision');
function uploadToGoogleCloudlist (req, res, next) {
const originalfilename = req.file.originalname;
const bucketname = "yourbucketname";
const imageURI = "gs://"+bucketname+"/"+originalfilename;
const client = new vision.ImageAnnotatorClient(
{
projectId: 'yourprojectid',
keyFilename: './router/fb/yourprojectid-firebase.json'
}
);
var visionjson;
async function getimageannotation() {
const [result] = await client.imageProperties(imageURI);
visionjson = result;
console.log ("vision result: "+JSON.stringify(visionjson));
return visionjson;
}
getimageannotation().then( function (result){
var datatoup = {
url: imageURI || ' ',
filename: originalfilename || ' ',
available: true,
vision: result,
};
})
.catch(err => {
console.error('ERROR CODE:', err);
});
next();
}
I faced with the same issue several days ago.
In my case the problem happened due to using queues and call api requests in one time from the same ip. After changing the number of parallel processes from 8 to 1, the amount of such kind of errors was reduced from ~30% to less than 1%.
May be it will help somebody. I think there is some internal limits on google side for loading remote images (because as people reported, using google storage also solves the problem).
My hypothesis is that an overall (short) timeout exists on Google API side which limit the number of files that can actually be retrieved.
Sending 16 images for batch-labeling is possible but only 5 o 6 will labelled because the origin webserver hosting the images was unable to return all 16 files within <Google-Timeout> milliseconds.
In my case, the image uri that I was specifying in the request pointed at a large image ~ 4000px x 6000px. When I changed it to a smaller version of the image. The request succeeded
The very same request works for me. It is possible that the image host was temporarily down and/or had issues on their side. If you retry the request it will mostly work for you.

Tesla's "REST" API, and honk_horn end-point

GET /vehicles/{id}/command/honk_horn
As seen in this post:
https://news.ycombinator.com/item?id=7961944
There is a debate about what verb should be used for the honk_horn resource. Answers include:
GET, because you're not changing the resource state
POST and not PUT because honking twice is not idempotent
PUT, because honking twice might be considered idempotent :S
Perhaps the root of the problem here is that honk_horn is really an action and not a resource, and so in this particular case how should one define as API to issue a command while remaining RESTful?
Perhaps the root of the problem here is that honk_horn is really an action and not a resource
Yes, I would say so, that's the core of the problem. A resource oriented and hypermedia based approach could look like this (using Mason https://github.com/JornWildt/Mason to describe actions):
GET /vehicles/12345/horn => return status of horn (a resource in itself)
{
volume: 5,
numberOfHonks: 1025,
#actions:
{
"honk":
{
type: "void",
href: "/vehicles/12345/horn/honks",
method: "POST",
title: "POST here to honk horn once"
}
}
}
GET /vehicles/12345/horn/honks => return previous honks (a resource in itself)
{
numberOfHonks: 1025,
honks:
[
{ date: "2010-12-24T10:24:12" },
{ date: "2010-12-24T10:24:14" },
{ date: "2010-12-24T10:24:20" },
... 1022 other honks (or perhaps only latest top 100 honks)
]
}
POST /vehicles/12345/horn/honks => Add one honk (empty payload - or maybe even include volume and pitch ...)
Fun exercise :-)