Search Members using MailChimp API 3.0 by Merge Field - json

Is is possible to search for members in a MailChimp list by merge field using the MailChimp API v3.0?
The documentation for the Search Members endpoint links to a separate page, Search for Campaigns and Contacts in Your Account, which details how to manually search using the GUI, but mentions that the keyword search can include merge fields in the format merge3:keyword, so it looks like it should be possible.
However, in both the GUI and using the MailChimp API php wrapper, I get no results - the GUI returns the error Invalid search request, try again, while the php API returns an empty array with nothing in getLastError() or getLastResponse().
Searching using a subscriber's name or email address does, however, work as expected.

As mentioned by #Kalyan Sangartula it is not possible to search using other merge fields.
But I think an alternative, for now, to this could be using segments. You can create segments based on filters you want (api route "/lists/{list_id}/segments") and get members from those segments (api route "/lists/{list_id}/segments/{segment_id}/members").

"/search-members" endpoint only supports merge1, merge2, and merge3 fields (the Email, Fname, and Lname) fields for members. It doesn't support any other fields or merge fields except the mentioned above.
Sample API call for search-members: "/3.0/search-members?query=abc#example.com"

Related

How to separate original and translated review comment from a from google maps api

I have a lot of google access tokens in my DB (more than 1k). These tokens belong to google-my-business owners that have been authenticated to my app via google and gave permissions to use their tokens. I want to get all google reviews from all these accounts and save them to my DB.
But when I get reviews, I get them with an automatically generated translation as a single string. And I want to split the original and translated and save it separately.
Reviews have this format.
(Translated by Google) Awesome!
(Original) Круто!
Usually, I would just split this string by "(Translated by Google)" substring. But this solution doesn't work, because the substring is actually different and depends on the user's account language settings. And if user set up his language to russian, this substring will look like "(Переведено Google)".
Is there any way to split the original comment from translated one, considering different language settings?
P.S. This question is not a duplicate because other ones don't have this language problem.
I found a solution that I really don't like and it's an overkill, but that's the only thing that came to my mind.
First I get the user's language settings by calling this endpoint https://developers.google.com/my-business/reference/rest/v4/accounts.
Then I translate '(Translated by Google)' string via google translate API to this language and then I split the review comment by this string. It works, but if you suggest something better, it would be awesome.

Valid sample data for Directory API Explorer?

I am trying to use the API Explorer on the Directory API to explore the required fields for the users.list method.
I am using the default OAuth and key.
This method requires a domain be passed and I'm not seeing in the documentation what the default domain is.
A closely related method, users.get, says that any user on the domain can use it to list basic information about another user (similar to the contacts.google.com behavior) on their domain, as long as they have the "key" for the user. The documentation does not appear to say whether the key is their email or another value.
I'd like to know what values I can enter in these fields in the Explorer to get data returned.
https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list
https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/get
Okay, I finally got something to work in Explorer, so here's what I know now.
The domain is the domain you're signed into.
The Key is a value that is in the basic information on users.
In addition to including the domain, I needed to specify my Projection ("Basic") and viewType ("domain_public"). I made sure that all the fields with drop-down menus had something selected.
At this point I was able to get a 200 response with users.

How to make join in rest api like in sql?

I am currently new in programming especially in front end and I was wounder how to perform join in Json Restful API
I am using Json placeholder for my fake rest api
I have tried reading their document by I failed
https://jsonplaceholder.typicode.com/posts/20
https://jsonplaceholder.typicode.com/users
I want to join these two tables
and display title,body from posts and username from user according to the userid in post
It seems like you will have to either create an endpoint in your backend that would perform the read from two joint tables and return a DTO having all the fields that you require, or (if that's impossible) you will have to call both endpoints in your client. So for example you could fetch the users in one call, then retrieve posts in separate calls and write front-end logic to find the associated user and display the data you need.
Ex. call api to get users, store them in a users array in your front end client code, then call api to get post and search for the corresponding user in the user array by userId

Google Places API reference field

When I make an API request to Google places API one of the fields I get back is "reference".
It is not documented in the API documents. The value appears like a long hash code.
Is this versioning for the places details? For instance, does this reference stay the same until something like phone number or name is changed?
I am looking for a way to cache results. I was going to do it by date of request but if this value is for versioning of the record then it will be ideal to check against the cache.
I can't find any mention of it on developer site but value appears to be consistent so I figured this might be the case.
Does anyone know for sure one way or the other?
From the web service documentation (same is true for the Google Maps Javascript API v3):
Note: The id and reference fields are deprecated as of June 24, 2014. They are replaced by the new place ID, a textual identifier that uniquely identifies a place and can be used to retrieve information about the place. The usual deprecation period of one year has been extended, as we’re looking into ways of ensuring this change will not break existing code. We’ll update this page with a final notice at least 90 days before we change the way the API handles the id and reference fields. We recommend that you update your code to use the new place ID instead of id and reference as soon as possible.

How to populate a jQuery Mobile list view of cities from Open Weather Map API?

I am trying to write a very basic jQuery Mobile app that will allow someone to select a city and view the current temperature using the OpenWeatherMap API. The data I want to use will be returned as json.
As per the landing page I can see that doing the query explicitly with the city is fine...
http://api.openweathermap.org/data/2.5/weather?q=London,uk
But what I am unable to find is how do I query the API to simply return all the cities, which will then subsequently allow me to populate my list view, then allowing the user to see the temperature.
I have read some people talking about using a 'callback', but I am unable to see how this would help.
I have written a basic app previously, but again, that was using a fixed location, where the user didnt have to select it, so I never ran into this problem before.
I am having problems posting my code, but will attempt to post it later this eve.
Any pointers/tutorial links would be great.
You have to contact them via email to get the latest list of countries.