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

Data Format Issue while updating the account

bhuvanesh
New Contributor II
New Contributor II

Hi Saviynt Team,

Could you please suggest, what json format should i use to pass the date format to end system via the disablement JSON. We want to update enddate or current date with below format.

end system accept this date format : 2024-01-20T00:00:00.00Z

i tried with all way but its giving an error that date format is not correct.

we tried below data format

A. ${user.enddate..format('yyyyMMddHHmmss')'Z',TimeZone.getTimeZone('Etc/UTC')}",

B. ${Calendar.getInstance().getTime().format('yyyyMMddHHmmss')}Z

C. ${user.enddate.format('yyyy-MM-dd'T'HH:mm:ss'Z'')}
D. ${user.enddate}

here is json request body

"httpParams": "{\"schemas\":[\"urn:ietf:params:scim:api:messages:2.0:PatchOp\"],\"Operations\":[{\"op\":\"add\",\"path\":\"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:terminationDate\",\"value\":\"${user.enddate.format('yyyy-MM-dd'T'HH:mm:ss'Z'')}\"}]}"

ERROR MESSAGE

"message": "Date-time string must have the format YYYY-MM-DD'T'hh:mm:ss'Z'"


Thanks

10 REPLIES 10

adarshk
Saviynt Employee
Saviynt Employee

What is the target system here?

bhuvanesh
New Contributor II
New Contributor II

SAP Concur V4 API Version

Vedanth-BK
Regular Contributor
Regular Contributor

Hi @bhuvanesh 

Please try with the below 

{\"schemas\":[\"urn:ietf:params:scim:api:messages:2.0:PatchOp\"],\"Operations\":[{\"op\":\"add\",\"path\":\"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:terminationDate\",\"value\":\"${user.enddate.format('yyyy-MM-ddTHH:mm:ssZ')}\"}]}

Thank you 

Vedanth

Thank you
Vedanth B.K

Hello @Vedanth-BK @adarshk 

We tried but still getting same error message.

{"call1":{"headers":null,"message":{"status":400,"schemas":["urn:ietf:params:scim:api:messages:2.0:Error","urn:ietf:params:scim:api:messages:concur:2.0:Error"],"urn:ietf:params:scim:api:messages:concur:2.0:Error":{"messages":[{"code":"BAD_INPUT","type":"error","schemaPath":"/urn:ietf:params:scim:schemas:extension:enterprise:2.0:User/terminationDate","message":"Date-time string must have the format YYYY-MM-DD'T'hh:mm:ss'Z'"}]},"scimType":"invalidSyntax","detail":"Invalid schema","meta":null},"statusCode":400,"description":null,"status":"Failed"}}

Thanks

Manu269
All-Star
All-Star

@bhuvanesh can you try this :

yyyy-MM-dd'T'HH:mm:ss.ssZ

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.

bhuvanesh
New Contributor II
New Contributor II

Hello @Manu269 

Still Getting Same error message

{"call1":{"headers":null,"message":{"status":400,"schemas":["urn:ietf:params:scim:api:messages:2.0:Error","urn:ietf:params:scim:api:messages:concur:2.0:Error"],"urn:ietf:params:scim:api:messages:concur:2.0:Error":{"messages":[{"code":"BAD_INPUT","type":"error","schemaPath":"/urn:ietf:params:scim:schemas:extension:enterprise:2.0:User/terminationDate","message":"Date-time string must have the format YYYY-MM-DD'T'hh:mm:ss'Z'"}]},"scimType":"invalidSyntax","detail":"Invalid schema","meta":null},"statusCode":400,"description":null,"status":"Failed"}}

Here is the Response body

"httpParams": "{\"schemas\":[\"urn:ietf:params:scim:api:messages:2.0:PatchOp\"],\"Operations\":[{\"op\":\"replace\",\"path\":\"active\",\"value\":false},{\"op\":\"add\",\"path\":\"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:terminationDate\",\"value\":\"${user.enddate.format('yyyy-MM-dd'T'HH:mm:ss.ssZ')}\"},{\"op\":\"remove\",\"path\":\"entitlements\",\"values\":[\"Travel\"]}]}"
 

Thanks

{
"schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
"Operations": [
{
"op": "replace",
"path": "active",
"value": false
},
{
"op": "add",
"path": "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:terminationDate",
"value": "${user.enddate.format('yyyy-MM-dd'T'HH:mm:ss.SSZ')}"
},
{
"op": "remove",
"path": "entitlements",
"values": ["Travel"]
}
]
}


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

Hello @rushikeshvartak 

Still same error

Thanks

navneetv
Regular Contributor II
Regular Contributor II

Hi @bhuvanesh  try with below 

\"${Calendar.getInstance().getTime().format(\"yyyy-MM-dd'T'HH:mm:ss'Z'\")}\"

bhuvanesh
New Contributor II
New Contributor II

Hi @navneetv 

it works, Thank you for working on it.