Get the product_retailer_id / Content ID for a specific product - facebook-graph-api

I'm trying to get the product_retailer_id (or as it's displayed in the catalog - Content ID) but it is not showing when I use the product_endpoint
I've used the graph API explorer and included all items that can be included for a specific product:
there's retailer_id
But that returns a null
I used the graph api explorer and included all potential fields for a product but none of the results return the field I'm looking for.

Related

How to get specific Wikipedia page section?

I want to create a graph database of actors and the movies in which they've acted. To get the list of actors and movies, I'm trying to use the pywikibot parser, but I've only been able to get the full page, when I just want the filmography portion of the page. Is there a way to parse the page so I can just obtain the filmography? Here's what I've done so far:
import pywikibot as pw
site = pw.Site()
page = pw.Page(site, actor_name) #will be put into loop to get multiple actors
print page.text #returns full text of the page in format below
print page.linkedPages #returns linked pages
One idea is had was to return all the linked pages associated with the actor, since most movies are linked. The format in which I get the text data is as follows:
{{Infobox person
| name =
| birth name =
}}
Summary
==Early life==
==Career==
==Filmography==
What can I do to only get the Filmography portion of the page?
You can do it with Wikipedia API. For example, to get Filmography section for William Alland you need to get the index of the section with name "Filmography" by:
https://en.wikipedia.org/w/api.php?action=parse&prop=sections&page=William Alland
From response we see that it is 2. Then we have to use that index to get the text only in this section:
https://en.wikipedia.org/w/api.php?action=parse&prop=text&section=2&page=William Alland
Note: Use prop=wikitext instead text to get the content in wiki format.

Magento 2 products list API - How to list configurable products, which has simple products with a specific custom attribute value

In my magento 2 site, I have configurable products and simple products. On product listing page, I am listing only configurable products using this API call -
GET V1/products?
searchCriteria[filter_groups][0][filters][0][field]=type_id&
searchCriteria[filter_groups][0][filters][0][condition_type]=eq&
searchCriteria[filter_groups][0][filters][0][value]=configurable
products has a custom attribute cb_color, which is applied to simple products only.
How to list configurable products, which has simple products with a specific cb_color custom attribute value?
This API call returns empty result -
GET V1/products?
searchCriteria[filter_groups][0][filters][0][field]=type_id&
searchCriteria[filter_groups][0][filters][0][condition_type]=eq&
searchCriteria[filter_groups][0][filters][0][value]=configurable&
searchCriteria[filter_groups][1][filters][0][field]=cb_color
searchCriteria[filter_groups][1][filters][0][condition_type]=eq
searchCriteria[filter_groups][1][filters][0][value]=326
because configurable does not have custom attribute cb_color

Graph API: Posting as contributor to shared albums

Shared albums is a quite new feature of Facebook.
I'm encountering an issue with the Graph API while trying to publish photos to a shared album. The issue is actually related to the ID of the album.
As user A, I create an album getting the ID 1 and I add user B as contributor.
As user B, I can retrieve the album 1 using the Graph API but the "can_upload" flag is set to "false". Which prevents contributor B to upload photos to this album.
When I try to get the album's information as user B using facebook.com, it looks like the album has a different ID than 1, let's call it 2. When I retrieve album information as user B using ID 2 with Graph API, the "can_upload" flag is correctly showing "true".
Apparently the original's album ID is known as a different ID to album contributors. But how can I find out the ID allowing contributors to upload photos to it?
As there seems to be no API call to retrieve the ID (2) of the album to be used while publishing as contributor (user B), this is how one can manage to get it:
As user B (contributor), get the info of the album using its original
ID (1). Make sure to include field "cover_photo" in the request.
Get the info of the cover photo, using its ID retrieved above. Make
sure to include the field "link" in the request. Parse the "link"
field in order to retrieve the value of the parameter "set" which
contains the album ID.
Get the album ID by extracting it from the value above. The format is
something like "a.1234567890" or "a.1234567890.2345678901" where the
contributor's album ID (2) would be 1234567890.

How to correctly insert managed metadata term id using spservices updatelistitems

I have a sharepoint 2013 site that uses a managed metadata term set for navigation. Documents can be tagged with the managed metadata so they appear in whatever category or categories is appropriate for the document. I need to allow documents to be saved as favorites. I created a custom list that saves the file name and path but I can't get the managed metadata settings to save correctly. I am using spservices.UpdateListItems via javascript and pass the ids and terms in the valuepairs property of the call like so ;#. Although the method saves the record, it either does not save the term or it saves one completely unrelated. Does anyone have any further advice on how to do this?
$().SPServices({
operation: "UpdateListItems",
async: true,
batchCmd: "New",
listName: "UserFavorites",
valuepairs: [["Title", title], ["DocumentId", itemid],["AssetCategory", assetCategoriesString]],
completefunc: function (xData, Status) {
alert(Status + " -- " + xData.responseText);
}
});
Example of the assetCategoriesString variable contents:
"fc8d083a-fc5e-4525-8fef-04ba982d1633;#Print Publications"

Shopify Python API - how to search for a product

I have built a django app that is the primary store for my products. From this, I publish products to my Shopify Store. Now my django app knows first when my product goes out of stock.
Question:
What options do I have to search for products using the Python API? Can I search by Title, Variant SKU?
Is storing the generated ID while publish the only means to get a handle on the product later?
I want to do this - so that I can mark the products Out Of stock, in a batch process, for example.
Storing the product's id is the simplest way to get a handle on the product later.
However, the product API shows that you can filter products by vendor, handle, product_type, collection_id, published_status, updated_at, created_at or published_at.
The Using the shopify python API page shows how you can use these filters through keyword arguments to the find class method, e.g. shopify.Product.find(collection_id=841564295) to list products in a specific collection.
YOu can use the official shopify python API to find a product with id:
shopify.Product.exists(product.id) # => True
product = shopify.Product.find(292082188312)
For searching products with the product title, you can use GraphQL API