Example 2: Notify and Fetch Additional Files
This workflow retrieves both the files included in the webhook and additional data required for processing.
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. -
Additional Data Retrieval:
If additional files or data are required, your system calls the Project Files API using the project ID or maybe the Project Details API for additional data. -
Webhook Response:
-
Status
0
: Indicates success and informs the user of successful processing. -
Other statuses: An error message is displayed in the app, prompting the user to retry.
-
Use Case Example:
An interior design firm retrieves both exported files and additional metadata, like room dimensions, for client presentations.