Can I get tagged users in a public post through Facebook api? - facebook-sdk-4.0

I can get the post id, get post details (number of likes, comments, message, photo attachment etc.), but I can't seem to find a way to get the list of facebook users who got tagged into that post. Is it posible to do that?

You could get the post Id and then pass this to the post to get the list of tags:
post_id?fields=with_tags

Related

How to add mentions or tagging a person in Linkedin post from linkedin share URL?

We can create a post with a message prefilled from the URL using the below way
https://www.linkedin.com/feed/?shareActive=true&text=Hii%20Hii%20#lavanya
but when we mention a person in the text, it won't auto-detect, again we need to click on that and select the person from the given list of people.
Is there any way to auto-detect the person that we trying to tag

LinkedinApi: get person data by url or name, surname

Is there a possibility to get a person's info (name, current job, title, etc.) from the LinkedIn API?
I found a search endpoint(https://developer.linkedin.com/docs/guide/v2/people/profile-api#public-profile-url), but it only allows to search by person id, which I have no clue how to get)
https://api.linkedin.com/v2/people/(id:{person ID})
I have for a link, for example: https://www.linkedin.com/in/anton-holovko-7a070476/
How to get person id according to that link (using the LinkedIn API)?
well i couldnt find the endpoint but i can tell you that all V2 api's of linkedin require you to be a partner with linkedin. so that means you have to accuire a partnership and you have to specify which api's you are gonna use to get access.
https://developer.linkedin.com/partner-programs
and normally you get an ID from people that like/comment on a certain post. so if you get posts via the API you also recieve an ID of a person.

Get all categories, custom field values in Wordpress query?

I've setup an API endpoint on a Wordpress site I'm working on, but the posts I'm retrieving have quite a bit of associated data, I think doing a query to get the posts then running the posts through a loop and getting this data will be too intensive, is there a catch all that can get all meta data at the same time as getting the posts?
If you're using REST API, you can use the function register_rest_field to add fields to responses. And then you can query all custom fields to put them in the responses.
If you're using a plugin like Meta Box to create custom fields, then you can use its free extension MB REST API to pull all the custom fields into REST API responses for you.

How to sort products in WooCommerce WordPress JSON API

I am using WooCommerce JSON API on my mobile app but I am having problems sorting the the product list.
This is my url https://www.storeurl.com/wp-json/wc/v1/products but I don't know which parameters to add to the url to sort the products according to price, reviews, rating and popularity.
I have read the docs but I couldn't find it. Please do you know I could do this?
You just need to append the parameters as part of the query string like so...
https://www.storeurl.com/wc-api/v3/products?orderby=title&order=asc
To take that further, you can use the "Filter" parameter, which allows you to use any WP_Query style arguments you may want to add to your request. So for example, if you wish to sort by "Price", you would do something like...
https://www.storeurl.com/wc-api/v3/products?filter[order]=asc&filter[orderby]=meta_value_num&filter[orderby_meta_key]=_regular_price
Filter - Use WP Query arguments to modify the response; private query
vars require appropriate authorization.
Ref: https://woothemes.github.io/woocommerce-rest-api-docs/#list-all-products
After a long search I found solution.
you need to pass query Param like below
https://v1t.a8c.myftpupload.com/wp-json/wc/v3/products? consumer_key=ck_4fxx69xxx195565b4ffca55aca56d2f4d6e&consumer_secret=cs_3928b95d5xxxxxe1e82xx210748956&page=1&status=publish&category=130&per_page=1&orderby=price&order=asc.
Also you can sort by below param.
date, id, include, title, slug, modified, menu_order, price, popularity, rating
Ex: &orderby=popularity, &orderby=rating
if you still facing issue comment here i will help you.
Thanks

Create two resources at once using Restful HTTP API

I am designing a restful HTTP API for my application.
The app has Categories which have Products.
I want the users to be able to create a product within a category, and if that category doesn't exist, then it would be created automatically. So there would be no API for creating the category separately (since I don't want people to create categories without any products).
I don't quite get how I should design the API for this. The usual way would be:
1. Create a category:
POST /categories {"name": "Movies"}
2. Use the new category's id to create a product:
POST /categories/:id/products {"name": "The Matrix"}
Since I don't want to expose the first one to the users, how should I let them create the product directly?
Products should probably not be a subordinate resource to categories. Just create the new product with a list of categories that it belongs to, then use the /categories resource to browse the categories. New categories are added as a side effect when a new one appears in a product's category list.
1. Create product:
PUT /product/the_matrix {"name":"The Matrix","category_list":["movies","science fiction"]}
2. Browse categories:
GET /categories
It looks like you are stuck in level 2 of the RMM. In level 3, hypermedia controls allow you to define the valid interactions with your resources. For instance
GET / HTTP/1.1
might respond with
HTTP/1.1 200 OK
<catalogue href="/">
<products href="/products"/>
<categories href="/categories"/>
</catalogue>
You could then follow the products link
GET /products HTTP/1.1
which might respond with
HTTP/1.1 200 OK
<products href="/products">
...
<create href="/products" method="post">
<input name="name" type="string" cardinality="required"/>
<input name="category" type="string" cardinality="required"/>
</create>
</products>
You could then create a new product as follows
POST /products HTTP/1.1
Content-Type: application/x-www-form-urlencoded
name=The+Matrix&category=Movies
When received by the server, it would create the Movies category if it doesn't exist and then add The Matrix product to the Movies category. Meanwhile, following the categories link in the initial response may provide a mechanism for searching and browsing the categories, but it would not include a create form as your business rules don't allow users to create empty categories.
For more details, see REST in Practice.
Yes, you can let them create product directly
I want the users to be able to create a product within a category, and if that category doesn't exist, then it would be created automatically. So there would be no API for creating the category separately (since I don't want people to create categories without any products).
So, there is no possibility to create category explicitly. But you need some id to create product inside of it. I suggest you following solution.
You need some id for category. And in some way client should know about categories. So you can have optionally possibility to get categories list.
GET /categories
Anyway with list of categories or without it, you can expose URL to user to create product:
POST /categories/{catIdOrName}/products
In this operatio you should check whether {catIdOrName} exists, and if no create it and product inside of it. But truly speaking, category creation then isn't clear. But such behaivoiur could be.
Better way I see:
Operation to get list of categories.
In Product object - property/field with category. Anyway you should have connection between Category-Product,
In Category object field/property "bool isNew"
When user is creating product into new category, isNew will be true and in URL will be used special Id for new category or 'new' string id.
POST /categories/new/products
When with request comes category that already exists but marked as new. Than return 409 Conflict.
When product comes to existing ctaegory than real category id in URI will be used.
POST /categories/sport/products
Or as an alternative make categories and products independent by URI. And create only products by POST /products, where in Product object category is set and while execution it will be created if needed. And on categories resource it will be able only to fetch list of categories by GET.

Resources