Authorize export from magicplan
This service enables your application to confirm whether users are allowed to publish a project to your system. By default, magicplan authorizes all projects.
If this service is configured, magicplan calls it when a user requests to publish a project. Your application can then accept or decline the transfer based on your own criteria, such as payment status or account verification.
🔹 Setting up an authorization endpoint
If you want magicplan to call an authorization endpoint before making a request to your webhook, you must configure it by making a PUT request to the Workspace API and setting the authorize_url
field.
How It Works
-
Request from magicplan:
-
magicplan sends a
GET
request to your server. -
The request contains essential parameters such as
key
,email
,listing
,project_id
andplanid
.
-
-
Application Decision:
-
Based on the information provided, your application:
-
Accepts: Returns a successful status.
-
Declines: No successful status is returned, and the transfer is denied.
-
-
-
Follow-Up Action:
-
If accepted, magicplan calls your webhook to notify your application that the files are ready for download.
-
HTTP Request
-
Method:
GET
-
Endpoint:
https://yourserverurl/cansend
Request Parameters
Parameter |
Required |
Description |
---|---|---|
|
Yes |
The API key provided by magicplan. |
|
Yes |
The user's email address. |
|
No |
The ID of your local project linked to the magicplan project. This is referenced as |
|
Yes |
The unique identifier of the plan being updated. |
|
Yes |
The unique identifier of the project being updated. |
Response Format
XML Tag |
Value |
Description |
---|---|---|
|
|
The request was a success. |
|
The API key is invalid. |
|
|
A parameter is missing or invalid. |
|
|
The 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 Response Schema
<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="2"/>
<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 displayed to the user in the magicplan app, providing additional context or feedback.
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Example Request
GET /cansend?key=32ab7ce088d6
&email=john.doe@example.com
&listing=12345678
&project_id=73377c22-0366-4f1c-9308-8d1c2fbb05d0
&planid=4d56f57a5435 HTTP/1.1
Host: yourserverurl
Example XML Response (Acceptance)
<MagicPlanService>
<status>0</status>
</MagicPlanService>
Example XML Response (Decline)
<MagicPlanService>
<status>14</status>
<message>Your custom message which will displayed to the users in the magicplan app</message>
</MagicPlanService>