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

UploadSchemaFile Saviynt REST API , has anyone tried using powershell script or java code ?

shilpab
New Contributor
New Contributor

Hi Team,

We are trying to invoke UploadSchemaFile Saviynt REST API via powershell script. API is invoked as follows. 

shilpab_0-1683289837524.png

FilePath variable mentioned as follows in code

shilpab_1-1683289881703.png

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 ? 

 

6 REPLIES 6

Darshanjain
Saviynt Employee
Saviynt Employee

Hi @shilpab 

The mentioned path ( file ) has to be present in the server-( inside  saviynt ), if not then it will not work.

 

Thanks

Darshan

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.

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

I attach file using browse button. Not added path . Selcted file option as follows , then browse the file and attach.

 

 

shilpab_0-1683296067674.png

 

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

himanshu_verma
New Contributor
New Contributor

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