<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z000091FwOgCAKOkta Classic EngineAPI Access ManagementAnswered2024-03-08T21:12:10.000Z2023-04-04T18:41:04.000Z2023-04-10T12:08:17.000Z

ArvS.21281 (Customer) asked a question.

Event Log API Retrieval with Pagination & Date Range

It appears when I use pagination as defined in API documentation for event log retrieval, the response is disregarding my date range and providing data for a default range of about one week. I am wondering if I have syntax or sequencing of parameters wrong. Also, noticing that the link to "next" page found in header response is dropping the date range specified. Here is sample:

 

https://cityblock-admin.okta.com/api/v1/logs?q=&filter=event_type+eq+%22user.authentication.sso%22+and+target.type+eq+%22AppInstance%22+and+target.id+eq+%220oa3xdb0yoHyzocqH697%22&fromTime=2023-03-01T00%3A00%3A00Z&toTime=2023-04-04T23%3A59%3A59Z

 

Thank you for any insights/guidance provided.


  • Mihai N. (Okta, Inc.)

    Hi @ArvS.21281 (Customer)​ , Thank you for reaching out to the Okta Community!

     

    Just to clarify, the Events API should be deprecated as per the following documentation:

    https://support.okta.com/help/s/article/FAQ-Events-API-End-of-Life

    https://developer.okta.com/docs/concepts/events-api-migration/

     

    That being said, judging by the sample provided you are using the System Log API

     

    The "q" parameter is not required and for time frames you need to use the "since" and "until" parameters as per de above documentation.

     

    Example: 

     

    /api/v1/logs?filter=event_type+eq+%22user.authentication.sso%22+and+target.type+eq+%22AppInstance%22+and+target.id+eq+%220oa3xdb0yoHyzocqH697%22&since=2023-02-01T00%3A00%3A00%2B00%3A00&until=2023-04-04T23%3A59%3A59%2B00%3A00

     

    *Extra notes: - make sure to change the above time frames to suit your needs (I just use those to confirm things in my org)

    - the target.type+eq+%22AppInstance%22 filter might also be redundant if you specify the exact app ID under target.id+eq+... , but you might need to confirm that on your end depending on your requirements.

     

    If my answer helped, remember to mark it as best to increase its visibility for other members of the Okta Community who might have the same questions as you. 

     

    Hope my answer helps! 

    --------------------------------

    Community members help others by clicking Like or Select as Best on responses. Try it today.

    Expand Post
    Selected as Best
  • Mihai N. (Okta, Inc.)

    Hi @ArvS.21281 (Customer)​ , Thank you for reaching out to the Okta Community!

     

    Just to clarify, the Events API should be deprecated as per the following documentation:

    https://support.okta.com/help/s/article/FAQ-Events-API-End-of-Life

    https://developer.okta.com/docs/concepts/events-api-migration/

     

    That being said, judging by the sample provided you are using the System Log API

     

    The "q" parameter is not required and for time frames you need to use the "since" and "until" parameters as per de above documentation.

     

    Example: 

     

    /api/v1/logs?filter=event_type+eq+%22user.authentication.sso%22+and+target.type+eq+%22AppInstance%22+and+target.id+eq+%220oa3xdb0yoHyzocqH697%22&since=2023-02-01T00%3A00%3A00%2B00%3A00&until=2023-04-04T23%3A59%3A59%2B00%3A00

     

    *Extra notes: - make sure to change the above time frames to suit your needs (I just use those to confirm things in my org)

    - the target.type+eq+%22AppInstance%22 filter might also be redundant if you specify the exact app ID under target.id+eq+... , but you might need to confirm that on your end depending on your requirements.

     

    If my answer helped, remember to mark it as best to increase its visibility for other members of the Okta Community who might have the same questions as you. 

     

    Hope my answer helps! 

    --------------------------------

    Community members help others by clicking Like or Select as Best on responses. Try it today.

    Expand Post
    Selected as Best
  • ArvS.21281 (Customer)

    Perfect! Thank you Mihai! Yes, it works now by using the different date from/time to syntax you offered.

This question is closed.
Loading
Event Log API Retrieval with Pagination & Date Range