Callbacks allow you to receive a notification when specific events occur on the proof. Events include:
The notification is made by performing a POST of XML data containing basic information regarding the event. Examples New comment<?xml version="1.0"?> Â Â Â <callback type="comment"> Â Â Â Â Â Â <comment_id>751</comment_id> Â Â Â Â Â Â <file_id>242</file_id> Â Â Â Â Â Â <author>Irek Kubicki</author> Â Â Â Â Â Â <comment>Comment</comment> Â Â Â Â Â Â <action /> Â Â Â Â Â Â <timestamp>1234567890</timestamp> Â Â Â Â <proof_name>MyFile.pdf</proof_name>Â Â Â Â Â Â <recipient_id>34543</recipient_id> Â Â Â Â Â Â <author_email>irek@proofhq.com</author_email>Â Â Â Â Â Â Â Â <folder_id>5432</folder_id>Â Â Â Â Â Â Â Â <folder_name>MyFolder</folder_name>Â Â Â Â Â Â Â Â Â Â Â Â Â Â </callback> <?xml version="1.0"?> Â Â Â <callback type="reply"> Â Â Â Â Â Â <reply_id>383</reply_id> Â Â Â Â Â Â <comment_id>751</comment_id> Â Â Â Â Â Â <file_id>242</file_id> Â Â Â Â Â Â <author>Irek Kubicki</author> Â Â Â Â Â Â <comment>Comment</comment>Â Â Â Â Â Â Â <reply>Reply</reply>Â Â Â Â Â Â Â <action>TO DO</action>Â Â Â Â Â Â Â <timestamp>1234567890</timestamp> Â Â Â Â <proof_name>MyFile.pdf</proof_name>Â Â Â Â Â Â Â Â Â <recipient_id>34543</recipient_id> Â Â Â Â Â Â <author_email>irek@proofhq.com</author_email>Â Â Â Â Â Â <folder_id>5432</folder_id>Â Â Â Â Â Â Â Â <folder_name>MyFolder</folder_name>Â Â Â Â Â Â Â Â Â Â Â Â Â Â </callback> Change of proof state <?xml version="1.0"?> Â Â Â <callback type="state"> Â Â Â Â Â Â <file_id>242</file_id> Â Â Â Â Â Â <name>globe.png</name> Â Â Â Â Â Â <state>unlocked</state> Â Â Â Â Â Â <status>pending</status> Â Â Â Â <folder_id>2343</folder_id>Â Â Â Â <folder_name>My Folder</folder_name> Â Â Â </callback> Action change on comment <?xml version="1.0"?> Â Â Â <callback type="action"> Â Â Â Â Â Â <comment_id>751</comment_id > Â Â Â Â Â Â <file_id>242</file_id> Â Â Â Â Â Â <author>Irek Kubicki</author> Â Â Â Â Â Â <comment>Comment</comment> Â Â Â Â Â Â <action>TO DO</action> Â Â Â Â Â Â <timestamp>1234567890</timestamp> Â Â Â Â <proof_name>MyFile.pdf</proof_name>Â Â Â Â Â Â Â Â Â <recipient_id>34543</recipient_id> Â Â Â Â Â Â <author_email>irek@proofhq.com</author_email>Â Â Â Â Â </callback> Decision made or changed <?xml version="1.0"?> Â Â Â <callback type="decision"> Â Â Â Â Â Â <recipient_id>400</recipient_id> Â Â Â Â Â Â <file_id>242</file_id> Â Â Â Â Â Â <name>Irek Kubicki</name> Â Â Â Â Â Â <decision>changes required</decision> Â Â Â Â <proof_name>MyFile.pdf</proof_name>Â Â Â Â Â Â <folder_id>2343</folder_id> Â Â Â Â <folder_name>My Folder</folder_name> Â Â Â Â Â Â Â <recipient_id>34543</recipient_id> Â Â Â Â Â Â <author_email>irek@proofhq.com</author_email>Â Â Â Â Â </callback> Processed <?xml version="1.0"?> Â Â Â <callback type="processed"> Â Â Â Â Â Â <file_id>242</file_id> Â Â Â Â Â Â <name>TheProofName.pdf</name> Â Â Â Â Â Â <status>success</status> OR <status>failed</status> Â Â Â Â <folder_id>2343</folder_id>Â Â Â Â <folder_name>My Folder</folder_name> Â Â Â </callback> Trashed <?xml version="1.0"?> Â Â Â <callback type="trashed"> Â Â Â Â Â Â <file_id>242</file_id> Â Â Â Â Â Â <proof_name>TheProofName.pdf</proof_name> Â Â Â Â <folder_id>2343</folder_id> Â Â Â Â <folder_name>My Folder</folder_name> Â Â Â </callback>
With the release of the 13.14 WSDL we have introduced a pass through parameter that can be used when either creating a new proof or creating a new version. With this parameter you are able to pass through a value that will be returned when a callback is made on this new proof or version e.g. Creating a proof with the pass_through parameter https://app.proofhq.com/newproof?pass_through=xxx will result in the following "New comment" callback (and applies to all other callbacks using the pass_through parameter): <?xml version="1.0"?>    <callback type="comment">       <comment_id>751</comment_id>       <file_id>242</file_id>       <author>Irek Kubicki</author>       <comment>Comment</comment>       <action />       <timestamp>1234567890</timestamp>     <proof_name>MyFile.pdf</proof_name>           <pass_through>"xxx"</pass_through>    </callback> Note the JSON encoded pass_through parameter that is included in the callback xml. This will allow you to link an entity within your system to the proof within ProofHQ by passing in the identifier associated with this entity. The same applies for new versions e.g. Creating a new version with the pass_through parameter https://app.proofhq.com/upload/version/xyz?pass_through=xxx Where "xyz" is the id of the proof you want create a new version on and "xxx" is your pass through parameter. |
Overview‎ > ‎