How to parse rest api code from confluence page - confluence

how can i parse fields ( task id,task status, task body) from rest api which is on confluence page
I am trying to parse the rest api from confluence page to get Task ID,Task Status, and body fields from the api code. I am open for python,alteryx or sas or any option to parse this file. we have few other rest api's which need to be parsed. so looking for automate process. please recommend a solution.
```{"id":"33469","type":"page","status":"current","title":"Huddle Tracker","body":{"storage":{"value":"<ac:task-list>\n<ac:task>\n<ac:task-id>4</ac:task-id>\n<ac:task-status>incomplete</ac:task-status>\n<ac:task-body><span><ac:link><ri:user ri:userkey=\"123456789abc\" /></ac:link> - 6/13</span></ac:task-body>\n</ac:task>\n<ac:task>\n<ac:task-id>5</ac:task-id>\n<ac:task-status>incomplete</ac:task-status>\n<ac:task-body><p><span><ac:link><ri:user ri:userkey=\"123456789abc\" /></ac:link> - 6</span>/14</p></ac:task-body>\n</ac:task>\n<ac:task>\n<ac:task-id>6</ac:task-id>\n<ac:task-status>incomplete</ac:task-status>\n<ac:task-body><span><ac:link><ri:user ri:userkey=\"123456789abc\" /></ac:link> - 6/15<br /></span></ac:task-body>\n</ac:task>\n<ac:task>\n<ac:task-id>7</ac:task-id>\n<ac:task-status>incomplete</ac:task-status>\n<ac:task-body><span><ac:link><ri:user ri:userkey=\"123456789abc\" /></ac:link> - 6/16<br /></span></ac:task-body>\n</ac:task>\n</ac:task-list><p><span><br /></span></p><p><span><br /></span></p><p><br /></p>","representation":"storage","_expandable":{"content":"/rest/api/content/33469"}},"_expandable":{"editor":"","view":"","export_view":"","styled_view":"","anonymous_export_view":""}},"extensions":{"position":"none"},"_links":{"webui":"/display/abcd01d/Huddle+Tracker","edit":"/pages/resumedraft.action?draftId=33469","tinyui":"/x/Rw-zEw","collection":"/rest/api/content","base":"https://confluence:9999","context":"","self":"https://confluence:9999/rest/api/content/33469"},"_expandable":{"container":"/rest/api/space/abcd01d","metadata":"","operations":"","children":"/rest/api/content/33469/child","restrictions":"/rest/api/content/33469/restriction/byOperation","history":"/rest/api/content/33469/history","ancestors":"","version":"","descendants":"/rest/api/content/33469/descendant","space":"/rest/api/space/abcd01d"}}
i need Task ID, Task Status and Task Body parsed.

After looking tools available, i have decided to go with RPA to scrape the content and parse it.
another option i found is to use python package to scrape data.

Related

Microsoft Graph API: How to get url for Task in Planner?

I am using planner task API from Microsoft Graph APIs to get details of a task created in planner. Is there any way to Teams client URL for task from Graph APIs? In the API response I don't see any property like webUrl which can be seen for other resources. Does Microsoft provide URLs for planner tasks in Graph API?
If it is not supported, can I build URL programmatically?
The task URL copied from Teams client appears to have below format:
https://teams.microsoft.com/l/entity/com.microsoft.teamspace.tab.planner/tt.c_{channel id}p{planner id}_h_1660906395123?tenantId={tenant id}&webUrl=https%3A%2F%2Ftasks.teams.microsoft.com%2Fteamsui%2FpersonalApp%2Falltasklists&context=%7B%22subEntityId%22%3A%22%2Fboard%2Ftask%2F{task id}%22%2C%22channelId%22%3A%22{channel id}%22%7D
The string 1660906395123 after h_ looks like some timestamp. Does anyone know what this timestamp is?
There is no supported way of programmatically getting the task url to the UI right now. Any method you find to be working can (and likely will) break without notice.
The value you are asking for is obtainable for a tab in the channel if you look inside the entityId of the configuration property of the tab (teams/{teamId}/channels/{channelId}/tabs).
If you copy the link to the task from the task app (instead of the channel tab) you get a different URL which seems to be easier to work with (still needs the channel id, but not the tab information).

How to get an asset all details in AEM with API request?

I am using AEM API in my automation. We published a file from workfront to AEM. That file have multiple information:
1. Basic
2. Test1
3. test2
4. etc
When I hit the api:
/api/assets/..../abc.pdf.json
I am getting very less information under the properties and metadata section. (In short, it does not have Test1, Test2 and other tab information)
Is there any way to fetch all these from aem API's? It will reduce my overhead to validate these details from UI Automation.
First of look checkout the metadata nodes of file for the desired data to be present. I would rather prefer writing a custom servlet in AEM which takes in path parameter as an asset path and gives back the response back in desired format.
I figured it out.
The following API returns all the JCR content in API response:
<baseURL>/content/dam/path to that file.-1.json

How to get version history of a file in folder in sharepoint using SharePoint REST API using c#?

I have a SharePoint library with a file in it. I need to get previous versions of the file who created it and when. What is the rest endpoint to fetch those details. I am new to SharePoint. Please help
You could use this rest endpoint to get previous versions of the file by the file id:
https://<server>/sites/<site>/_api/web/lists/getByTitle('Documents')/items(1)/versions
You could add filters at the end to get the information you need:
https://<server>/sites/<site>/_api/web/lists/getByTitle('Documents')/items(1)/versions?$select=VersionLabel,Created_x005f_x0020_x005f_By,Created
in order to get additional information from REST API request You need to use the $expand property. If You need information like who made the update please add '?$expand=CreatedBy' at the end of the request.. so for Your example it will be something like:
https:///sites//_api/web/GetFolderByServerRelativeUrl('Shared%20Documents/general')/files('SampleDocFile.docx')/versions?$expand=CreatedBy
that way You will have the user who modified the file in
content>properties>Title
other interesting data is:
updated>
content>properties>CheckInComment>
content>properties>VersionLabel>

How to: Get Report Definition using SSRS RESTful API?

I have been working with the RESTful SSRS endpoint documentation at https://app.swaggerhub.com/apis/microsoft-rs/SSRS/2.0 and It states that I can retrieve the Report defintiion for my reports, however I cannot find any of the endpoints to do such?
From Microsoft docs:
The REST API can also be used to provide more advanced functionality,
such as:
Navigate the folder hierarchy Discover the contents of a folder
Download a report definition
Modify default report parameters Change
or execute a refresh plan A whole lot more
The REST API is a RESTful successor to the legacy SOAP API.
Maybe I am missing something?
I am able to get the Parameter Definitions, the report by ID,
however passing in any parameters such as
https://{myreportserver}/reports/api/v2.0/reports({id})?paramter1=somevalue
does not return any definition. I am trying to get a definition return so maybe I can render the report on a web application (or at minimum provide a pdf download of the report?)
Late to the game, but in case anyone else is looking for this answer, use this URL:
https://{myreportserver}/reports/api/v2.0/reports({id})?Content/$value

VSTS API - Get test category information for test run

I have been looking to get hold of test results programatically, for the tests that are run during builds and releases. I am doing it via the VSTS API here.
https://www.visualstudio.com/en-us/docs/integrate/api/test/results
The test category information, declared via [TestCategory] attribute, does not appear in this results returned by this API.
I am wondering if there is a way to get hold of test results along with category information?
The test category information is available within the downloaded test results file using the UI from within the test run details.
Is there an API endpoint that return path to the test results file (the one that can be downloaded via the UI)?
Any pointers will be greatly appreciated.
Thanks
To get TestCategory from test file (such as .trx), you use use the REST API to download a test run attachment instead of using the REST API to get test result(s) from a test run.
You can get the test run attachment id firstly, and then download the attachment:
To get the attachment id, use the REST API:
GET https://account.visualstudio.com/DefaultCollection/project/_apis/test/runs/runId/attachments?api-version=3.0-preview
And you can get the attachment id by the id parameter.
To download the attachment, use the REST API:
GET https://account.visualstudio.com/DefaultCollection/project/_apis/test/runs/runId/attachments/attachmentId?api-version=3.0-preview
To get the TestCategory, you can find in the response part:
<TestCategory>
<TestCategoryItem TestCategory="name" />
</TestCategory>