Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Proper datetime format for setting enddate and termdate in Sav via API?

jralexander137
New Contributor III
New Contributor III

Hi, I am trying to use update user api call to set end date and term date for a given user. When passing 

{
"username":"TestUser1",
"statuskey":"1",
"enddate":"2023-11-29T00:00:00Z"
}
I get a datetime value populated as Jul 10, 0197. I have tried every variation I can think of formatting wise but am unable to get it to parse properly. The format in the payload does not work at all when passing to termdate.
 
API response is
{
    "errorCode""0",
    "message""SUCCESS User Updated Successfully"
}
when setting enddate and termdate even though termdate doesnt even get updated. I havent been able to find this clarification in any docs yet. Any insight would be greatly appreciated!
 
Field error in object 'com.saviynt.ecm.identitywarehouse.domain.Users' on field 'enddate': rejected value [10-11-2019]; codes [com.saviynt.ecm.identitywarehouse.domain.Users.enddate.typeMismatch.error,com.saviynt.ecm.identitywarehouse.domain.Users.enddate.typeMismatch,users.enddate.typeMismatch.error,users.enddate.typeMismatch,typeMismatch.com.saviynt.ecm.identitywarehouse.domain.Users.enddate,typeMismatch.enddate,typeMismatch.java.util.Date,typeMismatch]; arguments [End Date]; default message [Unparseable date: "10-11-2019"]
6 REPLIES 6

pmahalle
All-Star
All-Star

Hi @jralexander137 ,

Can you try below date format and check once:

{
"username":"TestUser1",
"statuskey":"1",
"enddate":"08-13-2017"
}

It's working for us.


Pandharinath Mahalle(Paddy)
If this reply answered your question, please Accept As Solution to help other who may have a same problem. Give Kudos 🙂

Tried that and got the same error I got for other formats:

ield error in object 'com.saviynt.ecm.identitywarehouse.domain.Users' on field 'enddate': rejected value [08-13-2017]; codes [com.saviynt.ecm.identitywarehouse.domain.Users.enddate.typeMismatch.error,com.saviynt.ecm.identitywarehouse.domain.Users.enddate.typeMismatch,users.enddate.typeMismatch.error,users.enddate.typeMismatch,typeMismatch.com.saviynt.ecm.identitywarehouse.domain.Users.enddate,typeMismatch.enddate,typeMismatch.java.util.Date,typeMismatch]; arguments [End Date]; default message [Unparseable date: "08-13-2017"]

Payload sent: 

{
"username":"TestUser1",
"statuskey":"1",
"enddate":"08-13-2017"
}

try future date its working in v23.6

rushikeshvartak_0-1701406625068.png

 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Tried future date, still getting same error. 

jralexander137_1-1701436104705.png

 

 

Hi @jralexander137 ,

What's date format you have set in Global Configuration --> Preferences? Can you set it to MM-DD-YYYY and try with below payload.

pmahalle_0-1701436543755.png

{
"username":"TestUser1",
"statuskey":"1",
"enddate":"08-13-2017"
}

Pandharinath Mahalle(Paddy)
If this reply answered your question, please Accept As Solution to help other who may have a same problem. Give Kudos 🙂

Under Global configuration - Preference Set date format

rushikeshvartak_0-1701649735397.png

Date Format

Select the format for dates to be displayed

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.