How to get only specific value in REST API JSON response? - flutter

I'm using REST API to get data from my Learndash courses. I need a list of ID, title, and feature images. I used .. to get the lists of IDs and titles. But when I use _embed I also get IDs from wp:featuredmedia. So I want just source_link from wp:featuredmedia
I tried _fields parameter and also _embedded. Nothing is working
My question is, How to get only the id, title, and featuredmedia link from REST API call?

Related

Proper multi-id syntax when using the custom_file_ids[] query parameter for the CLIO API "contacts" endpoint

What is the correct API syntax for using the custom_file_ids[] query parameter to specify multiple fields (but not all) in the CLIO API contacts result set? I need to specify multiple custom fields. I can get it to work for a single field, but not multiple fields at the same time.
Specifically, how do I specify and delimit the multiple fields? I have tried the following:
custom_file_ids[]=1234567,2345678
custom_file_ids[]=[1234567,2345678]
custom_file_ids[]=(1234567,2345678)
custom_file_ids[]={1234567,2345678}
custom_file_ids[]=1234567:2345678
The API documentation at https://app.clio.com/api/v4/documentation is silent on the list syntax that it expects.
Below is one specific API call I tried (both the actual URL-encoded call, and a decoded one for clarity) using a simple comma-delimited list, but which only returns custom field data for the first ID in the list--not the second. If I enclose the ID list in any kind of brackets (per above), the endpoint returns a 404 error.
https://app.clio.com/api/v4/contacts?custom_field_ids[]=1234567%2C2345678&custom_field_values[4529224]=true&fields=id%2Cname%2Cprimary_address%2Cprimary_work_address%2Cis_client%2Ctype%2C%20primary_email_address%2Cprimary_phone_number%2Ccustom_field_values%7Bid%2Cfield_type%2Cfield_name%2Cvalue%2Ccustom_field%7D
https://app.clio.com/api/v4/contacts?custom_field_ids[]=1234567,2345678&custom_field_values[4529224]=true&fields=id,name,primary_address,primary_work_address,is_client,type,primary_email_address,primary_phone_number,custom_field_values{id,field_type,field_name,value,custom_field}
Try:
custom_file_ids[]=1234567&custom_file_ids[]=2345678
I was able to do this with Contacts Custom Fields by putting custom_field_id[] on the URL as many times as you have IDs.
I hope this helps.

Get specific product with id via Rest API Magento 2

I want to get the information from an specific product.
I am using this reference in this moment, and get all the products in given searchCriteria:
http://www.mysite.co/rest/V1/products-render-info?storeId=1&currencyCode=cop
Is there a way I can send the product id in the url and get only all its information?
You can add the filter
http://www.mysite.co/rest/V1/products?searchCriteria[filterGroups][0][filters][0][field]=entity_id&searchCriteria[filterGroups][0][filters][0][value]=1&searchCriteria[filterGroups][0][filters][0][condition_type]=eq
use field entity_id instead of id, value is product id here 1, condition_type is equal to here eq.
You can fetch product info by SKU, not ID.
API endpoint (get method) will pull product info. vendor/magento/module-catalog/etc/webapi.xml
/V1/products/:sku
So, your rest API calling URL should be like this
http://www.mysite.co/rest/V1/products/productsku
Note: If you want to fetch product info by id, you probably need to create a simple rest API. you can check this out.
https://magento.stackexchange.com/questions/282480/i-am-new-here-i-want-to-know-how-can-i-create-my-own-simple-api/282730

Post into Confluence table using REST API

Found many examples on simple API queries but nothing close to what i want.
I have my space key and page ID, this is my table
How can i append hyperlinks, and attach a file in cell 3 for each build using REST API.
get the page : add expand=body.storage as a query parameter to get the body.storage.value which holds the html tags. Then parse the get response to edit the specific value in the 's then when updating the page update the body.storage.value withing your json like in the example: https://docs.atlassian.com/atlassian-confluence/REST/latest-server/#content-update

Get TFS work item and its links using REST API

I'm using TFS REST API and am trying to retrieve work items & their child items by title (parent's title is the parameter). I can't find a way to retrieve these linked items using TFS REST API.
This is what I've tried. First I query for the work items by title:
URI = http://[tfspath]/_apis/wit/wiql?api-version=1.0
query = SELECT * FROM WorkItem WHERE [System.Title] = 'some title'
The above returns me an object WorkItems which has only the ID/URL of the matching work item. Then, I use the returned ID on the query below (lets say the id is 1234):
URI = http://[tfspath]/_apis/wit/workitems/1234?fields=System.Title&api-version=1.0
This returns the title of the item & other fields I might include on the fields list. However, I cannot find a way to include the child items in the returns. I've tried including System.RelatedLinks but this does not change the returned fields. Example:
URI = http://[tfspath]/_apis/wit/workitems/1234?fields=System.Title,System.RelatedLinkCount,System.RelatedLinks&api-version=1.0
Returns
"fields":{"System.RelatedLinkCount":4,"System.Title":"some title"}
Which means there are 4 related links to the work item "some title", but they are not being returned.
What am I missing here? How do I get these related links/child items?
Append &$expand=relations to the querystring to fetch the links collection of a workitem:
$expand enum { all, relations, none } none
Gets work item relationships (work item links, hyperlinks, file attachements, etc.).
See: https://www.visualstudio.com/en-us/docs/integrate/api/wit/work-items#with-links-and-attachments
To get a work item with all details as well as the links with details, you'll need to use the APIs that are intended for reporting purposes. Due to the possible shear size of the returned document, it will be chunked and you will be given a watermark. You may need to do multiple requests.
See: https://www.visualstudio.com/en-us/docs/integrate/api/wit/reporting-work-item-links

Use Facebook FQL to select the work information from the profile

I would like to get work place information of a user using FQL.
When I use the Graph API and get the User object, it contains work information, which is essentially a list of the work history. The list elements contain nodes of employer, location, description, etc...
The nodes appear to be pages internally. If I take the id of a node, e.g. from the employer, and use FQL to query a page with that page_id, I do get an object with corresponding information.
My question now is, how do I use FQL to get the same information without accessing the Graph API? What table stores the work-related information, for example how do I find all the page_id of the employers of a given user?
The reason I insist on using FQL only is performance. Of course I could access the Graph API for all the users in question and get the info that way, but I'm looking for an FQL-only solution.
You can get this information from FQL. Read the "user" table and look for the work field. The JSON data returned should be the same format as the one for Graph, i.e., the result is an array and each result should include an "employer" object with an "id" and "name" field.
You will need user_work_history or friends_work_history to access this field.