Bigcommerce API Add Images - bigcommerce

Using the legacy API in bigcommerce, trying to add a product image without success. I have done this before but it seems to not work now.
The API documentation says that there is a function to 'create a product image', however it says that the field 'product_id' is read only and any request will be rejected if it is included. If that is true and not a typo, how are you supposed to create a product image against a product?

Don't add product ID to the parameters, add it to the url. So if you want to add images to product 12345, make a post to
'/products/12345/images'
of the image data
{ 'sort_order': 1, 'image_file': 'http://blah.jpg' }

Related

How to create SEO urls in Shopware 6

I have a shop running on Shopware 6. The data is being migrated into that shop from Magento 1.8. In magento shop one can assign multiple url's to a product. So that a productA can be accessed via shop.domain/productA, shop.domain/categoryA/productA, shop.domain/categoryA/bategoryB/productA.
In shopware after the product got imported it only has one link to it - shop.domain/product-a (shopware parses the names into url keys differently than magento in case of some more crazy product names that I have).
I need help in having the product have the same links it had in magento - shop.domain/productA, shop.domain/categoryA/productA, shop.domain/categoryA/bategoryB/productA. How can I do that?
If this is not possible then how at least can I assign to the product a custom url-key so that it it the same as in magento?
I have found that the product entity in Shopware has a relation to seo_url entity and I have been trying to push different combinations to that endpoint via API, for example:
'foreignKey' => $shopwareProducts[0]->id,
'salesChannelId' => $germanySalesChannelId,
'routeName' => 'frontend.navigation.page',
'pathInfo' => 'productA',
'seoPathInfo' => 'seoPathInfoTest'.$shopwareProducts[0]->id
and it seems to go in without errors, but I have no idea how to make it work on the storefront side (meaning th elink gives me 404). There is a Settings->SEO page where URL seems to be configured but I do not know exactly how to built the snippet to work (tried variations of {% for part in product.seoUrls %}{{ part.seoPathInfo|lower }}/{% endfor %}).
The other thing I tried to use is product's Canonical URL settings and enter some paths in SEO path field but it always gets me this error:
errors [ {…} ]
0 Object { status: "404", code: "FRAMEWORK__SEO_URL_ROUTE_NOT_FOUND", title: "Not Found", … }
status "404"
code "FRAMEWORK__SEO_URL_ROUTE_NOT_FOUND"
title "Not Found"
detail "seo url route\"\" not found."
meta Object { parameters: {…} }
parameters Object { routeName: "" }
routeName ""
I am quite new to shopware and all this is very confusing to me :/ Can anyone help please? Shopware documentation is completely unhelpful in this regard. Oh and I need to use the API because I have about 1600 products to import, so cannot do it by hand. I can easily extract all url keys from magento and if I will knoe how to push them into shopware (seo_url?) then I will be saved.
Same for categories - is there a way to have them use a different url key?
Also is it possible to assign many url's to a product, or can there be only one?
I do not have the cache enabled yet.
All you have to do after all that is to go and refresh your indexes. After that clear the cache.
Settings -> System -> Caches & Indexes
After that the seo urls will be generated. You will have to wait a bit though

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.

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.

Magento API creates simple product correct -> but afterwards tells "101 Product not exists"

I try to add some pictures to a simple product, which was created (without error) by the API. The product is shown in frontend its functional with all wanted attributes. But if I check afterwards
$client->call($sessionId, 'product.info', '123456');
I get Soap Error: "101: Product doesn't exists". But its definitivly reachable over back- and frontend. (Cache cleared, Index refreshed)
Same issue, when I try to add media informations. On Confugurable Products the error don't show up and the pictures are added whithout any problems.
Maybe I messed something up with the attributes or the attribut sets... I don't know, where to watch first.
I'm at my php’s end!
Using Magento 1.6.0.0
Thank your for clarify me.
Best regards.
Since the ame API function ("product.info" in this case) receive as a parameter both SKU and ID, there is a problem if your are looking for SKU's which is numeric values.
To avoid this problem, we always adding space to the end of SKU before sending it to the API. For example, if your SKU is "123456" you should send "123456 " to the API.
Have you tried this call with your product id instead of the sku? I had some problems in the past with product calls and the sku.
I've installed 2 magentos and we always use numeric SKUs and I've always had this problem.
I've solved it by modifying the file:
app/code/core/Mage/Catalog/Model/Api/Resource.php
About line 122 that reads:
$product = Mage::helper('catalog/product')->getProduct($productId, $this->_getStoreId($store), $identifierType);
I've changed it to:
$product = Mage::helper('catalog/product')->getProduct($productId, $this->_getStoreId($store), 'sku');
This way the function always expects an SKU.

How to POST new product in shopify store via api from a private app?

i'm using shopify_app gem and i was able to read to my shop. but then i can't write to it. i have set up the read/write credentials while installing my app so i'm sure the problem's not there. here's what i did to POST a new product in my shop:
product = ShopifyAPI::Product.new
product.title= "Nike Bag"
product.price_range = "27.00"
product.save
but it doesn't save.
Thank you so much. I need this badly.
It looks like this problem has already been solved in the shopify api google group, but just posting it here just in case somebody else finds it useful.
The product above can't be saved because not all required fields are specified. Check the sample in the shopify api docs for a list of required fields. Also check product.errors if save fails, which should give an idea of why it failed.
This should work:
product = ShopifyAPI::Product.new
product.product_type = "Snowboard"
product.title = "Burton Custom Freestlye 151"
product.body_html = "<strong>Good snowboard!</strong>"
product.vendor = "Burton"
product.variants = [ShopifyAPI::Variant.new(:price =>10)]
product.save