Audit_logs endpoints as stated in docs are not consisten/clear; URLs return 404s. Docs for audit_logs lack an unmodified working example

Here’s an example of working code used on PipeDream to fetch API data from frame.io:

async(events, steps, auths) =>{
            return await require("@pipedreamhq/platform").axios(this, {
  url: `https://api.frame.io/v2/accounts`,
  headers: {
    Authorization: `Bearer ${auths.frame.oauth_access_token}`,
  },
}

My goal is to trigger a call to Google Analytics so my co-worker can know if their customer viewed the presentation link.

I would think a record of views can be found in the audit log, so I’m trying to–at a minimum–refresh the page impression count in Google Analytics. I may give up on the API and just iframe-wrap frame.io into my client’s website and call Analytics in the wrapper. But it would be cool if I can get this to work.

I took the working code from above and changed out the URL in a few different ways as recommended by the docs (the docs have different URLs so I tried the likely candidates. It’s not clear to me if .../:id/... should have a colon or if that is denoting a variable. I swapped out the URL parameter with the following guesses one-by-one but was met with a 404 when tried with the GET endpoints listed below (Assume ${auths.frame.id} is a template-string-variable that returns my correct Admin ID):

`https://api.frame.io/v2/accounts/:id/audit_logs`
`https://api.frame.io/v2/accounts/:account_id/audit_logs`
`https://api.frame.io/v2/accounts/:${auths.frame.id}/audit_logs`
`https://api.frame.io/v2/accounts/:${auths.frame.account_id}/audit_logs`
`https://api.frame.io/v2/accounts/${auths.frame.id}/audit_logs`
`https://api.frame.io/v2/accounts/${auths.frame.account_id}/audit_logs`
`https://api.frame.io/v2/accounts/:b993fee4-xxxx-xxxx-xxxx-myAdminID-b1a4ecf6caff/audit_logs`
`https://api.frame.io/v2/accounts/b993fee4-xxxx-xxxx-xxxx-myAdminID-b1a4ecf6caff/audit_logs`
`https://api.frame.io/accounts/:id/audit_logs`
`https://api.frame.io/accounts/:account_id/audit_logs`
`https://api.frame.io/accounts/:${auths.frame.id}/audit_logs`
`https://api.frame.io/accounts/:${auths.frame.account_id}/audit_logs`
`https://api.frame.io/accounts/${auths.frame.id}/audit_logs`
`https://api.frame.io/accounts/${auths.frame.account_id}/audit_logs`
`https://api.frame.io/accounts/:b993fee4-xxxx-xxxx-xxxx-myAdminID-b1a4ecf6caff/audit_logs`
`https://api.frame.io/accounts/b993fee4-xxxx-xxxx-xxxx-myAdminID-b1a4ecf6caff/audit_logs`

Perhaps someone who is more familiar with standard API URL conventions (ie are colons denoting account variables here? How is the actual variable provided and when?) Is the variable consumed in the context of the id by the API or should that “:id” be literally be replaced by the string that is the ID before it arrives to be processed by the API??

Hey there!

So I wouldn’t really suggest going for the i-frame approach as that is not officially supported, and either will not work, or could be broken at any point in the future.

Whenever you see :id in a URL path, that’s called a “path parameter” and is basically just a variable that you’ll be substituting with your own values.

So if you see the following, https://api.frame.io/v2/accounts/:id/audit_logs, you’d want to replace :id with your account id, like this https://api.frame.io/v2/accounts/0337744f-0372-4d14-ad71-339fbe4e292f/audit_logs.

Another thing to keep in mind is that a user_id is not the same as an account_id, the diagram on this page is probably the best reference for how to make sense of things.

With all that said, I gotta be honest I don’t remember quite how we log views on a given asset, and whether or not they actually make it into our audit logs.

Let me know if this works out for you, or if you need more help!

I’ve followed up with our back-end engineering team, and checked the code myself, and while I believe we are logging an event for ReviewLinkViewed - it is not currently being returned via our API.

It is possible to fetch the views on a specific asset using this route: /v2/assets/:ass_id/impressions?include=user, however it is not available on the public token router, only via our internal auth for our web app, iOS app, and first-party integrations so unfortunately that won’t help you either.

I’m opening tickets to expose the aforementioned endpoint, and to add ReviewLinkCreated to our audit log controller, but I have no idea what ETA might look like.

Yes, after looking at your available webhooks, it appears there is no trigger for when a presentation link is viewed so that would make integrating Google Analytics impossible. My team is still interested in integrating Google Analytics to log who is viewing their video link for future views, so if that route becomes available please update. Thanks for your quick, informative, and helpful response. I was able to understand access with your excellent examples via the Postman collection linked from your docs; that and your helpful post cleared up all my confusion.