Azure DevOps - Wiql - Query By Id - is there a skip parameter - azure

I'm trying to find a possibility to skip X first elements returned by query.
Link to API: https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/wiql/query%20by%20id?view=azure-devops-rest-6.0.
Just as with Jira you use maxResults with startAt to create paging.
In AzureDevops Services I see option $top but I do not see option $skip (nor it works).
I can limit my result, but can't page through it.
Is there a way to do it?

As of this time, however, the REST API you are using doesn't supported paging.
If a REST API supports paging, there will be skip or continuationtoken parameters in the optional parameters of the document. As shown below:
Generally, Paging is supported only by the REST API that gets the lists.

While the endpoint does not provide paging itself, I believe you can use WIQL for paging.
Sort by ID
Add a constant $top
if page > 1, add a where ID < last processed ID

Related

Difference between odata and fetchxml

I would like understand the difference between odata and fetchxml, this has to do with pagination in MS Dynamics, I am very new to the stack and would like to understand why there are two object models that essentially perform the same tasks?
the problem statement is as follows, we want our product to properly page answers it gets from Dynamics, currently we can only get 5000 answers per page, so if we are supposed to get say 6000 answers per page, how would we go about it:
I understand the limitations of odata, it can only retrieve record size = 5000. To overcome this or see the next set of results, I would have to use the value of the #odata.nextLink property with a new GET request to return the next page of data.
Similarly for fetchxml, there is the option to use paging cookie. Is my initial analysis correct?
But I still do not understand why there are 2 object models?
fetchxml is native Dynamics CRM querying language available from oldest versions.
Odata REST based web api was introduced in CRM 2016 update 1 onwards (v8.0).
There was a SOAP based 2011 endpoint before, its deprecated now.
You will find blogs/documentation over the internet based on different versions in different point of time. Read more

Microsoft Graph $top filter return inconsistent results

When using MS Graph the API is returning inconsistent results when using $top filter.
Here is an example using the MS Graph Explorer:
Here we can see that we are setting top to 1 element and the API is returning 8.
The query is:
https://graph.microsoft.com/v1.0/security/alerts?$top=1&$count=true
Here is the link to the graph explorer:
https://developer.microsoft.com/en-us/graph/graph-explorer
If someone is also having the same problem or the API is working well for him it will help a lot knowing it.
I can reproduce your issue, this should be correct, because the alerts in the result are from the different providers, check the doc:
$top - Returns the aggregated top results from each security API
provider.
e.g. If you use $top=1 and there are 8 providers in your case, then you will get 8 values, it will get one value from each provider.
If you specify only one provider via the $filter, then you will get only one value with $top=1, you can check the provider keywords here.
Sample:
GET https://graph.microsoft.com/v1.0/security/alerts?$filter=vendorInformation/provider eq 'MCAS'&$top=1&$count=true

Maximo- Update work order using RESTApi by passing wonum and siteid instead of workorderid

