Create and configure analytics applications
Combine /config/apps
, /appedit
, and /config/folders
requests to create an application, upload its configuration, and associate it with a folder.
The following sample JSON defines an application named New AppEdit Test.
When programmatically creating an application, populating it, and binding it to a folder, you must create the application before you can do either of the other two tasks. The next sample shows the JSON that associates a folder with the application that was defined previously.
The next sample shows an abbreviated version of the JSON configuration of an application.
Once you have JSON that provides information about these three aspects of an application, you can create the application, bind it to a folder, and define its configuration with three cURL calls like the following:
-
Calls the
/config/apps
endpoint to create the application, using the contents of the fileapp-definition.json
.curl -s -X POST -H "Content-Type:application/json" "http://example.company.com:3000/config/apps?token=$token" --data @app-definition.json
-
Calls the
/config/folders
endpoint to associate the new application with a specified folder, using the contents of the fileapp-folder-binding.json
.curl -s -X POST -H "Content-Type:application/json" http:///example.company.com:3000/config/folders?token=$token" --data @app-folder-binding.json
-
Calls the
/appedit
endpoint to upload the configuration of the application, using the contents of the fileapp-configuration-sample.json
.curl -s -X POST -H "Content-Type:application/json" "http:///example.company.com:3000/appedit/Technologies/Technologies-RD/AppEdit%20Test?token=$token" --data @app-configuration-sample.json
While cURL provides a quick way to use and test REST APIs, and shell scripts are a quick and convenient way of automating many tasks, it is typically faster in the long run to call APIs from applications. The next topic discusses how to use the /appedit
API from within applications that are written in the Python programming language.