I have no problem when I get data. I use this library for client:
https://github.com/bettiolo/oauth-signature-js
for example, to "View List Of Products" I Create this URL with above library (key and others are not real):
http://example.com/wc-api/v2/products?oauth_consumer_key=ck_inh2u3n54ui2ny52uh425un4252u5245&oauth_nonce=0.9062660784657346&oauth_signature=jHJGHDhjjh7y3ghGH%gbhfdhHGDS6262&S3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1439148955
when I paste this URL in the browser, I get a list of products.
But I do not know how I post data. for example creation of product.
What is the currect URL for create product?
please give an example.
Hi #sasan for creating a product, GET method will not work. You have to POST data.
Please check this URL http://woothemes.github.io/woocommerce-rest-api-docs/#create-a-product
Related
Using the WooCommerce API I want to send an HTTP GET request to download all products with a specific attribute.
The documentation says the URL to do this with is this
/wp-json/wc/v3/products
And I can add parameters to the URL in order to filter the products.
I have successfully added filters for page and page count:
wp-json/wc/v3/products?per_page=100&page=10
I have also managed to get only available products with this parameter:
wp-json/wc/v3/products?&stock_status=instock
However, I cannot manage to add a filter for the attributes. I have tried the following ways to write the URL and non of them work
wp-json/wc/v3/products/?attribute=1
wp-json/wc/v3/products/?
wp-json/wc/v3/products/?attribute_pa_емаг=Да
wp-json/wc/v3/products/?filter[pa_емаг]=10
What would be the correct way to write the URL?
(Note: The attribute is pa_емаг and its value is Да)
The correct call would be:
/wp-json/wc/v3/products?attribute={attribute-taxonomy}&attribute_term={term-id/tag_ID}
Where attribute-taxonomy would be full slug in your case "pa_емаг", and term-id/tag_ID the id of "Да".
We have GA on a site that has hundreds of subdomains and each subdomain can have query parameters attached. I have a filter set up to show full domain and it's as follows...
Now, when I go to Behavior -> Site Content -> All Pages I see all the subdomain pages that were visted
john.male.personfinder.com
stacy.female.personfinder.com
mark.male.personfinder.com
sue.male.personfinder.com
What's not being "tracked" (probably the wrong term), is the query parameters that COULD follow the above urls.
john.male.personfinder.com
john.male.personfinder.com?state=ca
john.male.personfinder.com?state=ca&city=sf
Do I need to set up another filter to track these query parameters? Google Analytics is like a foreign language to me, so any walkthroughs and explanations would be GREATLY appreciated. Searching the web gave me mixed answers that didn't quiet match what I was looking for.
Thanks!
I think you will need to populate a custom dimension from your site, to get the parameter information.
Here's a snippet from my use of something similar:
$scoreid = $_GET["scoreid"];
...
<a name="metadata" id="metadata" data-scoreid="<?php echo $scoreid; ?>"></a>
I then use the data-scoreid DOM element to populate a custom GA dimension (in my case via a Google Tag Manager variable).
Google deprecated the old RSS feed URL format December 1st 2017 (deprecation notice), in addition to that they dropped the button in the Google News interface to generate a RSS URL (news mentioning this change).
This means that there is no public or documented method of generating a new RSS link. The only documentation they have is out of date since they changed the interface.
What is the new format for generating a RSS feed for a Google News topic?
Found an up-to-date library (1) that uses Google News RSS.
The URL new format seems to be:
Top news:
https://news.google.com/news/rss
By major topic:
https://news.google.com/news/rss/headlines/section/topic/{topic}
Where {topic} is one of the following values: WORLD NATION BUSINESS TECHNOLOGY ENTERTAINMENT SPORTS SCIENCE HEALTH
By any/custom topic:
Once at https://news.google.com, browse to the desired topic, for example this. Identify the topic ID in its URL, e.g. CAAqIQgKIhtDQkFTRGdvSUwyMHZNR056T1hFU0FtVnVLQUFQAQ, and use the format:
https://news.google.com/rss/topics/{id}?hl={lang}
In the format above, essentially rss/ is added after https://news.google.com/.
By geolocation:
https://news.google.com/news/rss/headlines/section/geo/{location}
Not sure about the formatting for the {location} parameter
By search query:
New link: https://news.google.com/rss/search?q={query}
Old link: https://news.google.com/news/rss/search/section/q/{query}
Where the {query} parameter is a free text search
Specifying country and language:
For example if you wish to have news in Swedish and located from Swedish sources, add the following query string to the URL to change country and language to sv-SE:
?hl=sv&gl=SE&ceid=SE%3Asv
Requests to the Geo endpoint seem to be working again.
e.g. https://news.google.com/news/rss/headlines/section/geo/{place_name}
Also, if you use the non-geo search, you can specify a 7-day window by adding +when:7d to your search.
e.g. https://news.google.com/rss/search?q={key_words}+when:7d
This options isn't valid anymore:
https://news.google.com/news/rss/headlines/section/topic/{topic}
produces Error 500.
This seems to work:
https://news.google.com/news?cf=all&hl=en&pz=1&ned=us&q=astronomy&output=rss
The Geolocation mentioned above still works too. You can also specify city and state:
https://news.google.com/news/rss/headlines/section/geo/DenverCo
Updated Google RSS News Feed
You can try this as well.
https://news.google.com/rss?hl=en-NG&gl=NG&ceid=NG:en
I was also looking for documentation. This is the best article I found.
https://blog.newscatcherapi.com/google-news-rss/
If using search you can also specify not to include articles with a certain keyword.
e.g. if I wanted to search for pages that contain the word "apple" with out the word "pie" you can specify
q=apple%20-pie
or in full
https://news.google.com/rss/search?q=apple%20-pie&hl=en-GB&gl=UK&ceid=GB:en
The RSS feed for top stories is the simplest one. Just append RSS to the https://news.google.com and you get the RSS feed of the top stories of your location.
https://news.google.com/rss
Know more
I am working with the WORDPRESS REST API and Wordpress version 4.8 for an internal network page at a local office. We have permalinks disabled (security reasons) and thus I am accessing the posts object like so:
https://url/blogs/usernamehere/?rest_route=/wp/v2/posts/12345
I am able to do a GET request and can get the posts data into my view template with no issues. However, I can't seem to figure out how to consume additional content in the post object . I have followed the documentation and tried to do:
https://url/blogs/usernamehere/?rest_route=/wp/v2/posts/12345?_embed=true
But, I get a STATUS 404 .
How would I correctly apply the embed function in the URL so I can get the additional data associated with the post?
Pass the _embed global parameter without a value, per the documentation.
you should do this:
https://url/blogs/usernamehere/?_embed=true&rest_route=/wp/v2/posts/12345
Basically you add _embed=true at before other parameters and after & add other parameters.
I have created an app which is displaying some products using the WooCommerce Rest API.
I have applied a few filters and everything was looking good until I tried to apply a filter for the category
http://foo/wc-api/v3/products?filter[limit]=15&filter[category]=some-category&oauth_consumer_key=ck_xx&oauth_nonce=xx&oauth_signature_method=HMAC-SHA1&oauth_timestamp=xx&oauth_version=1.0&filter%5Blimit%5D=15&filter%5Bcategory%5D=antioxidants&oauth_signature=xx%3D
Now I get the message
DENIED - The requested resource requires user authentication. (XHR): GET ...
Any ideas why that is?
Found the answer (at least it's working for me)
You need to make the filter[category] the first parameter in your query string.
I'll let the guys know about this too.