Jama API - GET item with tag at the same time - rest

I need to fetch items from JAMA API, and I do not get the Tag value with the data.
I tried to call GET/{item}/{id} API and then I also need to execute GET/{tags}/{id}/{item} to discover item tag, which takes too much time for multiple items.
Is there any more efficient way to get all data in one API call?

There is the /items/{id}/tags endpoint: https://rest.jamasoftware.com/#operation_getTagsOnItem

Related

Azure Data Factory: Pagination in Data Flow with Rest API Source

I have a API source in an ADF DataFlow task. The API source gives me the current page and the toatl number of pages in the body of the response. I want to use that information to paginate through my API source. I'm able to paginate through it just fine outside of a DataFlow activity using the range function. The issue is that the Rest transformation in a DataFlow activity does not support the range function. I've been trying to use the AbsoluteUrl function plus an expression to do add one to the current page returned by the body but either pagination does not accept expressions or I cannot figure out the syntax
I have a url like this:
BaseURL/fabricationcodes?facets=relatedArticles:Not%20Empty&page={PageNumber}.
In this example my rest linked service URL has everything I need minus the &page=pageNumber. So I'm trying to add that part with the key/value pair function of AbsoluteUrl. The Key being &page= and the value should be currentPage +1. My desire is for it to get the first page, page 0 and then add +1 to that to formulate the next pages url. the end condition being when body.totalPages == body.currentPage
I've tried a bunch of different expression formaulations but none seem to work and debugging in a Data flow is tough b/c the logging and error messaging is poor
What I have right now.
As data flow don't support Range option or you cannot use dynamic expression to get page from API response.
To work around the issue, you can use Data Flow activity within ForEach loop using range function in dynamic expression.
First take a web activity and pass the URL of the Rest API as below Ito get the total no of Pages from API response
then take a for each activity to iterate on API like pagination give the Dynamic expression as #range(1,activity('Web1').output.total_pages)
I will iterate the API till the respective range in sequential manner.
create parameter with type string in source DataSource.
give that parameter as dynamic value in relative URL.
after this gave parameter value as ?page=#{item()} to give the no coming from range to the page.
OUTPUT:

Aggregate functions in WIQL query

I want download WIQL report using REST API. REST response doesn't give all fields but it gives a list of URLS as workItems.
To get field values I need to download each WorkItem separately.
Any direct REST way to accomplish this in a single REST call?
Repeated REST calls gives me rate limiting or similar error. I get error 500 types after repeated GET request.
Genesis of this need is - There are no aggerate functions available likes of SUM, MAX, MIN, AVG Etc.
REST response doesn't give all fields but it gives a list of URLS as
workItems.
To get field values I need to download each WorkItem separately. Any
direct REST way to accomplish this in a single REST call?
Sorry but as I know, there's no direct rest api available to get WIQL report. An alternative workaround should be:
1.Use Query By Wiql to return the list of WorkItem IDs and Urls (I think this is the same rest api you use).
2.Then use Get Work Items Batch to get all the details(fields) about the requested work item ids. And here's one issue which has similar needs like yours, you can use the upgraded script from konpro11 to get list of IDs and use the IDs to get your report (with the help of second rest api).
Hope it helps :)

How to get a list of all documents in a Firebase Cloud Firestore database using the API?

I need to query my Cloud Firestore database periodically for maintenance. I'm new to REST and I've spent way too long trying to solve this myself, so I figured I could use some advice.
My Firestore is set up like so:
users > {uid} > uploaded-files > {file-hash}
{file-hash} is a document that contains several fields such as filename, source, and size
All I'm trying to do is get a list of every single filename from every single uploaded-file, including from multiple {uid}'s.
I've managed to send a successful request and get a single filename using the firestore.projects.databases.documents.get method using the API explorer, but I can't seem to get any other methods to work, namely firestore.projects.databases.documents.list
This is the successful request using firestore.projects.databases.documents.get:
GET https://firestore.googleapis.com/v1beta1/projects/{project-id}/databases/(default)/documents/users/7eGfdgGfaG0HSXdfmxMN2/uploaded-files/WGtcJBX9fdGdhdtjB?mask.fieldPaths=filename&key={YOUR_API_KEY}
Part of my issue is that I can't figure out how to get requests to work without hard-linking document names - in other words, I don't know how to to replace {uid}, or any other collection, with a wild-card so that the request returns documents from all uid's.
Really any help is greatly appreciated.
The Use the Cloud Firestore REST API documentation has instructions on getting started. The Firestore REST API documentation shows how to fetch documents.
In your case you would need to list the user-uid documents then go after the uploaded-files for each one, or iterate over the results of the list.

How to filter REST API JSON result by passing params

I'm trying to consume JIRA 2 API and trying to get custom fields. I want to further filter by passing appropriate criteria in URI itself. Current query I'm using is something similar to this:
http://localhost:8522/jira522/rest/api/2/issue/createmeta?expand=projects.issuetypes.fields
The result I'm getting from above request is about 2000 lines.. How can I further filter to get only Custom_fields and also under custom fields I need to only the ones which are required?
I'm pretty new to REST API. Please guide me If anything is wrong... TIA. I spent a lot of time browsing but don't know what exactly I need to search for or where exactly I need to get started.
You can use another queryParam just like expand and add further filtering or pagination.
http://localhost:8522/jira522/rest/api/2/issue/createmeta?expand=projects.issuetypes.fields&limit=1000

How do i get the list of all the leads in Marketo

I want to get all leads in Marketo using their Rest Apis. Is there a way to do this? I have already tried the getLeadChanges api, however that only returns leads with changed fields.
Leads in Marketo are assigned lead ids in sequential order starting with 1. Using the Get Multiple Leads by Filter Type REST API endpoint, you can query 300 leads by lead id with each call.
You will have to specify id as the filterType and the lead ids as the filterValues with each call to this endpoint. To get all leads, you would iterate through the total number of leads 300 at a time.
The first API call would be (replace ... with all the values in between):
/rest/v1/leads.json?filterType=Id&filterValues=1,2,3,...,298,299,300
The second API call, and each subsequent API call would follow the same pattern:
/rest/v1/leads.json?filterType=Id&filterValues=301,302,303,...,598,599,600
By Marketo REST API you can request only static lists, and the "All leads" is dynamic.
Easyest way will be:
Create static list
Add all existing leads to this list
Create a Marketo campaign to add every new lead to this Static list.
then just query leads in this list. e.g.: https://%yourSubdomain%.mktorest.com/rest/v1/lists/%listId%/leads.json
Hope it will help.