05/05/2023 05:33 AM
Hi Team,
We are trying to invoke UploadSchemaFile Saviynt REST API via powershell script. API is invoked as follows.
FilePath variable mentioned as follows in code
Script gives error as{"msg": "File not found" , error code: 1 }
How to pass file parameter in powershell script or in java code for this REST API ?
05/05/2023 06:16 AM
Hi @shilpab
The mentioned path ( file ) has to be present in the server-( inside saviynt ), if not then it will not work.
Thanks
Darshan
05/05/2023 06:54 AM
I executed this API from postman from my machine. File was exist on my machine , not on Saviynt server. But it worked via Postman .bUt same not working from script.
05/05/2023 07:13 AM
Hi @shilpab
Sorry for my earlier response, i was referring to the wrong Api,
Okay from postman did you attach the file or gave the path, as per the documentation we have to give attach the file in the body of the request and not to give the path.
Thanks
Darshan
05/05/2023 07:14 AM
I attach file using browse button. Not added path . Selcted file option as follows , then browse the file and attach.
05/05/2023 07:19 AM
Yes you can only add the file there, cant pass it via location ( path location ) as per the path.
Let me check if there is anyway to pass the path and see to pick up the file and let you know.
Thanks
Darshan
Thanks
Darshan
07/14/2023 12:55 AM
Hi @shilpab and @Darshanjain,
I am facing similar issue where file is present on the server and powershell script is running from the server. I have provided the file path in the body of the request and script runs fine but when I checked in Saviynt under Datafiles, file hasn't uploaded. Could you please let me know how to pass the file path?
Regards,
Himanshu