Is there any way to retrieve Amazon product code? - asp.net

I am trying to display the amazon products of a specific category on my website using amazon product advertising api.
I am writing code is asp.net.
I am being able to successfully retrieve its price, title,image,url.I also want to get its product id that amazon uses.I had a look at its documentation in which they had mentioned something about the UPC(universal product code) and ASIN.But they have explained look up search based on UPC and ASIN.
I am too confused as to how to get its product id.
String requestString ="Service=AWSECommerceService"
+ "&Version=2013-29-03"
+ "&Operation=ItemSearch"
+ "&AssociateTag=myassociatetag"
+ "&SearchIndex=" +category
+ "&ItemPage=5"
+ "&Sort=relevancerank"
+ "&ResponseGroup=ItemAttributes,Images"
+ "&Keywords=" + keyword
+ "&Timestamp=[YYYY-MM-DDThh:mm:ssZ]"
;
Can you please help me and tell me where to add itemid in this requeststring.
Thank you .

Add the response group "ItemIds" to retrieve "ASIN" into your request parameter
"&ResponseGroup=ItemAttributes,Images,ItemIds"
UPC is returned by "ItemAttributes" response group which is already in your code.it will only return UPC if it exists in Amazon Database.

Related

Selected tickets are shown in the booking details page instead of date

[eenter image description herenter image description here](https://i.stack.imgur.com/diMU2.jpg)My project is amusement park ticket booking system I am doing with the help of .net and c# and SQL server so my main problem is in booking details in date section selected no of tickets are displayed instead of date.
I have write in c# code Response.Redirect("MyBooking.aspx?I'd=" + e.CommandArgument.ToString() + "&tickets=" + list.SelectedItem.Tostring() + "&date=" + list.SelectedItem.ToString());
I think I am writing in "&date" = + list.SelectedItem.ToString()
So instead of Selected item.ToString() what need to be write

WC API - Query across multiple products

I am setting up a site (WP) which will essentially sell one type of product and integrating a mobile app (ionic).
Multiple vendors can sell (WC Vendors) the variable product on the site at different quantities (100 litres, 200 litres etc).
I need to be able to make a GET request to return each vendors variable product for that quantity.
e.g. Customer selects they want 300 litres in the mobile app, I then use the API to return all variable products for that quantity (300 litres). So in the end, I have a response which will contain something like below;
Vendor: Vendor 1, Product: Product Name, Quantity: 300 litres, Price: £200
Is this possible as the WC API stands now?
For anyone else struggling on this, I finally got it to work by using the tags as suggested above and to query by tags using this;
https://example.com/wp-json/wc/v3/products?tag=20?consumer_key=ck_xxxxxxxxxxxxxxxxx&consumer_secret=cs_2xxxxxxxxxxxxx
I think you need to rephrase this a little bit, But From what I can get. You have a Vendor and a Product that has a Quantity of 300 L which in the first place I'd recommend you Should avoid, Rather just use Liter , Now what I'd Recommend is Tag's.
You'd have your Vendors and products under Categories.
And you can Set Tags on Products that you'd like to have what you require.
Then When someone Selects 300L , 200L It will pull every Product with the Tag 200L And you'll be able to display them.
Official Document
/wp-json/wc/v3/products/tags/<id>
They have:
id integer Unique identifier for the resource. name string Tag name.
slug string An alphanumeric identifier for the resource unique to its type.
description string HTML description of the resource.
count integer Number of published products for the resource.

woo-commerce API filter product by category

I am using woocommece api for mobile app development. I need to filter product by category.
I used following query for filtering products
'products?filter[product_cat]=watches'
But it also return all product.
I am using woocommence Version 3.1.2 .
What is the problem of query ?
How to overcome this issue ?
Due to Woocommerce REST API V3 docummentation you can filter products by using this parameter:
category - (string) - Limit result set to products assigned a specific category ID
it should look like
https://<site url>/wp-json/wc/v3/products?category=category_id

I want to get data in wp Api using search keyword

I want to get data in wpApi in url i am using search like this
https://www.digitemb.com/wp-json/wp/v2/posts?_embed&?filter[order]=DESC&filter[posts_per_page]=5&search=digitize&page=1
My Question is that How do i get posts data from specific categories. i don't want to get data of all categories i use this logic to
search(keyword,id){
return this.http.get("https://www.digitemb.com/wp-json/wp/v2/posts?_embed&?filter[order]=DESC&filter[posts_per_page]=5&search=" + keyword + "&page="+id)
.map(data => data.json());
}
but this data can get all categories i want specific categories posts !
Use the ID of the category to get back all posts from that category.
http://www.example.com/wp-json/wp/v2/posts?categories=category-ID
List of available arguments - https://developer.wordpress.org/rest-api/reference/posts/#arguments

ASP.NET MVC2 CategoryTree Routing

I have in SQL DB table:
Categories:
int CategoryID
int ParentID
string Name
I want make link somelike this : localhost://(Name)/(Name)/(Name) and the last (Name) is selected category.
Real example: localhost://Sports/Vodni-Polo/Balls
Problem: in DB is name of category Vodni-Polo is Vodní pólo. On link creating i translate name to SEO link shape (Vodni-Polo).
How i can get category id wihout sending extra get parametr (Sports/Vodni-Polo/Balls/?categoryId).
I get Full tree of category from DB all time, but i must know witch items i can display it.
What i want: If i click at category, send GET req.(localhost://Sports/Vodni-Polo/Balls) a from this i want know whot id have (Balls)
You can make the Name a Unique key so you can query by it and guarantee uniqueness. Alternatively a common solution is to do something like {controller}/{action}/{Name}-{Id}

Resources