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

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