MailChimp Interested Value in "Group" always false after "subscribing" - json

I send over proper json formatted code, according to v2 api docs:
lists/subscribe.json
"GROUPINGS":[{"id":removed_id,"name":"grouping_name","groups":["group_name"]}]
I get back information about a member... It does not say they are interested in that group name..
lists/member-info.json
"GROUPINGS":[{"id":removed_id,"name":"grouping_name","form_field":"hidden","groups":
[{"name":"group_name","interested":false},{"name":"other_group_name","interested":false},
{"name":"other_group_name2","interested":false},{"name":"other_group_name3","interested":false}]}]
I do not understand how I can get these users to show up as "subscribed" to a group within my grouping. I have been trying for nearly 5 hours now. I have tried:
making sure the groups: value is an [] array.
trying out making that value a string (which surprisingly did not throw errors)
capitalizing "GROUPINGS" when sending it in merge_vars
not capitalizing "groupings" when sending in merge_vars
using the lists/update-member.json method to update these groups
using the name of my interest group instead of grouping in the grouping array.
using the option replace_interests on both true and false

In conclusion,
I had to email mailchimp a support ticket. Without changing my code at all - it works this morning. Interestingly enough, mailchimp was experiencing many issues yesterday with servers being down and alleged email hackings.
To be clear about which version of my code worked - following the API exactly for v2.
It was an error on mailchimp's end.
{
"id":"MY LIST ID",
"email":{
"email":"THE EMAIL TO SUBSCRIBE"
},
"merge_vars":{
"GROUPINGS":[
{
"id":THE GROUPING ID,
"groups":[
"THE NAME OF MY GROUP"
]
}
]
},
"double_optin":false,
"replace_interests":true,
"apikey":"MY API KEY"
}
Also, in case you are curious, replace_interests is true when the groups you send are supposed to replace existing groups the subscriber is interested in. False indicates that the groups you pass should be added to the interest groups.
If you are updating a member (method: lists/update-member), it may be best to set replace_interests to false just to make sure it does not overwrite your existing interest groups (possibly with blank groups). The default value for it is true, so this could be another place prone to error.

Related

How to use the 'query_fields' and 'query' options with Vimeo API?

I'm trying to get my head around Vimeo API with Python. I'm successful in the sense that I can use basic API requests e.g. to list all my videos or similar.
Mostly, I use the /me/videos/ API endpoint. The API reference states, that there can be two options 'query_fields' and 'query'. If I just use 'query', I can filter the results e.g. by a string in the title. I'm assuming this works, because the default value for 'query_fields' is title,description,chapters,tags' according to the API reference.
But what i'd like to do is to use the 'query_fields' for something like:
'query_fields': 'privacy.view'
'query': 'unlisted'
But if I try that, a generic error message is returned
{
"error": "Searching for a page that does not exist or is too far back in our catalog to present.",
"link": null,
"developer_message": "The user's from + size exceeded 10,000, they requested a page of results that does not exist, or they issued an invalid query as defined in the QueryPreprocessorPlugin.",
"error_code": 2969
}
Has anyone been able to use the 'query_fields' option on any way other than the defautl fields?
You can't query any fields with query_fields, the only valid fields are the ones listed in the docs ('title', 'description', 'chapters', 'tags').
You'd need to manually filter on privacy.view, so i.e.
GET /me/videos?fields=uri,privacy.view
And loop through this filtering for the values you want.

Get latest Field from Firestore Collection using a Structured Query?

I am trying to use Zapier to add an email to a SendFox mailing list when a new user gets added to a specified Firestore path. It's asking me for a structured query to find this data.
I am using the one that it's suggesting, but new users aren't being added correctly. My concern is that the structured query isn't set up correctly.
My data is structured as follows:
- Customers (Collection)
- [User ID] (Document)
- EMAIL
- Other Info
- Other Info...
Whenever a new UserID document is added, I'm trying to access the email field in Zapier.
This is the current structured query:
"orderBy": [{
"field": {
"fieldPath": "email"
},
"direction": "DESCENDING"
}]
What is the correct structured query (json) to access the document I'm looking for?
To clarify, it's the latest document in the "customers" collection with the field "email".
I'm not looking fo any javascript code to get this data, merely the correct json structure for this query.
The query you have right now returns all documents from the customers collection in descending order of their email address, so with the zs first. That seems to be unlikely what you want.
Firestore has no built in concept of the most recent document, so what you'll want to do is:
Add a timestamp field to each document that you set to the current time (preferably a server-side timestamp, but client-side will probably work too).
Sort the query on descending values of that new timestamp field.

