# Need help about APIs to access Historical Data

**URL:** <https://forum.inductiveautomation.com/t/need-help-about-apis-to-access-historical-data/9823>\
**Category:** 3rd Party Modules\
**Created:** [March 20, 2015, 7:04am UTC](https://forum.inductiveautomation.com/t/need-help-about-apis-to-access-historical-data/9823 "2015-03-20T07:04:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yogini\_Marathe](https://avatars.discourse-cdn.com/v4/letter/y/85e7bf/32.png) [@Yogini\_Marathe](https://forum.inductiveautomation.com/u/Yogini_Marathe)\
**Post date:** [March 20, 2015, 7:04am UTC](https://forum.inductiveautomation.com/t/need-help-about-apis-to-access-historical-data/9823/1 "2015-03-20T07:04:18Z")

</div>

We are working on developing a module and wish to access the historical information (i.e. how many users accessed, from what IP address, what role, etc in last 24 hours or last week or even month). Does Ignition log and save this information? If so, it is available for what period (like a day or week or month)? Can our module fetch it from Ignition?

We were trying out methods from gatewayContext  
• AuditManager (i.e. context.getAuditManager().getProfileForProject().query())  
• AlarmManager(context.getAlarmManager().queryStatus());  
However, from the information in Javadocs, it’s not clear exactly what historical information would be available.

Would the methods from HistoryManager and SQLTagsManager be useful?

Thanks.

---

<div class="post-metadata">

**Author:** ![ssmith](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@ssmith](https://forum.inductiveautomation.com/u/ssmith)\
**Post date:** [March 27, 2015, 11:16pm UTC](https://forum.inductiveautomation.com/t/need-help-about-apis-to-access-historical-data/9823/2 "2015-03-27T23:16:23Z")

</div>

I did some digging and you can get part way there by using the GatewaySessionManager. You may be able to store this information yourself if you can get it however.

` GatewayContext context;
(String) context.getGatewaySessionManager().findSessions().get(0).getAttribute(ClientReqSession.SESSION_USERNAME);`  
This gets the username of a session that’s open. You can get other information if you look at the ClientReqSession class. If you really wanted to record all of this information though, you would want to define a listener and get notified of when it changes. I can’t find any way for you to add listeners for sessions though. Maybe someone else will know that bit. 😃

Or you could query this from the AUDIT\_EVENTS table using SQL.

---

<div class="post-metadata">

**Author:** ![Yogini\_Marathe](https://avatars.discourse-cdn.com/v4/letter/y/85e7bf/32.png) [@Yogini\_Marathe](https://forum.inductiveautomation.com/u/Yogini_Marathe)\
**Post date:** [April 1, 2015, 10:30am UTC](https://forum.inductiveautomation.com/t/need-help-about-apis-to-access-historical-data/9823/3 "2015-04-01T10:30:05Z")

</div>

Thanks. I am using this API to get the real time data and querying AUDIT\_EVENTS table to get historical data.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 2, 2015, 10:58pm UTC](https://forum.inductiveautomation.com/t/need-help-about-apis-to-access-historical-data/9823/4 "2015-04-02T22:58:35Z")

</div>

> [@Yogini Marathe](#):
>
> We are working on developing a module and wish to access the historical information (i.e. how many users accessed, from what IP address, what role, etc in last 24 hours or last week or even month). Does Ignition log and save this information? If so, it is available for what period (like a day or week or month)? Can our module fetch it from Ignition?

This is not the kind of information that Ignition stores or logs anywhere, in either the auditing or history systems.
