Import Application Endpoint
  • 16 Jan 2024
  • 1 Minute to read
  • Dark
    Light
  • PDF

Import Application Endpoint

  • Dark
    Light
  • PDF

Article Summary

The Import Application is an endpoint in BuildMaster's Application Management API that can create an application from an exported package (i.e., template, sample, or backup) and return an ApplicationInfo object describing the imported application.

🚀 Quick Example: Importing an Application with Curl

This example creates an application ImportedApp by importing version 1.0.0 of an application MyApp, authenticating with the API key abc12345:

curl -X POST -H "Content-Type: application/json" -H "X-ApiKey: abc12345" -d "{\"name\": \"ImportedApp\",\"packageSource\": \"BackupResource\",\"packageId\": \"MyApp\",\"packageVersion\": \"1.0.0\",\"importHistory\": true,\"overwrite\": false,\"raft\": null}" https://proget.corp.local/api/applications/import

Importing and Exporting in BuildMaster can be quite complex, see Migrating Application-by-Application for more details on performing these.

Request

To import an application, simply POST to the URL with an appropriate API Key and an ImportApplication object as the request body.

POST /api/applications/import

Querystring parameters may be used for ImportApplication object properties instead of the Body

POST /api/applications/import?«ImportApplication-properties»

Importing an application with an ImportApplication body requires the URL and the body in the request:

POST /api/applications/import
{
   "name": "ImportedApp",
   "packageSource": "BackupResource",
   "packageId": "MyApp",
   "packageVersion": "1.0.0",
   "importHistory": true,
   "overwrite": false,
   "raft": null
}

Importing an application with querystring parameters requires the name (e.g. importedApp) and other querystring parameters specified in the ImportApplication object

POST /api/applications/import?name=ImportedApp&packageSource=BackupResource&packageId=MyApp&packageVersion=1.0.0&importHistory=true&overwrite=false&raft=null

Response

A successful (200) response body will contain an ApplicationInfo object. For example, to import a application named ImportedApp:

the request would return this:

POST /api/applications/clone

{
    "id":3,
    "name":"ImportedApp",
    "active":true,
    "buildNumberScheme":"Sequential",
    "releaseUsage":"Required",
    "allowIssues":false
}
ResponseDetails
200 (Success)body will contain a ApplicationInfo Object
400 (Invalid Input)indicates invalid or missing properties on the ImportApplication Object; the body will provide some details as text
403 (Unauthorized API Key)indicates a missing, unknown, or unathorized API Key; the body will be empty
500 (Server Error)indicates an unexpected error; the body will contain the message and stack trace; this will also be logged

Was this article helpful?