Introduction

The team server API allows you to retrieve the information (branches, revisions) of application models stored in our team server. You always access an application model via the context of an application (see the Deploy API for more information about retrieving applications and application identifiers). The image below provides a domain model representation of the concepts discussed below and how these are related:

Authentication

The Cloud Portal Management API requires its users to authenticate themselves. This can be done by using API keys; for more information about this please refer to this article.

API calls

Retrieve branches

Retrieves all branches that belong to the team server project of a specific app which the authenticated user has access to as a regular user.

HTTP Method: GET
 URL: https://deploy.mendix.com/api/1/apps/<AppId>/branches/

Request

Parameter
  • AppId (String) : Subdomain name of an app.
Example
GET /api/1/apps/calc/branches/ HTTP/1.1
Host: deploy.mendix.com

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

Output

List of objects with the following key-value pairs:

  • Name (String) : Name of the branch. This is ‘trunk’ for the main line or a specific branch name.
  • DisplayName (String) : Visible name in the Cloud Portal. For the trunk, this is ‘Main line’.
  • LatestRevisionNumber (Long) : Number of the latest revision.
  • LatestRevisionMendixVersion (String) : Version string of the Mendix version of the app project in this revision.
Error codes
HTTP Status Error code Description
400 INVALID_APPID Invalid AppId.
404 APP_NOT_FOUND App not found.
Example
[{
     "Name" :  "trunk" ,
     "LatestRevisionNumber" :  9 ,
     "LatestRevisionMendixVersion" :  "5.6.0" ,
     "DisplayName" :  "Main line"
},{
     "Name" :  "statisticalfunctions" ,
     "LatestRevisionNumber" :  13 ,
     "LatestRevisionMendixVersion" :  "5.6.0" ,
     "DisplayName" :  "statisticalfunctions"
}]

Retrieve branch

Retrieves a specific branch that belongs to the team server project of a specific app which the authenticated user has access to as a regular user.

 HTTP Method: GET
 URL: https://deploy.mendix.com/api/1/apps/<AppId>/branches/<Name>

Request

Parameters
  • AppId (String) : Subdomain name of an app.
  • Name (String) : Name of the branch to get or ‘trunk’ to get the main line.
Example
GET /api/1/apps/calc/branches/trunk HTTP/1.1
Host: deploy.mendix.com

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

Output

An object with the following key-value pairs:

  • Name (String) : Name of the branch. This is ‘trunk’ for the main line or a specific branch name.
  • DisplayName (String) : Visible name in the Cloud Portal. For the trunk, this is ‘Main line’.
  • LatestRevisionNumber (Long) : Number of the latest revision.
  • LatestRevisionMendixVersion (String) : Version string of the Mendix version of the app project in the latest revision.
Error codes
HTTP Status Error code Description
400 INVALID_APPID Invalid AppId.
404 APP_NOT_FOUND App not found.
404 BRANCH_NOT_FOUND There is no branch with name ‘branch name’.
Example
{
    "Name": "trunk",
    "LatestRevisionNumber": 9,
    "LatestRevisionMendixVersion": "5.6.0",
    "DisplayName": "Main line"
}

Retrieve revisions

Retrieves all revisions of a specific branch that belongs to the team server project of a specific app which the authenticated user has access to as a regular user.

HTTP Method: GET
 URL: https://deploy.mendix.com/api/1/apps/<AppId>/branches/<Name>/revisions/ 

Request

Parameters
  • AppId (String) : Subdomain name of an app.
  • Name (String) : Name of the branch to get or ‘trunk’ to get the main line.
Example
GET /api/1/apps/calc/branches/trunk/revisions/ HTTP/1.1
Host: deploy.mendix.com

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

Output

List of objects with the following key-value pairs:

  • Number (Long) : Number of the revision.
  • CommitMessage (String) : Commit message of the revision.
  • Date (Date) : Date when the revision is created (or the commit is done).
  • Author (String) : Creator of the revision (committer).
  • MendixVersion (String) : Version string of the Mendix version of the app project in this revision.
Error codes
HTTP Status Error code Description
400 INVALID_APPID Invalid AppId.
404 APP_NOT_FOUND App not found.
404 BRANCH_NOT_FOUND There is no branch with name ‘branch name’.
Example
[{
    "MendixVersion": "5.6.0",
    "CommitMessage": "Implement C key",
    "Date": 1394031450618,
    "Number": 8,
    "Author": "richard.ford51@example.com"
},{
    "MendixVersion": "5.6.0",
    "CommitMessage": "Implement ^ key",
    "Date": 1394031460618,
    "Number": 9,
    "Author": "richard.ford51@example.com"
}]