POST METHOD (Returns bearer token) 


Desc

Method is used to login and get a refresh token. 

URL 

http://your-env.zentreasury.app/oauth/token 

 

Body

 

'grant_type' => 'password', //Use word “password” here  

'client_id' => 'client-id', //Will be provided by ZenTreasury 

'client_secret' => 'client-secret', //Will be provided by ZenTreasury    

 'username' => 'demo@email.com', //Use your email for which api is setup    

'password' => 'my-password', //Use your password for which api is setup    

'scope' => '*', //Use empty or * 

 

Headers

 

   Content-Type  

  application/json  

   ReturnFormat  

  Json or xml  

 

 

 

Return

‘token type’ => Returns bearer 

‘Expires at’ => Returns when token expires 

‘Access token’ => Gives you token to use for another api request call 

‘refresh token’ => Similar token 

 

Postman Demo

 

Fig: - Postman login view  


 

GET METHOD (Returns list of files) 

 

Desc

Method is used to get the list of all voucher files from cloud. 

 

URL

     http://your-env.zentreasury.app/api/voucher-files 

 

Body

     empty 

 

Headers

  Content-Type  

  application/json  

  ReturnFormat  

  Json or xml  

  authorization  

  Bearer [Access token]  

 

Return

‘files’ => List of files 













GET METHOD (Content of file) 

 

Desc

Method is used to get content of file if filename is sent. 

 

URL  

http://your-env.zentreasury.app/download-voucher-file  

 

Body

‘file_name’  

'file_name=> 'string', //Use file name here  

 

Headers

  Content-Type   

  application/json  

  ReturnFormat  

  Json or xml  

  authorization  

  Bearer [Access token]  

 

Return

Returns the content of files in binary