How to get total members with certain tags on mailchimp API v3.0? - mailchimp

Is there a way to return the total members in a specific list that have a certain tag?
I'm trying to do this without using custom logic outside of the API call.
I can get the member count of a certain list by running: https://usXX.api.mailchimp.com/3.0/lists/{ListId}?fields=stats.member_count, but I'm having trouble getting count's for specific tags within a list.

I dont believe this is possible over the API, without building custom logic. The only way to look at tags is, GET /lists/{list_id}/members/{subscriber_hash}/tags. So really you would need to first get the list members, then loop through and look at the tags for each member of the list.
Tags are associated with members of a list and not the list itself.

Related

Dialogflow CX: $session.params.list as a separate entity type

Let's say I have a dynamic list of items which I upload from a webhook at a certain step of a scenario. This list is not a list of some type of pre-defined entities, this is just a list of something.
So,
$session.params.items = ["item_1", "item_2"]
Now, at the next step user can either choose one of the options provided in this list or make something else. It seems that the best way to check whether the next user query has something to do with our list of items, I need to declare a non-required parameter. But if I do this way, they necessarily require an entity type.
So, the question is:
Is is possible to use any list or dict from session parameters as an entity type?
What is the best way to implement checking whether user query falls into one of the session variables like list taking into account that user query may as well go to other intent and so on. I supposed the best way is to have routes for filling in unnecessary parameters and for intents, but still I can't do the first part.

Using the Okta API and .Net SDK

I'm working with the Okta API and trying to understand a couple of things:
How do you get a count of members. For example, how do I get a count of groups defined, or the count of users assigned to a group. The admin tool seems to do this easily enough, but I need to do this in another tool I'm working on.
I can iterate through the pages until I get to the last page, incrementing a counter as I go along, but this is very slow, especially when trying to get the number of groups defined for my subdomain, or other similarly high-numbered value.
How do filters and filterbuilders work? The basics are pretty simple, but the filter syntax doesn't seem to be defined anywhere.
Thanks!
AFAIK the only way to get a count is by getting all users/groups and subsequently the count. There is no API call to get a summary. Basic, but works.
Check the Okta API docs at http://developer.okta.com/docs/api/resources/users.html#user-model for the user model. You will get a collection of those JSON objects when you list the users - http://developer.okta.com/docs/api/resources/users.html#list-users
Call this last API and count the instances that you get back in the JSON collection.

IBM SBT SDK: How can I limit search results of CommunityService.getPublicCommunities(params)?

When I call communityService.getMyCommunities(params) or communityService.getPublicCommunities(params) or communityService.getSubCommunities(parentCommunity, params) I would expect that filling params with e. g. tags=[mytag,yourtag] the call would only lookup communities having at least one of these tags (or both, however).
But to me it looks like this param ("tags") is simply ignored, and I always receive all communities of the given category (my / public / sub).
In case of having lots of communities of the requested category this massively slows down performance when I only want to retrieve communities with e. g. one certain tag: I receive all data over the net and must filter / lookup the received object list locally.
What am I doing wrong?
Is there something missing in the SDK implementation?
As part of the communities/my api, you cannot do any filtering... you need to use Search APIs.
In order to get a filtered list of communities based on the tags, you need to make a request to the following URL.
https://apps.na.collabserv.com/search/atom/mysearch?scope=personalOnly&scope=communities&query=&constraint={%22type%22%3A%22category%22%2C%22values%22%3A[%22Tag%2Fprb%22]}&page=1&pageSize=10
Yes, it is URL encoded, you can then change prb to match your tag, and you can repeat the constraints for each tag
You can also reference Link to Search API Constraints

Filter the form choices visible in the browseable API

I am using a filter to apply object level permissions to a collection. Resources in a second collection have a many-to-many relationship with the first. On the browsable API, when creating resources in the second collection, the user is presented with a list of resources from the first to link it to. However, this list is not filtered, so the user can see values that they should not be able to see.
I've poked around the documentation and source a bit and I cannot see a way to add filtering to the queryset that generates the choices without overloading or modifying a bunch of code to pass the request data down (probably removing some of the collection specific data on the way) and then apply the filters.
Is there a better way to achieve this?
Currently there's nothing to support this out of the box. Pull requests are always welcome. If it's something you want to work on you may want to either open a ticket on GitHub or hit up the mailing list to discuss it first.

Getting the Contacts from a Campaign in Siebel On Demand

I am able to get a list of Campaigns and filter on those to get only the campaigns I want.
How do I get a list of Contacts for 1 specific campaign?
I have the web service classes in my project but can't see any way of relating to the Child objects of the Campaign object.
Documentation is awful, none of the examples had working code and they needed amending in order to work.
Answer is don't use v2 of the API - use v1 instead which means no strongly typed objects etc but it's the only way to do it

Resources