Automating application creation and setup with REST

Reduce the administration time for new customer setup by using REST to create applications and create/add users to the applications.

Are you new to REST? Start by taking a look at this intro to REST guide for getting events and get familiar with REST APIs.

Setup/Pre-work

1. Add the user type(s) you want to use in your new applications.

2. Set up the application template(s).

(NOTE: for devices, the appropriate device plugin must be installed and the device type must be specified in the user type)

Using REST for automated creation and setup of applications

Create application & add admin user

1. Call GET /applicationtemplates to find the application template you'll use. 

2. (optional) Call GET /applications/{applicationid:int}/users to find the AdminID parameter (if you want to add an admin user when you create your application).

3. Call POST /applications to create the new application from the template you just found. Required parameters in the JSON are applicationTemplateId and name. The adminUserId parameter is optional.

You should now have your new application! 

Find the user type and device type IDs for your new application(s)

1. Call GET /applications/{applicationid:int}/usertypes to find the user IDs for the operator and device user types in your new application.

2. Call GET /applications/{applicationid:int}/devicetypes to find the device type IDs you will add to your new users.

Create operator(s) & device user(s)

1. Call POST /applications/{applicationid:int}/users to add the operator user.

2. Call POST /applications/{applicationid:int}/users to add the device user.

Add a list of users to roles

1. Call GET /applications/{applicationid:int}/users to return a list of users.

2. Call GET /applications/{applicationid:int}/roles to get a list of roles

3. Call POST /batch/applications/{applicationid:int}/roles/{roleid:int}/users to add the users to the specified roles.

Add a list of users to multiple applications

With these resources, you can add existing users to multiple applications!

1. Call GET /applications to return a list of Applications.

2. Call GET /applications/{applicationid:int}/users to get the list of users of a specific application.

3. Call PATCH /batch/applications/{applicationid:int}/users to add existing users into an application

Congratulations! Your new application is now ready on your server with the admin, operator, and device user(s) you created.

Note: If you want to go through the steps manually once before you implement your integration, you can use the test page hosted on your server (http://YOUR_SERVER_ADDRESS/comGpsGate/api/v.1/test).