Clio API Filter data based on nested resource - clio-api

Filtering data based on a top level resource is straightforward, but what is the proper syntax for the url when attempting to filter based on a nested resource? For example, if I want to return all tasks but only for open matters, how should I enter that into the URL endpoint since the Matter Status is a nested resource under Tasks?
I do not see the method for filtering based on nested resources covered in the Clio API documentation.

As far as I understand, you can only filter by the options Clio's API provides. For example when querying a Matter, you can filter by an originating_attorney_id but not a user_id as the API doesn't provide a way to do that. You'll just have to pull in all the data and filter it in your code logic.
You can reach out to the Clio API team and ask them to add a specific filter option and see if they'll do that for you. I've found that they are at least willing to have a dialog.

Related

Azure Devops API - Can't find a way to get permission groups/membership using API

I am looking for a way to use the Azure DevOps API to get membership of permission groups. The data I am looking for is in the following location on the front end:
I had the same requirement to get team membership within Azure DevOps and was able to do so using the following URI:
https://dev.azure.com/{organization}/_apis/projects/hrs/teams/{teamname}/members?api-version=6.0
I could not find a similar URI to get permission groups and need a way to pull this information using the API.
I've tried many of the API endpoints on the official api documentation (below) focusing on any that seem like they may pull security group related information. In all cases I came up short either because the endpoint did not provide me with what I was looking for, or the documentation for an endpoint wasn't clear on how parameters need to be structured for more advanced use cases.
https://learn.microsoft.com/en-us/rest/api/azure/devops/graph/groups/get?view=azure-devops-rest-7.0&tabs=HTTP
I also tried asking this question to ChatGPT however the endpoints the chatbot provided me with did not work either.
I found a way to get what I am looking for, but I am not a big fan of the approach.
You can use the graph API to list all permission groups
once you have the permission groups, you can write a script to filter for the group object within the API response you want to get the members of.
The group object has the appropriate API endpoint to hit to get the member objects within the _links.memberships property.
Call the API with the memberships link from above. It will return an array of descriptors which can be used in further API calls.
For each descriptor, hit the appropriate API endpoint to resolve the object for that descriptor. If the descriptor starts with aad then it is a user and you can use the user get api. If the descriptor starts with aadgp then it is a group and you use the group get api.
This strategy is rather complicated and requires an API call for each member of the group. I'd hope there is a better solution.

How can enable the filter on managed metadata fields on REST API direct?

How can enable the filter on managed metadata fields label on REST API direct and fetch all the fields using the filtering of the MMS field using direct REST API?
I got the same situation on this i have enable the filtering using the Managed Metadata fields on a list using the below API:
_api/Web/Lists/GetByTitle('List-name')/Items/?$select=*,TaxCatchAll/Term&$filter=TaxCatchAll/Term eq '${Managed-Metadata-field-value}'&$expand=TaxCatchAll
'Managed-Metadata-field-value' means: Country is the MMS field and US is the value put US on here
But the API have limitation i think this filter enable only on a single MMS field.
Refer:workaround-to-filter-on-taxonomy
its not possible out of the box, but there are some workarounds for this.
See: http://www.cleverworkarounds.com/2013/09/23/how-to-filter-on-a-managed-metadata-column-via-rest-in-sharepoint-2013/

REST API - Logical way to name an endpoint

I want to follow the best practice to implement a REST API. There is a resource I want to expose and I can think of two ways of doing it as an endpoint.
I want to give the user the opportunity to receive all the payments for a certain campaign.
I can expose /campaigns/{id}/payment that returns a paginated list of payments with all the data for each (name, address, date...). Where /campaign/{id} in turn returns all the data of the campaign (name, description..., array of paymentId with a route to get them one by one).
Or I can expose /payments/campaigns/{campaignsId}.
What is the best approach and why?
I would use /campaigns/{id}/payments because it communicates the contents of the response that the client can expect when querying this URL with a GET most clearly and according to common practice.
GET /camapaigns/{id}/payments
reads much like "give me all the payments for the campaign with id = {id}". So this follows the principle of least astonishment. Also, the client then gets exactly what's requested.
There's a nice API design guide for RESTful APIs from Microsoft, if you'd like to read more about this.
Assuming that REST cares about the URI spelling is a misconception.
However, I encourage you to adopt a consistent naming convention in URIs for your API. It's a common approach to use use plural nouns for URIs that reference collections and organize the URI to represent a hierarchy.
So, for the situation you've described in your question, you could use /campaigns/{id}/payments for identifying your resource. It identifies a collection of payments for a particular campaign.

Find users with a particular license in Azure Graph REST

Has anyone queried the Azure Graph REST API by licenses? I can't find any examples using REST online. We use REST for our operations and a need has come up to generate license reports and I'd like to be able to execute queries based on license codes.
Any help would be appreciate. Thanks for your time.
According to your description, it seems that you’d like to filter users by assignedLicenses that is a multi-valued complex type. From this documentation, we could find that currently the API seems not support querying of (filtering) a multi-valued complex type (assignedLicenses).
As a workaround, you could try to get users from API and leave the filtering on the client side.

specify an action to run via REST API

Just wondering what the best practice is for specifying an endpoint in rest to say "runSomeAction"? I'm aware of the uses for GET,POST,PUT,DELETE operations and using nouns to specify those endpoints, but what is the preferred method for exposing server functionality that isn't a CRUD type operation?
EDIT:
The result of the action will just kick off a process on the server and return a status of 200 immediately (before process is complete), no body. This process is specifically running some validation rules against saved items in a database.
What is the end result of the action? Typically, you do a PUT/POST to create the resulting resource. For instance, instead of POST /sendEmail, you'd do POST /email-notifications.
EDIT
In your case, I would consider your resource to be the results of the validation. I would suggest either POST /validations or POST /validations/{whateverTypeIsBeingValidated}. You could alternately go with validation-results. Even if you don't support the client viewing the validation results now, you have the option to do so later.
Also, per #MartinBroadhurst, a REST API may not be an ideal tool here.