Add Record with Webhooks and pull in file attachment field

  • 0
  • 2
  • Question
  • Updated 2 years ago
Hello,

I am creating a webhook that fires off when a new file is attached to a record.  The webhook creates a new record in a documents table and populates some information.  It works, however I need a file attachment field to fill with the file from the other record.  Basically trying to create a history of documents based off of the file attachment field.  Here is my webhook currently:

<qdbapi>     <udata>mydata</udata>
     <usertoken>%user.token.xxxx_xxx_xxx.xxxxxx User Token%</usertoken>
     

<field fid="6">[Record ID#]</field>
     <field fid="10" >[File Link]</field>
   
     </qdbapi>
  
Thanks.
Photo of Jacob

Jacob

  • 738 Points 500 badge 2x thumb
  • Stuck

Posted 2 years ago

  • 0
  • 2
Photo of Eric Mohlman

Eric Mohlman, Employee

  • 400 Points 250 badge 2x thumb
Would a link to the original record's file attachment work?

If not, for an API call (which is what webhooks are based on) file attachments have to be base-64 encoded and I'm not sure a process to do so has been built into webhooks yet.
Photo of Jacob

Jacob

  • 738 Points 500 badge 2x thumb
For this case the original records file attachment won't work because I am trying to track history through webhooks.  So yes this does mean that I will have to use the API call and base-64 encode the file.  I wasn't sure how to do that unfortunately.  
Photo of Eric Mohlman

Eric Mohlman, Employee

  • 400 Points 250 badge 2x thumb
Then, unfortunately, I'm not aware of a way to accomplish this with the current version of webhooks. Some of our partners: http://www.quickbase.com/partners/add-ons who have file attachment add-ons might be able to direct you to a resource, or help setup the process you need.