Zabbix: get triggers excluding some triggers by triggerid

I use Zabbix API method trigger.get to retrieve a list of available triggers. I try to exclude some triggers from the result list by passing their ids into params:
"excludeSearch": "true",
"search": {"triggerid": "37328"}
It doesn't seem to exclude the trigger with the given id. In the manual I read:
search Works only for string and text fields.
I am not sure if it applies to triggerid which is
triggerids string/array
Anyway, is there any other way to get exclusion by triggerid working?
PS. I tried other names for that parameter, i.e. triggerid, triggerids, and experimented with passing value arrays, objects etc.
I'm not aware of a way to exclude triggers by ID in trigger.get. The confusion regarding string/not is understandable - the API documentation you quote that says "string/array" is looking at this from the API perspective, while the "Works only for string and text fields" part talks about the database field types. The trigger ID is a numeric field in the DB, thus it cannot be searched - and filtering for it cannot be reversed either.

Insert all domain members into Group

I'm currently writing an Add-on to manage Google Groups, and it uses the Admin SDK Directory API to loop through and retrieve all group members and make changes etc.
One curious issue I've found is that when 'All members of the domain' have been added to the group, no member email is supplied. For example, if I retrieve all members of the group, each member will be returned in the format:
{
"kind": "admin#directory#member",
"etag": "\"ABCDEFGHIJKLMNOPQRSTUV123456789\"",
"id": "123455678910",
"email": "email#myDomain.com",
"role": "MEMBER",
"type": "USER"
},
However, if you've added all users within the domain to a group, when you retrieve this 'member', it's returned in the format:
{
"kind": "admin#directory#member",
"etag": "\"ABCDEFGHIJKLMNOPQRSTUV123456789\"",
"id": "123455678910",
"role": "MEMBER",
"type": "CUSTOMER"
},
This is fine for retrieval, as I can identify that it's 'All users in the domain' by the 'type' always being 'Customer', then I just give it an arbitrary email address to display in my interface (I'm using '*#domain.com' just because).
However, when I'm updating the group members list using the 'Insert' method, it requires an email Address (It refers to 'memberkey', but I understand that this must be an email address).
It won't accept dummy addresses such as *#domain.com (It returns an error that this particular address exists, so I gues it's in use in the background), and if I use an existing address and try to overwrite the 'type' from 'User' to 'Customer' in an attempt to convert an existing member to the 'All users' value, this doesn't work (I suspect the 'type' field does not allow 'Customer' as a writable field, only a readable one).
My question: There does not seem to be a method to 'Add all users in the domain' to a group neatly, without looping through the domain and literally adding all members one by one. Does this method exist and I've just missed it? Or is there a neater way to add all members to the group without looping through all the members on the domain and adding them to the group one by one?
No API method has existed for this even back into the provisioning API days. Nothing in Group Settings is different for a group of this kind, it seems to be an unsupported Member Resource. Trying to modify existing members to become type: 'CUSTOMER' also fail.
You can, however, set a single group in the Admin Panel UI to be your "All Members" and then use the address of that group as a proxy member. i.e. it is a propagated all member feature. This is a workaround as opposed to a direct answer, but as I state above the real answer is "No".

Box API: Get_managed_users returning all users

Using the Box 1.0 REST API, I am trying to work with the functions in SOAP UI.
The API doc for get_managed_users with user_id=12345 (internal id retrieved with get_user_id call correctly) is returning all the users. The docs say that would be the case if you do not specify a user_id value. But my full command is: (Token and API key changed to protect the clueless)
https://www.box.com/api/1.0/rest?user_id=27360&auth_token=blahbalhblah1234&action=get_managed_users&api_key=someKeyYouShouldNotSee
Now I could work with the complete result list, but that won't scale as we get thousands of users into the system.
I can make a call with edit_managed_user, using the same user_id value and the change is reflected in the UI, and in the next get_managed_users call. Thus I do have the correct user_id value, I would so assume.
I tried testuser#gmail.com as the user_id value as well, and get the entire list back. This leads me to believe that somehow I am sending user_id wrong, but I just do not see it.
Any hints? Why, with what seems like a valid user_id value is it acting like it is absent or incorrect?
Most likely you have either called this method with an invalid user_id, or one that is not in your set of managed users. Can you double check that the user comes back in your list of already managed users?