How to get "Lodging" with Google My Business? - google-my-business-api

I want to get the Attributes of a Lodging in Google My Business.
Looking at this Google My Business Reference, I tried to access it as follows.
【Reference】
https://developers.google.com/my-business/reference/lodging/rest/v1/locations/getLodging
【Request】
https://mybusinesslodging.googleapis.com/v1/locations/xxx/lodging?readMask=*
↑{locationId} is entered in xxx
The Response is a 404. I don't know why.
The specified "Locations" are certainly hotels, and Lodging API is also enabled.
Response

Related

How to get to invoice link in invoices api

I am interested to have a invoice link/pdf from the api which returns the invoice using new freshbooks api endpoint https://api.freshbooks.com/accounting/account/<accountid>/invoices/<invoiceid>
Even including direct_links I am unable to get the link to the invoice. With direct_links it returns json with fields id, contactid, created_date, type, userid, objectid, token.
I currently work at FreshBooks.
Unfortunately these direct link tokens will only work with old FreshBooks, which isn't mentioned in the documentation -- I'll see if we can fix that.
Poking through, it doesn't look like we've has exposed a way to access a PDF version of the invoice through the public API just yet. But I'll pass that on to the appropriate channels and I'll update this answer if that changes.

How can I content-partner and can-read-video-streams roles from Dailymotion?

I try to retrieve an HLS stream URL of my videos on Dailymotion, calling /video/ API with stream_hls_url value in the fields parameter. But I get a 403 error with the following message:
Unsufficient roles for the 'fields' parameter of 'GET /video/<id>' with 'stream_hls_url' value, roles required: content-partner, can-read-video-streams
How could I obtain these roles, given that I'm a Dailymotion partner?
You should either contact your Dailymotion content manager if you have one, or get in touch with us by writing your request to https://faq.dailymotion.com/hc/en/requests/new
Anyone coming to this question with a similar response from an API request; please check the fields you're requesting within your request against those listed in the Dailymotion API Data API Reference.
Often this "403" response, seemingly due to "Unsufficient Roles" (yes that's a typo), is actually down to requesting a field that no longer exists within the defined reference (linked above). This happens more than it should, with little or no notice to the end user - as demonstrated here.
I hope this helps :)

Determine tweet location with Twitter API

How can I find the location of a specific user's tweet? What are the API methods and techniques that I need to go through to determine the location?
Note: The below assumes that you want to grab multiple tweets and find their locations. If you don't, and you just want a single tweet by it's id, use statuses/show.
It's entirely possible - if the user has enabled location for their tweet. It'll be the value of the coordinates key, which will be null if they haven't.
Let's say you're using the following API method: statuses/user_timeline.
This is a GET request
The resource url is: https://api.twitter.com/1.1/statuses/user_timeline.json
You can specify either the user_id or screen_name as part of the GET parameters, for example: ?screen_name=J7mbo.
In the tweet results, once json_decode() is run on them, one of the keys will look like this:
This is actually the first key, according to the documentation, so you should be able to find it and it's value pretty easily.
Warning
Do not get confused with the location sub-key underneath the User key. This is the location of the user, as per their profile, not the location of any specific tweet. Use the coordinates key for that.
Documentation Link

Yahoo Placefinder API - city returns neighborhood, which it shouldn't

I want to use the Yahoo Placefinder API for user registration for city input (auto suggest). Based on the documentation I can to the following GET request:
http://where.yahooapis.com/geocode?city=falenty&country=poland&appid=yourappid
If you put this in browser, it gives you some XML:
...
<line1/>
<line2>05-090 Falenty</line2>
<line3/>
<line4>Poland</line4>
<house/>
<street/>
<xstreet/>
<unittype/>
<unit/>
<postal>05-090</postal>
<neighborhood>Falenty</neighborhood>
<city>Raszyn</city>
<county>Pruszkow County</county>
...
But I don't want to search by neighborhood if I was searching by city. If there is no city by this name, I don't want to get any results.
Does anybody have any idea if that is possible or do I need to loop through results and exclude those results where the city is not the same as what was sent in the URI? This is not an elegant solution because sometimes it gives me more than 10 results and not even 1 with the city I was searching for.

google adwords api: how to get adgroupId in Keyword/Ad?

Based on code examples on google website I am able to fetch keywords and ads. The example prints something like this:
printf("Text ad with headline '%s' and id '%s' was found.\n", $googleAd->ad->headline, $googleAd->ad->id);
based on such field list which was fetched:
$selector->fields = array('Headline', 'Id')
Is it possible to get adGroupId as well ? I have been looking at documentation for TextAd, however I cannot see adGroupId in field list. I am afraid it is not possible, because adgroup has field called campaignId. Any help?
Yes, it is possible to get adgroup id. It is part of AdGroupAd type, and can be retrieved using "AdGroupId" as selector name. Then you would retrieve the field as $googleAd->adGroupId. More details here:
http://code.google.com/apis/adwords/docs/reference/latest/AdGroupAdService.AdGroupAd.html
In the future, I recommend that you ask the questions on the official AdWords API forum at http://code.google.com/apis/adwords/community/. The forum is pretty active, and AdWords API team members regularly answer developer questions on the forum.

Resources