Simplify uses OAUTH2 for connectivity.  In order to post or get files via API, you will need to use the Windows Service as the Trigger (POST) and Action (GET).  


Please do not install the Windows Service Client as it will download the files automatically and if the timing isn't worked out, it will pull down the files before your application can call the API and GET the files.


How to get the access token

  1. Call login API: /api/auth/login (The access token will expire after 60 minutes)



2. The access token will expire. Then, we need to refresh the token. /api/auth/refresh-token (The refresh token will expire after 7 days)


How to call the Trigger via API


curl  --request POST \  
--url  'https://simplify.ecgrid.com/api/webhooks/windowsservice'  \  
--header  'Authorization: Bearer {token}'  \  
--header  'ConnectionId: {connectionId}'  \  
--header  'content-type: application/text/plain'  \  
--data  '{file content}'

The connection string can be found under the Windows Service connector.


How to Download via API

You will need the connection Id (pictured above) to connect.

curl  --request GET\  
--url  'https://simplify.ecgrid.com/api/docs/windows-service-list?ConnectionId={connectionId}'  \  
--header  'Authorization: Bearer {token}'  \  
 
Response (list of documentId): [
  "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "e430b9ec-c113-4158-8c6e-9eec46379078"
]

 

curl  --request GET\  
--url  'https://simplify.ecgrid.com/api/docs/{documentId}/download'  \  
--header  'Authorization: Bearer {token}'  \  
 
Response: {
  "id": "string",
  "content": "string",
  "fileName": "string"
}