1
votes

I am not able to debug the value of source and entryId in List Diagnostic logs in following Azure DevOps REST API:

https://dev.azure.com/{organization}/_apis/notification/diagnosticlogs/{source}/entries/{entryId}?api-version=5.0-preview.1

1

1 Answers

1
votes

No description of attributes in Get Diagnostic Logs in Azure DevOps REST API

Indeed, I also could not debug the value of source and entryId directly. After a painful time, I found a workaround for this issue. Please check following content:

To test this API, we need enable subscription logging:

  1. Enable diagnostics for your organization by entering this URL in your browser:

    https://dev.azure.com/{organization}/_notifications?diagnostics=true

  2. When this completes, the option Enable Diagnostics appears in the subscription context menu

Then create some build pipelines, so that we could get the notifications.

According to the document View subscription diagnostic logs for notification delivery:

https://{organization}/_apis/notification/DiagnosticLogs/{event ID}/entries?startTime={date}&endTime={date}

event ID is a96d6177-beef-477a-a2ee-2c31433214d0 for any other event type

So, I use the event ID as source in the API and set the value of {entryId} as null.

Now, my Azure DevOps REST API is:

https://dev.azure.com/mycustomorganization/_apis/notification/DiagnosticLogs/a96d6177-beef-477a-a2ee-2c31433214d0/entries/?startTime=2019-01-01&endTime=2019-02-16&api-version=5.1-preview.1

And I could get the result by postman:

enter image description here

Note: As test, it seems we need also give the URI Parameters startTime and endTime, otherwise, we could not get the result.

Personally, this document is not perfect yet, thank you for your contribution to the optimization of this product. Hope the workaround helps you.