0
votes

how to extract and plot the chat from azure devops chartimages api

I am using the below api i azure logic app GET https://dev.azure.com/{organization}/{project}/{team}/_apis/work/iterations/{iterationId}/chartimages/{name}?api-version=6.0-preview.1

I am also getting an answer with the below fields but how to plot the graph

{ "$content-type": "image/png; api-version=6.0-preview.1", "$content": "a large string value" }

1
How about the issue? Does the answer below resolved your question, If yes, you could Accept it as an Answer , so it could help other community members who get the same issues and we could archive this thread, thanks.Leo Liu-MSFT

1 Answers

0
votes

how to extract and plot the chat from azure devops chartimages api

As the log you get shows, the result of the REST API is in png format. So, we need to perform simple processing on the obtained results and save the results in png format:

The Rest API Chartimages - Get Iteration Chart Image:

GET https://dev.azure.com/{organization}/{project}/{team}/_apis/work/iterations/{iterationId}/chartimages/{name}?api-version=6.0-preview.1

I use the Burndown as test chartimages name.

Below is my test powershell scripts:

$outfile = "D:\TestFolder\Burndown.png"

$connectionToken="Your PAT Here"

$base64AuthInfo= [System.Convert]::ToBase64String([System.Text.Encoding]::  
ASCII.GetBytes(":$($connectionToken)"))

$AuditLogURL = "https://dev.azure.com/{organization}/{project}/{team}/_apis/work/{iterationId}/chartimages/Burndown?api-version=6.0-preview.1" 

$AuditInfo = Invoke-RestMethod -Uri $AuditLogURL -Headers @{authorization = "Basic $base64AuthInfo"} -Method Get –OutFile $outfile

The test result:

enter image description here