Has anyone ever used the GET /admin/v1/auditlog/ API option?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Printer Friendly Page
- Mark as New
- Subscribe to RSS Feed
- Permalink
Hi everyone,
I've been playing around with the API calls available in the Gallery, and I was wondering how this one would work.
When I try to use it, I get an Internal Server Error. Other calls don't generate this error.
I'm assuming there are some parameters required like "entity", "page" and "pageSize" but how would they be chained in the URL? They don't explain that in the documentation.
Has anyone used this one succesfully?
Thanks,
- Mark as New
- Subscribe to RSS Feed
- Permalink
Hi @Thableaus,
It's working for me, but our versions are likely different.
What version are you running?
What values are you passing it for entity, page and pageSize?
- Mark as New
- Subscribe to RSS Feed
- Permalink
I am also having this issue. @JohnPelletier could you provide a dummy workflow showing how you configured the auditlog call? I can get the other endpoints to work but this one is evading me.
- Mark as New
- Subscribe to RSS Feed
- Permalink
/gallery/api/admin/v1/auditlog/?entity=AppInfo&page=1&pageSize=10&oauth_timestamp=1590684343&oauth_signature_method=HMAC-SHA1&oauth_consumer_key=<insertkeyhere>&oauth_version=1.0&oauth_nonce=vmQ8k&oauth_signature=<insertsignaturehere>
What are you putting for required query parameters? Entity should be "AppInfo", "Collection", "Credential", "Subscription", or "User"
PageSize needs to be > 0
Page needs to be >= 0
- Mark as New
- Subscribe to RSS Feed
- Permalink
Thanks @JohnPelletier .
So more context would be that I can get the auditlog endpoint working in the interactive documentation, but I hit the issue when I try to access it via one of my workflows. Note I can access the other endpoints from the workflow so I know it's not an issue with the flow itself. Seems like I am missing something small in terms of how I construct the signature base string and send the entity/page/pageSize query parameters through the url.
Here's some reference info that may help. Really appreciate any guidance you can provide here.
Endpoint works in interactive documentation:
And here are values for the key fields behind the API call in the workflow (replaced sensitive info with placeholders)
Column | Value |
Endpoint URL | https://gallery.myserver/gallery/api/admin/v1/auditlog/ |
Signature Base String (used to create signature) | GET&https%3A%2F%2Fgallery.myserver%2Fgallery%2Fapi%2Fadmin%2Fv1%2Fauditlog%2F&oauth_consumer_key%3DMYKEY%26oauth_nonce%3D000002%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1590688353%26oauth_version%3D1.0 |
Full_Request_URL (url sent via download tool) | https://gallery.myserver/gallery/api/admin/v1/auditlog/?entity=AppInfo&page=1&pageSize=10&oauth_cons... |
DownloadData that comes back with 401 | {"data":null,"exceptionName":"UnauthorizedException","innerExceptionMessage":"","message":"The provided signature(oauth_signature) is invalid."} |
Finally here are screenshots of the download tool configs:
Basic | Headers |
|
|
Payload | Connection |
|
|
- Mark as New
- Subscribe to RSS Feed
- Permalink
Hey @DataSandwich ,
Looking at the configuration of the Download Tool that you have. Have you tried modifying the header to be called Content-Type? Specifically with the dash in between.
-Tasha
- Mark as New
- Subscribe to RSS Feed
- Permalink
Thanks @TashaA!
It looks like either will work. I finally worked my way through this one and the missing link seemed to be the way the oauth_signature is prepared. You have to include entity, page, and pageSize as query parameters in the signature base that gets encrypted into the oauth_signature. On top of that you have to make sure all the query parameters are sorted alphabetically before bringing them into the signature base string. Finally you also have to make sure you include these 3 parameters in your request URL, with them coming immediately after the ? character.
I threw together an example that illustrates how to get it working. You'll have to update the relevant fields in the formula tool at the beginning (within the yellow container).
Hope this proves helpful to others!
- Mark as New
- Subscribe to RSS Feed
- Permalink
