Deploy API – Version 2

Last update: Edit

1 Introduction

The Deploy API allows you to manage application environments in the Mendix Cloud. Version 2 introduces improved APIs for some actions.

2 Authentication

The Deploy API requires authentication via API keys as discussed in the Authentication section of Deploy API (V1).

3 API Calls

3.1 Upload Package

3.1.1 Description

Uploads a deployment package from the local system to a specific app. This package can then be transported to a specific environment for deployment.

HTTP Method: POST
URL: https://deploy.mendix.com/api/v2/apps/<AppId>/packages/upload?name=<PackageName>

3.1.2 Request

Request Parameters

Example Request

POST /api/v2/apps/calc/packages/upload?name=calc_1.0.0.45.mda
Host: deploy.mendix.com

Mendix-Username: richard.ford51@example.com
Mendix-ApiKey:  26587896-1cef-4483-accf-ad304e2673d6
Content-Type: multipart/form-data; boundary=MultipartBoundary

--MultipartBoundary
Content-Disposition: form-data;

@%USERPROFILE%/Documents/Mendix/calc-main/releases/calc_1.0.0.45.mda
--MultipartBoundary--

Curl example:

curl -v -F "file=@%USERPROFILE%/Documents/Mendix/calc-main/releases/calc_1.0.0.45.mda"  -X POST -H "Mendix-Username: richard.ford51@example.com" -H "Mendix-ApiKey: 26587896-1cef-4483-accf-ad304e2673d6" "https://deploy.mendix.com/api/v2/apps/calc/packages/upload?name=calc_1.0.0.45.mda"

3.1.3 Output

The API call returns the following json:

{
    "PackageId": "<packageID>",
    "JobId": "<JobID>"
}

Where:

  • <packageID> is the ID of the package which will be created by the API
  • <JobID> is the ID of the job which is creating the package — the status of the job can be interrogated with the Job Status API

3.2 Job Status

3.2.1 Description

Find the status of a Job using the JobID returned from an API call.

HTTP Method: GET
URL: https://deploy.mendix.com/api/v2/apps/<AppId>/jobs/<JobId>

3.2.2 Request

Request Parameters

  • AppId (String): Subdomain name of an app
  • JobID (String): the ID of a Job which was triggered by a previous API call

Example Request

POST /api/v2/apps/calc/jobs/66046953-ecf7-4550-a889-4b7e9f1e1705
Host: deploy.mendix.com

Mendix-Username: richard.ford51@example.com
Mendix-ApiKey:  26587896-1cef-4483-accf-ad304e2673d6

3.2.3 Output

The API call returns the following json:

{
    "Status": "<status>"
}

Where <status> is one of:

  • Queued
  • Running
  • Completed
  • Failed