Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • nickornotto 403 posts 907 karma points
    Dec 06, 2021 @ 16:28
    nickornotto
    0

    How to get audit trail info in Umbraco API?

    Is there any way of getting a content audit trail via Umbraco API? I need to find out what was the last action called on the content, eg. whether it was Save or Save and Publish.

    I need it via API (not backoffice).

  • Marc Goodson 2157 posts 14435 karma points MVP 9x c-trib
    Dec 11, 2021 @ 14:56
    Marc Goodson
    0

    Hi nickornotto

    There is an angular resource that allows you to query the audit log from the backoffice called logResource... and this is a wrapper for a WebApiController

    https://our.umbraco.com/apidocs/v7/csharp/api/Umbraco.Web.Editors.LogController.html?q=logcontroller

    which has a GetPagedEntityLog(Int32, Int32, Int32, Direction, Nullable

    But you'd need I think to authenticate to the backoffice to request this...

    Anyway this BackofficeApiController extracts the information using the AuditService

    https://our.umbraco.com/apidocs/v7/csharp/api/Umbraco.Core.Services.AuditService.html?q=auditserv

    So if you need to access the info outside of Umbraco, you could create your own WebAPIController and use the AuditService to query the AuditLog??

    regards

    marc

  • nickornotto 403 posts 907 karma points
    Dec 15, 2021 @ 08:38
    nickornotto
    0

    Thanks, I'll try with LogController.

    I tried to use AuditService but it doesn't seem to work in Umbraco 7.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies