Add "Updated_at" Use for API

Idea created by Ivan Armendariz on Jun 8, 2017
    New Idea
    • Brad Bateman
    • andrewfdpr
    • Bernard Welmers
    • Joe Glover
    • Gustavo Trujillo
    • Ryan Dumais
    • Mark Rottman
    • Ivan Armendariz

    Let me start of by saying that this is closely tied to the existing question and feature requests here:


    Filters based on 'Updated At' 


    Allow filtering on 'Updated_At' 


    We would really like it if we could also add this attribute to the API so that we can also use the filter there. We're currently more concerned about getting this added to the user objects, but some of the objects in the system such as computers, incidents, etc already have some variant of this data but is not filterable. Preferably, we would like the Update_At (Time Stamp) added to the objects that don't already have it and allow them to be filtered both on the site and via the API.


    For anyone interested in a workaround keep reading.


    In the mean time, we created a custom date/time field and added it to the User form. Under normal circumstances, this field would have to be set manually if you're still managing your Samanage user accounts manually. If you're managing them with the API however, you simply need to change this field every time you edit something in the account.


    If you take a look at the API documentation you won't find a lot of information regarding how to format this custom date/time field when setting it or getting it from Samanage. After some poking, I managed to come up with the following:


    *Note - The name of my custom field is "Last Modified"


    How to set


    URI Example:


    REST Method: PUT


    Headers: “Accept=application/vnd.samanage.v1.1+json” “Content-Type=application/json”








                   "value":"Jun 07, 2017 -  8:00AM",

                   "name":"Last Modified"







    Date/Time Format: {First 3 letters of month name} {Full month numeric}, {Full year} – {Hour}:{Minutes}{AM||PM} e.g. Jun 07, 2017 -  8:00AM


    How to get


    URI Example:


    REST Method: GET


    Headers: “Accept=application/vnd.samanage.v1.1+json” “Content-Type=application/json”


    Date/Time Format: {Full year}-{Full month}-{Full day}T{Full hour}:{Full minutes}:{Full seconds} e.g. 2017-06-06T05:37:00


    Here is the only catch I’ve noticed with this workaround so far, the server time is off by 4 hours PST. So if you’re looking for something that was last modified at 8:00AM PST, you would have to ask it to start looking at 4:00AM PST. I also haven’t confirmed if this hour offset is static or if it varies depending on which server is feeding you the information. If anyone has more concrete formatting for this type of custom field I'd really appreciate some feedback.


    Thanks for the consideration.

    What problem will this feature solve?: