Hello everyone.
I am new comer with Okta.
Now, I am trying to get application usage and find system logs in the okta website.
But I can’t find how to implement that as API so that I can call in my application.
If anyone can help me, please let me know
Thanks
Steffen
Have you looked at the System Log API yet? That will allow you to make API calls to fetch the same information you can find within the System Log within the Admin Console UI.
Yes, I am trying to do, but not working well.
Could you please give me any example for that?
I used api like this
https://dev-xxxxxx.okta.com/api/v1/logs?target.id eq “xxxxxxxxxxxxxxxxx” and target.type eq “AppInstance”.
But not working
Can you try again but updating the url to the following (adding ?filter=
before your sys log query):
https://dev-xxxxxx.okta.com/api/v1/logs?filter=target.id eq “xxxxxxxxxxxxxxxxx” and target.type eq “AppInstance”.
Thanks for your help
It is working if there’s no property (ex. eventType) but if we have to filter id of target, so we use “target.id” but it is not working.
Please help with this
Hm, could be an issue with URL encoding?
Here’s an example CURL that worked for me that has the filter value url encoded:
curl --location 'https://example.okta.com/api/v1/logs?filter=eventType%20eq%20%22user.session.start%22%20and%20target.id%20eq%20%220oa1pcat9tnLUep8c1d7%22' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: ****' \
Thanks.
It’s working. I think it’s because of encoding.
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.