Podio API : How to get a file id given an item id - podio

Here's a Podio API question ...
How do you get the file id that's associated with an item (given that I know the item id). I cannot find that on the API documentation.

You can get the item: https://developers.podio.com/doc/items/get-item-22360 and read the 'files' key from the response. That will give you a list of the files ids.

Related

How to add a contact to a list in ActiveCampaign API v3

According to v3 docs I should be able to add a contact to a list using the Contact API but I am at a loss on how to do so as I see nothing list related under Contacts.
How do I add a contact to a list (not through automations) using version 3 of the API? Or are the docs in error?
The v3 docs have been updated (Lists documentation) and they no longer read that you can add a contact to a list through the API. ActiveCampaign Lists documentation screenshot
EDIT: you can add a contact to a list using the v1 contact_sync (contact_sync documentation)
SECOND EDIT: you can now add a contact to a list and/or change their subscription status to a given list through the v3 API!
(update list status for a contact documentation)
The above is no longer true. You can add a contact using the Create Contact endpoint.
It's basically a POST request that uses the following parameters:
E-Mail (Required)
First Name (Optional)
Last Name (Optional)
Phone (Optional)
The API v3 changed a lot though and now after you create a contact to do the following this you have to consult other endpoints. For example:
To add a contact to a list you need a POST request to the Contact Lists endpoint where you need to provide three parameters (listid, contactid, status).
If you need to assign a tag to a contact, in order to be able to create the relationship you first need to create the tag using the Create a new tag endpoint. And the use the resulting tag id with the Create Contact Tag endpoint where you combine said tag id with the contact id.
Now in order to remove that same tag the guys from Active Campaign made us work more and in order to remove a tag from a contact you don't use the contact's id and the tag's id, but rather you have to use the contact's id and the relationship id between the tag and the specific contact, that's quite a lot of steps, but I guess they wanted to make it very robuts in terms of structure.
There are many new endpoints which were actually available from around the date when you asked your question. You should check out the new API reference. It has some flaws and is not 100% complete yet, but it would be useful.
Hope this helps since it gave me some head heck... Using activecampaign php sdk when adding a contact with the sync command you can also add it to a list:
$list_id = 'thelistid';
$contact = array(
"email" => 'contactemail#doamin.com',
"p[{$list_id}]" => $list_id,
"status[{$list_id}]" => 1, // "Active" status
);
$contact_sync = $ac->api("contact/sync", $contact);
They wrote it also as examples on the repository but for some reason I didn't catch it.

get Podio Activity / all revision API

Is there an API call to get all fields revisions? Just like the activity on Podio?
The get all revisions return individual ID and no details.
Currently, there is no API call to get all field revisions with values.
You have to call Get item revision difference API call to get the revision values.

Retrieving image files from referenced items in filtered items

Being new to REST APIs (and APIs in general), I ran into some problems while trying to retrieve some Podio data using the Klipfolio web service, where I want to setup a simple dashboard with a list containing a name field from collected Podio and a image field from a reference field from the collected items.
So far I was led in the direction of 'bundling' and 'nesting', but I am not quite sure if this is the way forward.
In order to retrieve the filtered items, I have used the following POST method:
POST /item/app/11821547/filter/
Body:
{
"from": -1mr,
"to": -0mr
}
And then, from the items I here retrieve, I want to GET the referenced items, for instance using:
GET /reference/{ref_type}/{ref_id}
And finally, I want to get the image URL from the respective field in these referenced items, for instance using:
GET /item/{item_id}/value/{field_id}
Any help is much appreciated!!
To accomplish this you only need to use one API call to the Podio filter items endpoint in which you wrote above; POST /item/app/11821547/filter/.
In your POST body, you can filter down your results with the created to and from dates. For example, if you only want the items for the past month, you can use Klipfolio's date parameters. Your POST body will look like this:
{
"filters": {
"created_on": {
"from": "{date.addMonths(-1).format()}",
"to": "{date.today}"
}
}
}
This will return an API reponse of all items that were created within the past month. From here you can build a klip and manipulate the JSON with xpath expressions to extract the image urls and names. All this information will be within the #item/fields array in your API response. You'll have to determine which field ID is used for the name and image url field. These are unique to each account.
An example of xpath to extract these values would be like so:
#/items/fields[field_id='id_number']/values/value
Where id_number is the exact id number for the field.
If you are unfamiliar with xpath expressions within Klipfolio, here is a document that walks through this.

Flipkart Product API - How to get top selling product from the category

According to the flipkart product api we can get the top selling products from the category, but I'm not able to get the top selling products. According to the flipkart following is the sample url which return top selling products.
https://affiliate-api.flipkart.net/affiliate/1.0/topFeeds/fnkygygma/category/reh/55ab6c2673a4773ffb8e4019.json?expiresAt=1452881213871&sig=1c4c5111b6b014a71a17b229e6df6afc&inStock=true
I have following queries.
what is reh in the URL?
what is "55ab6c2673a4773ffb8e4019" in the URL is this category name, how I'll get the category name like this for other categories.
As I know "expiresAt" comes from flipkart, how I can generate this myself?
How I can generate "sig"?
it will be really helpful if someone answer for this.
My guess is you would have to query their database for the ID of the category that you want the top products from, and then use it in the URI when requesting the feed.
The documentation doesn't show "reh" in the URI so I'm guessing that sample is for testing purposes.
I found the section that says, "The Product Feed Listing API provides the full list of categories present in the catalogue."
The URI is: https://affiliate.flipkart.com/api-docs/af_prod_ref.html#product-feed-listing-api
You do realize that there is a new version of the API? It's 1.1
The documentation says that you have to request a list of the categories with this URI: https://affiliate-api.flipkart.net/affiliate/api/<trackingId>.json
Insert your ID where it says <trackingId> and it will return a list of the categories along with metaData.
The categories live in the apiListings section of the JSON response.

Ebay Finding Api: how to get searchResult.item.attribute?

The docs mention it in the output section as an array of name/value pairs. Says they come "conditionally" but gives no clue about these conditions.
How can I get these fields?
Best solution so far was GetMultipleItems from Shopping API. It returns "attributes" for 20 items. You need to add "IncludeSelector=ItemSpecifics" and the list of item ids in the request.