Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Rest Connector : Specify date and minus two hours in url for use import

GeSaviynt
New Contributor II
New Contributor II

Hi Team,

Can you please provide your input for below use case :

Use Case : To import a user from trusted source through REST api and pass a dynamically value in URL. There are two attributes 'Start_Moment' and 'End_Moment', from current timestamp minus 2 hours for attribute 'End_ Moment' and 'Start_Moment' will be current stamp.

For example : 

End_Moment =  2023-05-21T02:30:00.000-07:00  ( from this parameter  have to minus 2 hours)

Start_Moment =  2023-05-21T00:30:00.000-07:00  ( this parameter will be current timestamp)

Note : I tried with hard coded value it's working and Saviynt version is v2020

URL

https://****************.com/ccx/service/customreport2/travelhrportal1/RaaS?End_Moment=2023-05-17T02:30:00.000-07:00&Start_Moment=2023-05-17T00:30:00.000-07:00&Effective_as_of_Date=${new Date().plus(30).format('yyyy-MM-dd')}&format=json",

I tried for  for Start_Moment = ${Calendar.getInstance().getTime().format('yyyy-MM-dd')} but it's seems it didn't work and I am not able to see any error in log also.

PostMan Screen shot:

geeta_0-1684693252278.png

 

Thank you

Geeta

 

 

 

5 REPLIES 5

rushikeshvartak
All-Star
All-Star

https://forums.saviynt.com/t5/general-discussions/rest-connector-current-date/m-p/2088#M226


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

musthak_ahamad
Regular Contributor
Regular Contributor

@GeSaviynt  did it worked ?

 

Hi @musthak_ahamad ,

I am able to pass dynamically current date. I can see in URL date value is converted but yet end to end testing is not completed will update you.

geeta_0-1685536073646.png

Syntax :

Start_Moment=${Calendar.getInstance().getTime().format(\"yyyy-MM-dd'T'HH:mm:ss:sss\")}&format=json"

Thanks

Geeta

@musthak_ahamad 

But I am facing issue in minus 2 hours from current time stamp and it's not working:

Syntax : 

End_Moment=${(Calendar.getInstance().getTime().format(\"yyyy-MM-dd'T'HH:mm:ss:sss\") - (1000*60*60*2))}&Start_Moment=${Calendar.getInstance().getTime().format(\"yyyy-MM-dd'T'HH:mm:ss:sss\")}&format=json",

Note : Start_Moment is working as expected.

Thanks

Geeta

@GeSaviynt How can i see the output of this api in saviynt .. is there a way?  ${Calendar.getInstance().getTime().format(\"yyyy-MM-dd'T'HH:mm:ss:sss\")}  curious to see the out so i can get an understanding of minus the values.