Get multiple items of multiple apps in podio api - podio

Can i retrieve all the items in my filter which is under multiple apps which has same app name in podio api.
Example scenario:
I have two work space. Both work space have Deliverable app. I want to get all items in Deliverable from both work space, and i want to filter through it.
I can get items in an app by :
PodioItem::filter( $app_id, $attributes = array(), $options = array() );
is there a way like:
PodioItems::filter(array($multiple_app_id), $attributes = array(), $options = array() );

No. The API filter operation doesn't support passing multiple app ids. You'll have to make a separate call for each app that you'd like to retrieve items, regardless of the workspace.

Related

Podio App Create not respecting Field external_id

I'm running into an issue with the Podio App Create API call:
https://developers.podio.com/doc/applications/add-new-app-22351
It does not appear to respect external_id for fields.
For example, given:
...
[fields] => Array
(
[0] => Array
(
[type] => text
[external_id] => title
[config] => Array
(
[label] => Name
...
The resulting field will have an external id of "name" and not "title".
This is a rather big issue as when trying to make exact copies of apps (into places that clone won't go), the change in field ids causes GF flows to break.
Any way around this?
Per the API documentation there is no "external_id" input in this call. The external IDs are always a standardized version of the field label though. (e.g. if you have 2 Name fields the first will be "name" and the second will be "name-2").
Alternatively, you could just run "get app" https://developers.podio.com/doc/applications/get-app-22349 to see what the external IDs ended up being.

Podio API: how to search in all fields except item comments?

I need to search for a text within a particular workspace. I need all items and fields, except comments.
I'm using php-wrapper for Podio API and Search in space function:
$attributes = array(
"query" => $query,
"ref_type" => "item", // I need just items, not tasks, statuses etc.
"search_fields" => "title"
);
$items = PodioSearchResult::space( $space_id, $attributes );
If search_fields parameter will be removed, it will search not only in titles, but in all fields. However, it will also search in comments left for each item and return that items as a result. But I need just results based on fileds values.
Of course, it is possible to list all the fields needed in search_fields. But there is a dozen of apps with a dozen of different fields each in that space. Moreover, fields could be added, edited or removed by workspace users. So it looks like a very rough and hard-coded solutiuon to list all the fields.
Is there another way to avoid comments in search results?
Podio doesn't have specific method to avoid only comments. But instead of hardcoding all the fields, you can query dynamically "Get app values" call and use the result in "search_fields".

How to search multiple api services

I am developing a search engine with angular 2.
Therefore I use APIs from multiple platforms.
It works if I call the search function from every api service manually.
But is it possible to do the same foreach api service?
Every api service has the same function:
search (query: string): Observable<Array<SearchResult>> { ... }
In the UI I want to separate the results by tabs.
Therefore every api service has a title:
public title: string = "the title";
For storing the search results locally I have a class that is extended by every api service. This class has helper functions etc.
Depending on the behaviour you need you can use merge, concat or forkJoin to merge multiple streams into one.
The code would look pretty much the same.
For example using merge in order to merge 2 streams into one.
If you have a list of apis you need to call for the search. Your code would look like this.
let apis: string[] = [];
let observables = apis.map(api => search(api)); // get an array of observables
let merged = observables.reduce((previous, current) => previous.merge(current), new EmptyObservable()); // merge all obserbable in the list into one.
merged.subscribe(res => doSomething(res));
This article might be helpful.

fetch all infusionsoft tags via api

I am writing an application and in one of my forms, I want to put in a listbox populated with all available tags from my client's InfusionSoft account. I am new to the InfusionSoft API and would greatly appreciate it if someone can point me toward the right direction.
Thanks
To get a list of all available tags, you'll want to query the ContactGroup table. That will return back a list of all available tags!
For example, if you were using the PHP iSDK, you could get the first 1,000 tags this way:
$app = new iSDK();
// perform authorization tasks
$returnFields = array('Id','GroupDescription', 'GroupName');
$query = array('GroupName' => '%');
$tags = $app->dsQuery("ContactGroup",1000,0,$query,$returnFields);

MailChimp API Get Subscribers ammount

I have been looking at the mailchimp api, and am wondering how to display the live ammount of subscribers to a list, is this possible? And is it possible to have this counter LIVE? I.e as users join, the number increases in real time?
EDIT:
I have been getting used to the API slightly...
after using Drewm's mailchimp php wrapper its starting to make more sense...
I have so far
// This is to tell WordPress our file requires Drewm/MailChimp.php.
require_once( 'src/Drewm/MailChimp.php' );
// This is for namespacing since Drew used that.
use \Drewm;
// Your Mailchimp API Key
$api = 'APIKEY';
$id = 'LISTID';
// Initializing the $MailChimp object
$MailChimp = new \Drewm\MailChimp($api);
$member_info = $MailChimp->call('lists/members', array(
'apikey' => $api,
'id' => $id // your mailchimp list id here
)
);
But not sure how to display these values, it's currently just saying 'array' when I echo $member_info, this maybe completly because of my ignorance in PHP. Any advice to s
I know this may be old, but maybe this will help someone else looking for this. Latest versions of API and PHP Files.
use \DrewM\MailChimp\MailChimp;
$MailChimp = new MailChimp($api_key);
$data = $MailChimp->get('lists');
print_r($data);// view output
$total_members = $data['lists'][0]['stats']['member_count'];
$list_id = $data['lists'][0]['id'];
$data['lists'][0] = First list. If you have more, then it would be like $data['lists'][1] ect...
And to get a list of members from a list:
$data = $MailChimp->get("lists/$list_id/members");
print_r($data['members']);// view output
foreach($data['members'] as $member){
$email = $member['email_address'];
$added = date('Y/m/d',strtotime($member['timestamp_opt']));
// I use reverse dates for sorting in a *datatable* so it properly sorts by date
}
You can view the print_r output to get what you want to get.