How to Import Configuration Files in JSON format to Alumio

This article explains how you can synchronize configurations between Alumio environments. You can export the connections files in JSON format from one environment and import it to another Alumio environment.

By exporting the Alumio configurations in JSON format, you can move those configurations to other Alumio environments using the Alumio API. 

For example, moving configurations from the sandbox environment to the production environment. 

 

To import the file back to Alumio you need to:

  1. Export the connection from Alumio
  2. Open the environment you want to import the file to
  3. Go settings -> Info, and copy the API URL Ex: "api.sandbox.demo.alumio.com"
  4. And paste it into Postman:  New request -> post -> paste the link api.sandbox.demo.alumio.com followed by api/v1/di/configurations , so it looks like api.sandbox.demo.alumio.com/api/v1/di/configurations
    Note: api/v1/di/configurations is a constant endpoint that should always be added.
  5. Choose body -> raw -> and in "text" section select JSON -> paste the data from the .ndjson file that you exported earlier from Alumio into the "body" field. 
  6. Go back to Alumio - settings -> API Keys -> hit "+" and generate a new token name and copy it. Then go back to Postman and in “Authorization” tab choose type as "Bearer token" and in value put the token you have just copied. 
    Example:
    “eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6Imguc2lyZW5rb0BhbHVtaW8uY29tIiwicm9sZXMiOlsiUk9MRV9BRE1JTklTVFJBVE9SIl0sImp0aSI6IjAxRjlFOEZRMUdESzJGMFJSWDRCS05TNVYwIn0.gtTWo7kmaf8EF5lFCU35YlfSPWm-F69w9D3WfDKnm1g“. 
  7. Finally, hit “Send”. It should import the file to Alumio.

If you receive an error:

 

{
"status": 500,
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
"title": "Internal Server Error",
"detail": "No route found for \"POST /vi/di/configurations\" (from \"http://api.sandbox.demo.alumio.com/vi/di/configurations\")"
}

 

look into the "description" field in the body of the JSON file. It cannot be set to null. If it is, replace it with an empty string like this: “ “ 
 
If you happen to receive an error:

{
"status": 500,
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
"title": "Internal Server Error",
"detail": "A configuration with this identifier already exists. \n Please enter a unique value for the identifier"
}

It obviously means that you have already imported this file and it already exists.