REST API Guide | 2019.2

Editing the configuration file

A configuration file for the REST API named config.json is stored in the helix-alm-rest-api\config directory in the Helix ALM application directory (e.g., C:\Program Files\Perforce\Helix ALM\helix-alm-rest-api\config).

Edit this file to change settings used by the API, such as the API or Helix ALM host computer address and port number, https information, and RSA key exchange information.

If settings are missing from the file when you upgrade the REST API Server, they are added and the old file is backed up with the date and 'old' added to the filename (e.g., config_2018-05-29_15-09.old.json).

Setting Controls: Example value
Allow HTTP If http is allowed. Only https is allowed by default. "allowHTTP": false,
REST API hostname, addresses to bind to, and ports

REST API computer hostname, addresses or devices to bind to, and port number.

  • hostname—IP or domain name of the web server hosting the REST API. Used exclusively in 'self' URLs.
  • bindAddresses—List of addresses or network devices the REST API server binds to on startup. Default for new installations is ['0.0.0.0', '::'] (0.0.0.0 for IPv4 and :: for IPv6), which indicates all devices. Default for upgrades is the specified hostname value.
  • portNumber—https or http port number for the web server hosting the REST API.
"hostname": "localhost", "bindAddresses": ["::", "0.0.0.0"], "httpsPort": "8443",
"httpPort": 8900,
https private key, public certificate, and key passphrase Location of certificate files. The key.pem and cert.pem files are automatically created in this location the first time the REST API Server starts if they do not already exist. If you want to use your own signed certificates, you can replace the default ones. "httpsPrivateKeyLocation": "./config/certificates/key.pem",
"httpsPrivateKeyPassPhrase": "",
"httpsPublicCertificateLocation": "./config/certificates/cert.pem",
Helix ALM Server hostname and port IP address or domain name of the computer hosting the Helix ALM Server and the port number. These values are automatically set the first time the REST API is installed. Port numbers must be strings. "helixAlmHostName": "127.0.0.1",
"helixAlmPort": "99",
RSA key exchange certificate location Location of public key file used for RSA key exchange. If RSA key exchange is enabled for the Helix ALM Server in the security options in the Helix ALM Server Admin Utility, the public key file must be downloaded, stored in a directory accessible to the API, and the directory must be updated in this setting. "helixAlmCertificateFileLocation": "",
Temporary directory location Location to store uploaded files when the REST API is receiving and sending them to the Helix ALM Server. "temporaryDirectory": "./temp",
Cache location and maximum size Location of cached files for sending to clients so they do not have to be retrieved again from the Helix ALM Server. The maximum size (in megabytes) controls how large the directory can be before the oldest files are deleted. "cacheDirectory": "./cache", "maxCacheSize": 4096,
Maximum request size Maximum request size that the REST API Server will accept before rejecting it because it is too large. Default is 25 MB. "maxRequestSize": 25
Maximum connection timeout Maximum time (in minutes) the REST API waits before considering a socket inactive and forcing it to disconnect. Increase this value to give the Helix ALM Server more time to process longer requests. Default value is 20 minutes. "clientConnectionTimeout ": 20,
Maximum NodeJS memory usage Maximum system memory (in megabytes) used by NodeJS that the REST API allows in megabytes. Default is 2 GB. "maxMemoryUsage": 2048,
Debugging flags How debugging information is logged, which can be used for troubleshooting any issues with the REST API Server. If enabled, information is logged to the HelixALMRESTAPI.txt file in the helix-alm-rest-api directory in the Helix ALM application directory. "debugMemoryUsage": false,
"additionalLogging": true
CORS origin

Support for the Cross-Origin Resource Sharing standard. Specifies how the 'Access-Control-All-Origin' header is returned on responses.

Use:

  • * to tell the browser to allow requests from any web site.
  • True to use the request's 'Allow-Origin' header.
  • A specific web site to always return that value (e.g., wysicorp.com).
  • [value1, value2,...] to specify an array of values (e.g., ["wysicorp.com", "example.com"]. If the 'Allow-Origin' request matches one of the array values, that value is returned.
"corsOrigin": "wysicorp.com",
Rate limit Number of requests that the REST API Server allows per Helix ALM project and IP address per minute. Valid values are 30 - 240. Default value is 60 requests. See Rate limits. "rateLimit": 60,
Configuration file version Version of the configuration file. Do not change. "confVersion": 1