what information is pass through the sharefile event (webhook) and how I can control it

  • 1
  • Question
  • Updated 1 week ago
In the API documentation, it shows that it is possible to define events (webhooks) that fire upon file activities like uploading a file. What information is possible to get through the event.
I would like to get the file size , create date, file name and download link is that possible and how?
Photo of eyal kama

eyal kama

  • 2 Posts
  • 0 Reply Likes

Posted 1 week ago

  • 1
Photo of Dale Smith

Dale Smith, Employee

  • 128 Posts
  • 19 Reply Likes
Hi Eyal,

Currently the webhook payload is very minimal, mostly to let an application know an event has happened. It's then up to the application to call an existing API to get the current information. 

This is an example of the payload for Upload: 
{
"WebhookSubscriptionId": "w123",
"AccountInfo": {
"AccountId": "a123",
"Subdomain": "mycompany",
"AppControlPlane": "sharefile.com",
"ApiControlPlane": "sf-api.com"
},
"Event": {
"Timestamp": "2017-05-21T14:31:21.488137Z",
"OperationName": "Upload",
"ResourceType": "File",
"Resource": {
"Id": "fi123",
"Parent": {
"Id": "fo123"
}
}
}
}

From this, you get all of the information you would need to make a call to the Items endpoint to get the information about the file uploaded.

This page has more information about dealing with the webhook payload:
http://api.sharefile.com/rest/webhooks/payloads.aspx

Hope this helps,
Dale
(Edited)