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.

🔁 Sequence of Events
  1. Request from magicplan:

    • magicplan sends a GET request to your server.

    • The request contains essential parameters such as key, email, listing, project_id and planid.

  2. 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.

  3. 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
key Yes The API key provided by magicplan.
email Yes The user's email address.
listing No The ID of your local project linked to the magicplan project. This is referenced as external_reference_id in the Workspace API
planid Yes The unique identifier of the plan being updated.
project_id Yes The unique identifier of the project being updated.

Response Format
XML Tag Value Description
<status> 0 The request was a success.
1 The API key is invalid.
2 A parameter is missing or invalid.
14 The user reference or email does not exist.
18 The given listing does not exist.
<message> optional A message that will be displayed in the magicplan app, providing feedback to the user.

Xml Response Schema

&lt;xs:element name="MagicPlanService"&gt;
  &lt;xs:complexType&gt;
    &lt;xs:sequence&gt;
      &lt;xs:element name="status"&gt;
        &lt;xs:simpleType&gt;
          &lt;xs:restriction base="xs:integer"&gt;
            &lt;xs:enumeration value="0"/&gt;
            &lt;xs:enumeration value="1"/&gt;
            &lt;xs:enumeration value="2"/&gt;
            &lt;xs:enumeration value="14"/&gt;
            &lt;xs:enumeration value="18"/&gt;
          &lt;/xs:restriction&gt;
        &lt;/xs:simpleType&gt;
      &lt;/xs:element&gt;
      &lt;xs:element name="message" type="xs:string" minOccurs="0"&gt;
        &lt;xs:annotation&gt;
          &lt;xs:documentation&gt;
            An optional message displayed to the user in the magicplan app, providing additional context or feedback.
          &lt;/xs:documentation&gt;
        &lt;/xs:annotation&gt;
      &lt;/xs:element&gt;
    &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;
&lt;/xs:element&gt;

Example Request

GET /cansend?key=32ab7ce088d6
    &amp;email=john.doe@example.com
    &amp;listing=12345678
    &amp;project_id=73377c22-0366-4f1c-9308-8d1c2fbb05d0
    &amp;planid=4d56f57a5435 HTTP/1.1
Host: yourserverurl

Example XML Response (Acceptance)

&lt;MagicPlanService&gt;
  &lt;status&gt;0&lt;/status&gt;
&lt;/MagicPlanService&gt;


Example XML Response (Decline)

&lt;MagicPlanService&gt;
  &lt;status&gt;14&lt;/status&gt;
  &lt;message&gt;Your custom message which will displayed to the users in the magicplan app&lt;/message&gt;
&lt;/MagicPlanService&gt;