HP ALM/QC rest's API seems to default on AND when filtering and using a semi-column. How can i use OR between the following 3 fields instead of an AND.
&query={user-02[NOT Dev];user-08[NOT Y];status[NOT Closed]}
I tried to simulate this in the UI and see the generated filter but with no success.
Related
I am trying to get azure devops work its history/revisions using Updates-List or Updates-Get.
How can I get latest revision of a work item? I tried with odata query to order by rev and take top 1 but the result is always top 1 with out applying filter.
My Query: myrepo/_apis/wit/workItems/30/updates?$orderby=rev desc&$top=1&api-version=6.0
Similar stackoverflow reference is here
It looks like $orderby is not supported in these type of REST API calls. As a workaround you could use the reverse and first functions after you retrieved the list of updates/revisions.
Below is an example for a single work item.
In a compose use the following expression to retrieve the last updates record.
first(reverse(body('Send_an_HTTP_request_to_Azure_DevOps')['value']))
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.
Is it possible to pass parameters with 'like' keyword in REST api endpoints. Basically I'm trying to create an endpoint wherein I would query a db to get list of items based on '%name%'.
The corresponding query in DB would be like:
SELECT * FROM users WHERE user_id like "%arjun%"
So I would need to add parameters to my REST endpoint wherein i can fetch teh data based on name=%arjun%
Is that really possible?
Thanks
Arjun
I would recommend to user name=value and then create your sql with %%. You can put % into your GET call but it can cause bugs because % is special character which is used to encode other special characters.
But if you really want to go with name=%value% then you can put %25 instead of %. So something like this name=%25value%25
EspoCRM provides a REST API that sadly has only incomplete documentation. Especially the filters that can be used with a GET request are not documented:
where - (array) filters;
From using Firebug I've discovered that a filter consists of three query parameters:
where[0][field]=somefield
where[0][type]=somoperator
where[0][value]=somevalue
Example, filter on name=Foo:
?where[0][field]=name&where[0][type]=equals&where[0][value]=Foo
The meaning of equals is not documented, as are the possible filter types.
Now I want to filter a collection on a datetime field modifiedAt. I have no idea what the proper values for type and value would be to find all entities that have been modified after a given datetime.
How can the EspoCRM REST API be used for this?
After playing around with the EspoCRM web GUI, I was able to make a search that uses the filter I need. The query parameters are:
where[0][type]=after
where[0][field]=modifiedAt
where[0][value]=2016-06-01 16:12:00
where[0][dateTime]=true
where[0][timeZone]=Europe%2FBerlin
I am having students model in loopback which is accessible via rest using this url. /api/students rest call gives all the student data but I want to get only the registration numbers (regno) of students. Like in sql (SELECT regno FROM students). how I should filter the above rest call to get only the registration numbers of students.
?filter={"fields":"regno"}
If you want to get multiple columns
?filter={"fields":["regno","column2","column3",....]}
Use the fields filter.
?filter[fields][regno]=true
https://docs.strongloop.com/display/public/LB/Fields+filter