Just get a list of tags by calling a http://demo.wp-api.org/wp-json/wp/v2/tagsspecific tagId before your request. This way you will find the tag that you need by filtering the data by your "slug". The demo API does not support CORS, so I am not creating a working script.
Nested failed HTTP request example
$http({
method: 'GET',
url: 'http://demo.wp-api.org/wp-json/wp/v2/tags'
}).then(function (result) {
var filtered = filterFilter(result.data, { slug: 'dolor'});
$http({
method: 'GET',
url: 'http://demo.wp-api.org/wp-json/wp/v2/posts?tags=' + filtered[0].id
}).then(function (result) {
console.log(result.data);
});
});
source
share