Example 1: Automate File Processing with Webhooks
This workflow automates file handling when a project is completed in magicplan, ensuring immediate processing of files while adhering to webhook requirements.
Steps:
-
Create Project:
Use theexternal_reference_id
parameter in the Create Project API to link the magicplan project to your local system. -
Export Trigger:
-
Once the project appears in the user's app, they can open the magicplan app.
-
Upon completing the project, the user presses the Custom Export button, signaling that the project is ready for export.
-
-
Webhook Notification:
magicplan sends aPOST
request to yourwebhook_url
, including:-
The
listing
parameter, which identifies the local project linked to the magicplan project. -
File URLs (valid for 60 minutes).
-
Additional project metadata.
-
-
File Queuing and Downloading:
Your system queues the file URLs and downloads them as soon as possible. -
Webhook Response:
-
If your webhook responds with status
0
, magicplan displays success to the user. -
If the webhook fails or does not respond with status
0
, the app shows an error to the user, allowing them to retry.
-
-
Fallback via Project Files API (Optional):
If the webhook fails entirely, files can still be fetched using the Project Files API as a backup solution.
Use Case Example
A construction company automatically imports site reports and floor plans into their project management system after export.