We are currently on Maximo 7.6.1 and have started to use Restful APIs and was wondering if there is a way to update a work order using RESTApi by passing wonum and siteid instead of workorderid.
We would like to avoid one additional GET call for our middleware to retrieve the workorderid and then use it in the PUT request.
Using this URL (OS as well) tries to insert a record even though the HTTP method is PUT.
/maxrest/rest/mbo/WORKORDER?_action=AddChange&siteid=XXX&wonum=7065644&description=Testing
Any pointers will be helpful.
Thanks
The IBM documentation appears to suggest you can only update existing records with the unique ID:
Use the PUT method to update or insert a resource. An update request
must provide the unique ID of the resource. To update an object
structure resource, the ID of the main object is required.
https://www.ibm.com/support/knowledgecenter/en/SSLKT6_7.6.0/com.ibm.mif.doc/gp_intfrmwk/rest_api/r_rest_put_method.html
The response received using the url you provided appears to bear this out in as far as it indicates the work order cannot be created as it already exists:
Error 400: BMXAA4129E - The record for Site=BEDFORD, Work Order=1234
already exists. Ensure that the key value for the given record is
unique.
Reviewing the information at the following url I wasn't able to determine a method to perform the update without the unique ID:
https://www.ibm.com/developerworks/community/wikis/form/anonymous/api/wiki/02db2a84-fc66-4667-b760-54e495526ec1/page/87348f89-b8b4-4c4a-94bd-ecbe1e4e8857/attachment/0a884bde-d17e-471b-b046-7f8feddfd267/media/MaximoNextGenRESTAPI%20%281%29.pdf
In addition the Maximo RESTful API Swagger documentation indicates a POST to /os/mxwo is used to "Create a new resource":
/maximo/oas3/api.html?includeactions=1#/Work_Order_Definition_(MXWO)/post_os_mxwo
Whilst a POST to /os/mxwo/{id} is used to "Update WORKORDER Object":
/maximo/oas3/api.html?includeactions=1#/Work_Order_Definition_(MXWO)/post_os_mxwo__id_
I was however able to update an existing work order using the unique ID. This being the case I can only suggest one of the following:
If you're creating the work order first using the REST/OSLC API,
retrieve and store the unique ID from the response received when the
record is created.
If (1) above is not possible, perform a GET and use parameters in
the query to filter on wonum and siteid and only receive back the minimum of
fields (e.g. workorderid only).
If neither (1) or (2) are feasible investigate whether it's possible
to customise Maximo and create your own endpoint for the work order
object structure that takes wonum and siteid as parameters,
retrieves the mbo and performs the update.

Paging in Azure AD graph client

We need a way to get users based on page index and page size so that we will not load all the users every time.
I have gone through with the Azure Graph Client documentation here http://blogs.msdn.com/b/aadgraphteam/archive/2014/12/12/announcing-azure-ad-graph-api-client-library-2-0.aspx
There is a way to iterate forward/backward but, i didn't found a way to get the users based on page index(i.e: i want to get users from 10-20 in the list if i pass parameters page index=2 and page size=10).
If we go with forward/backward paging, then i have to iterate through each page to find the next set of records, which I don’t want to do that.
Any help would be appreciated.
In order to accomplish the kind of pagination you're looking for, Azure AD Graph API need to support both $top and $skip OData operators. However kooking at Supported Queries, Filters, and Paging Options in Azure AD Graph API, while $top is supported but $skip isn't thus I don't believe it is possible to accomplish pagination they way you want to.
It does support $top and $skiptoken which can be used for navigating back & forth but will not serve the scenario you're looking to implement.
Sorry, currently this is not possible via the Graph Client. What you are looking for is similar to a query of a database, where you can selectively control the return set. Azure Graph does not have this capability. When you make a query, the result is returned one page at a time. You pass your token each time you are requesting the next page in the return set. There exist no way that actually tracks page 1, 2, 3... and so forth of the return set, thus, no way to say bypass pages 1 and 2 to go directly to page 3. The only capability available is next page and previous page. There is no page index maintained that can be queried. You get the your results one page at a time.
As said by MMTT here: https://social.msdn.microsoft.com/Forums/en-US/199bbf92-642a-4bcc-add4-f8023a7684e2/paging-in-azure-ad-graph-client?forum=WindowsAzureAD

Retrieve a mailchimp list via GET

I am trying to retrieve a MailChimp list.
I have an API Key and a List ID, and while I understand that I can use the MailChimp API wrapper to achieve this I prefer to avoid implementing it since I only need to do this one task.
When I enter in my browser:
https://us3.api.mailchimp.com/2.0/lists/members?apikey=*****&id=******
I get a JSON result of my list - but it is limited to the first 25 subscribers. I don't see anything in the MailChimp API documentation about submitting a GET request to retrieve a list. Is it possible to do so? If so, how can I retrieve a full list?
Read this: http://apidocs.mailchimp.com/api/2.0/lists/members.php
Options are available via pagination.
You are supposed to POST the values in your request.
Looks like the best method is to use the MailChimp list method which "Exports/dumps members of a list and all of their associated details. This is a very similar to exporting via the web interface."
Read more at http://apidocs.mailchimp.com/export/1.0/list.func.php
Another option is to use API v1.3 listMembers function, more info here: http://apidocs.mailchimp.com/api/1.3/listmembers.func.php. v1.3 is deprecated, but it still functions properly.

Resources