google people api search by phonenumbers - google-people-api

I'm trying to use "searchContacts" method of the Google People Apis to search contacts by phone number but the result is always empty.
If I set the name of one of my contacts in query paramters, It works fine.
If I set the phone number in the query parameter, no result is returned to me.
I also trying to use "The test panel" in the Google documentation page (https://developers.google.com/people/api/rest/v1/people/searchContacts) but I have the same end.
Is this possibile?
If yes, How should I set the query parameter?
thank you

Use the canonicalForm of the phoneNumber without the + sign.
Example:
Request parameter:
Output:

Related

Facebook graph api get posts after a certain post id

I am using facebook graph api where I periodically call: https://graph.facebook.com/cnn/posts?access_token=accesstoken
I don't want to get repeat posts the second time I make the call so I would like to filter the call to get anything after either a certain post Id or after a created_time. Is this possible?
I have tried using date_range= but it did not work plus it only allowed me to search by date but not time.
Use timebased paging: https://developers.facebook.com/docs/graph-api/using-graph-api/#paging
The correct parameter would be since and until. Just store the timestamp of the last post and use it in your next call.

How do I save the web service response to the same excel sheet I extracted the data from?

For example:
The given sample HP Flights SampleAppData.xls and using the CreateFlightOrder, we can link the data to the test functions and get a OrderNumber and Price response from the Web Service. And in the SampleAppData.xls Input tab, we can see that there is a empty column of OrderNumber.
So here is my question, is there any ways that I can take the OrderNumber response and fill the empty column in SampleAppData.xls?
My point to do this is because, let's say I have many test cases to do and will take days, and today I do this certain test and I would need the result of today for the next day's test.
Although I know that the responses are saved in the result but it beats the point of automation if I am required to check the response for each and every test cases?
Yes of course you can. There are a number of ways to do this. The simplest is as follows.
'Datatable.Value("columnName","sheetName")="Value"
DataTable.Value(“Result”,”Action1”)=“Pass”
Once you have recorded the results in the Datasheet, your can export them using
DataTable.ExportSheet("C:\SavePath\Results.xls")
You can write back the response programatically , if you already imported mannually .
You can use GetDataSource Class of UFT API , it will work like this lets say you imported excel from FlightSampleData.xls, and named it as FlightSampleData, you have sheet, accessing the sheet will be like below:
GetDataSource("FlightSampleData!input).Set(ROW,ColumnName,yourValue);
GetDataSource("FlightSampleData!input).Get(ROW,ColumnName);
for exporting you can use ExportToExcelFile method of GetDataSourse class after your test run . Please let me know if you have any furthur question about this.

Search Yammer for threads between date & time range?

I'm trying to execute a REST query to Yammer that will retrieve all threads (message starters) between a specified date AND time.
I noticed the search/search_tabs.json accepts "search_startdate/search_enddate" filters (though not documented) but not sure if the date is date-only or date/time.
While the messages.json has a "newer/older_than", but they accept ID's not date/time.
So I guess my question is:
Would the messages.json or search.json be more appropriate for this task?
Is there any additional documentation on search, the developer site just has "search - The search query." - what do these "queries" look like?
Thanks
-John
search_startdate and search_enddate only accept date inputs, not time or datetime inputs. I don't know if these are actually accessible through the API. To answer your questions:
1 - Neither will work for what you're trying to do
2 - I believe that the content of the search query is just the plaintext you want to look for, e.g., to search for "test" you would use https://www.yammer.com/api/v1/search.json?search=test

String Ids are not quoted in dependent batch-request to api. Workaround?

I'm currently trying to query the facebook api to retrieve some data via batch-requests with two fql queries.
One of the queries fetches a set of album ids in the form of:
Select aid FROM album WHERE ...
While the other one tries to retrieve photos for the found albums:
SELECT ... FROM photo WHERE aid IN ({result=album_ids:$.*.aid})
Where 'album_ids' is the name of the first query.
Most of the time this works perfectly but sometimes a album comes along with an aid containing a '_' - Which would be perfectly fine since the documentation specifies the aid as string.
However the jsonpath in the second query does not quote the ids according to the facebook api:
Parser error: unexpected '_xxxxx' at position xx
...
SELECT ... FROM photo WHERE aid IN (10000xxxxxxxxxx_xxxxx)
The json result for the first query clearly has them quoted:
[{\"aid\":\"xxxxxxxxxxxxxxxxxxx\"},{\"aid\":\"10000xxxxxxxxxx_xxxxx\"},...]
Am i missing something here or does facebook wrongly skip to quote the ids in the second query even though they are clearly strings.
As far as i see in the facebook-api and jsonpath specs this should be working.
Or is there a work-around to get this to behave as expected? (Except of doing the quoting client-side and with two seperate requests).
Right now i'm trying to change my query as suggested here: Quoting/escaping jsonpath elements for in clause of dependent fql queries
But maybe there is a way without completely re-structuring the queries itself.

webservice for autosuggest on city names / postal codes including long-lat coordinates?

i'm looking for a webservice, to be used for an autocomplete field,
where people can fill in either a postal code / city name or both
this service will need all cities in Europe, so we can use it for all country websites.
and in a later stadium we want to keep the world open for asia and america so this would be a plus.
preferably it would also return the long-lat coordinates for the locations,
Now it is a free textfield, after leaving the field, we hit the google geocoding service,
to find coordinates... preferably i would tie these two together.
so we don't have to query 2 services for one thing.
does anyone know of the existance of such a service online somewhere?
or would you suggest to build our own database with cities / postal codes / coordinates?
if so we would need to get the content from somewhere too, and i was trying to avoid that issue :)
I recently searched for a similar service, in vain.
I wanted my users to have auto-complete on entering a city name, and once a city is chosen I needed to pass the name and lat/long onto the Google API. In the end I did this: -
downloaded the geonames allcountries.zip, full extract: this
Imported it into a SQL DB via SSIS (about 7.5 million records!)
Wrote a simple query to extract just the cities (only the PPLC, PPLA and PPLA2 records).
This left me with a manageable table of 9112 records (with lat / long and country code) which covers all the cities in the world. I then wrote my own code to query the data.
Not ideal, but I needed a solution.
I know this post is very old but for thouse who are looking for a simple solution that can be integrated in 5 minutes here is the link:
Geocomplete jQuery...
For my case I followed this steps:
1 - Download the plugin from here.
2 - Add the jquery.geocomplete.js or jquery.geocomplete.min.js file into your javascript folder of your project.
3 - Call this file in script tags on the html page where you have the input field that you have to autocomplete with cities:
<script src='/PathToTheFile/jquery.geocomplete.js'></script>
4 - To convert an input into an autocomplete field, simply call the Geocomplete plugin in script tags: <script>
$("#IdOfTheInputField").geocomplete(); // Option 1: Call on element.
$.fn.geocomplete("input"); // Option 2: Pass element as argument.
</script>
5- You can check for the complete list of options on the link provided at the top.
Hope that this helped!