Webhook Documentation: Project Updated
The Project Updated webhook is triggered when a user generates new files or updates an existing project via the Custom Export Button in magicplan. While implementing this webhook is not mandatory, it is highly recommended for seamless integration and immediate file processing.
If no webhook URL is specified by the client:
-
magicplan assigns a default URL that performs no action.
-
The files generated during export can only be accessed through the Project Files API, instead of being included in the webhook request.
By providing a valid webhook URL, you can receive the exported files and project details directly, simplifying the process.
🔹 How to Set Up Your Webhook
To configure your webhook, make a PUT
request to the Workspace API and set the webhook_url
field.
Webhook Encoding
To ensure worldwide interoperability, the strings and file URLs in the request are encoded as follows:
-
The character string is converted into a sequence of bytes using UTF-8 encoding.
-
Each byte that is not an ASCII letter or digit is converted to
%HH
, whereHH
is the hexadecimal value of the byte (e.g.,électrique
becomes%C3%A9lectrique
).
Sequence of Events
This webhook is part of a sequence used to notify your application about updates to floor plans:
-
Create and Link Project:
The project is created and linked in one step by specifying theexternal_reference_id
. This field represents the identifier of your local project that is assigned to the magicplan project. -
Authorize Export (Optional):
If configured, the project is authorized for export. -
Floor Plan Updated (Webhook Trigger):
When updates are made to the floor plan, magicplan sends the webhook request to your endpoint with updated files and metadata. If no webhook URL is specified, the files must be accessed through the Project Files API.
HTTP RequestCopied!
-
Method:
POST
-
Endpoint:
https://yourserverurl/update
-
The webhook includes file URLs (valid for 60 minutes) and relevant metadata about the project.
Request SchemaCopied!
Parameter |
Required |
Description |
---|---|---|
|
Yes |
The magicplan API key provided by magicplan. |
|
Yes |
The user's email address. |
|
Yes |
A human-readable title of the project being updated. |
|
Yes |
The unique identifier of the plan being updated. |
|
Yes |
The unique identifier of the project being updated. |
|
No |
The ID of your local project linked to the magicplan project. This is referenced as |
|
No |
The URL of the updated PDF file. |
|
No |
URLs of JPG files, one per floor (e.g., |
|
No |
URLs of DXF files, one per floor. |
|
No |
URLs of PNG files, one per floor. |
|
No |
URLs of SVG files, one per floor. |
|
No |
The URL of the updated magicplan file in XML format. |
|
No |
The URL of the updated web file. |
|
No |
The URL of the IFC file for the entire project. |
|
No |
The URL of the USDZ file for the entire project. |
|
No |
The URL of the OBJ file for the entire project. |
Response SchemaCopied!
XML Tag |
Value |
Description |
---|---|---|
|
|
The request was a success. |
|
The API key is invalid. |
|
|
The given user reference or email does not exist. |
|
|
The given listing does not exist. |
|
|
Optional |
A message that will be displayed in the magicplan app, providing feedback to the user. |
XML SchemaCopied!
<xs:element name="MagicPlanService">
<xs:complexType>
<xs:sequence>
<xs:element name="status">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:enumeration value="0"/>
<xs:enumeration value="1"/>
<xs:enumeration value="14"/>
<xs:enumeration value="18"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="message" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>
An optional message that will be displayed to the user in the magicplan app.
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Example Webhook RequestCopied!
POST /update HTTP/1.1
Host: yourserverurl
Content-Type: application/x-www-form-urlencoded
key=3b2abe7cd80d&
email=john.doe%40example.com&
project_id=73377c22-0366-4f1c-9308-8d1c2fbb05d0&
planid=c32ea8d1-fee3-4c81-b402-eb3f85772cf8&
title=Plan+3&
pdf=https%3A%2F%2Fs3.amazonaws.com%2Fprod.plans.sensopia.com%2Fc32ea8d1-fee3-4c81-b402-eb3f85772cf8%2Fac2abe7cd8d0%2FPlan%203.pdf&
jpg0=https%3A%2F%2Fs3.amazonaws.com%2Fprod.plans.sensopia.com%2Fc32ea8d1-fee3-4c81-b402-eb3f85772cf8%2Fac2abe7cd8d0%2FPlan%203.jpg&
dxf0=https%3A%2F%2Fs3.amazonaws.com%2Fprod.plans.sensopia.com%2Fc32ea8d1-fee3-4c81-b402-eb3f85772cf8%2Fac2abe7cd8d0%2FPlan%203.dxf&
png0=https%3A%2F%2Fs3.amazonaws.com%2Fprod.plans.sensopia.com%2Fc32ea8d1-fee3-4c81-b402-eb3f85772cf8%2Fac2abe7cd8d0%2FPlan%203.png&
svg0=https%3A%2F%2Fs3.amazonaws.com%2Fprod.plans.sensopia.com%2Fc32ea8d1-fee3-4c81-b402-eb3f85772cf8%2Fac2abe7cd8d0%2FPlan%203.svg&
xml=https%3A%2F%2Fs3.amazonaws.com%2Fprod.plans.sensopia.com%2Fc32ea8d1-fee3-4c81-b402-eb3f85772cf8%2Fac2abe7cd8d0%2FPlan%203.xml&
html=https%3A%2F%2Fs3.amazonaws.com%2Fprod.plans.sensopia.com%2Fc32ea8d1-fee3-4c81-b402-eb3f85772cf8%2Fac2abe7cd8d0%2FPlan%203.html&
embedded=https%3A%2F%2Fs3.amazonaws.com%2Fprod.plans.sensopia.com%2Fc32ea8d1-fee3-4c81-b402-eb3f85772cf8%2Fac2abe7cd8d0%2FPlan%203.embedded.html