Forum Discussion

JordanMcAlister's avatar
JordanMcAlister
Qrew Captain
6 years ago

Webhook to Delete Attachments - not actually deleting them

Hey,

I have a webhook set to be triggered when data changes in the table. The webhook deletes a set of attachments when something is checked. At first glance, everything seems to work and the pictures that were once in the attachment field don't show, but when I go to the revision history, it still shows that the picture is there and somehow there is a deleted placeholder as the current revision.  Ive attached a picture that shows this

Here is my webhook code:
HTTP method: POST
Message format: XML
Message header: QUICKBASE-ACTION    API-EDITRECORD
Message body: 
<qdbapi>
<usertoken>%user.token.xxxxxxxxxxxxx.Jordan McAlister%</usertoken>
<rid>[Record ID#]</rid>
<field fid="30" filename="delete"></field>
<field fid="31" filename="delete"></field>
<field fid="32" filename="delete"></field>
<field fid="33" filename="delete"></field>
<field fid="34" filename="delete"></field>
<field fid="420" filename="delete"></field>
<field fid="421" filename="delete"></field>
<field fid="422" filename="delete"></field>
<field fid="423" filename="delete"></field>
<field fid="424" filename="delete"></field>
</qdbapi>



------------------------------
Jordan McAlister
------------------------------
  • I've found a way around this by making the attachment field only be allowed to hold 1 revision.

    ------------------------------
    Jordan McAlister
    ------------------------------
    • RyanStanford1's avatar
      RyanStanford1
      Qrew Captain
      That's exactly what I was going to suggest. The Webhook does delete it, as it is no longer the current revision of the file attachment.

      ------------------------------
      Ryan Stanford
      ------------------------------
  • This is a useful post thread.   Just a correction to the setup.
    Message header is correct with Key: QUICKBASE-ACTION   
    but the Action is API_EditRecord with an under score.



    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------