Apart from the 100+ natively supported applications to use from, Cobalt also supports Custom applications. Users can create applications for their customers having the same feel as that of a native applications with custom features. You can choose from Keybased, Oauth1, and Oauth2 for authentication mechanism of your custom application, Create own custom actions for your users to access and create triggers to initiate an associated workflow execution. For your customers however, it’ll be like just any other application that you enable for them.

To create a custom application, Go to Settings > Apps > Add App, and enter the name, slug and description of the application.

Authorization

You can select the authentication mechanism for your customers to authenticate the api calls made by your app to your server. Cobalt supports Keybased, Oauth1, and Oauth2 type authorization mechanism for end customers.

Key based auth

Key based auth types are pretty straight forward. You define the Label and Key Name and Placeholder of the auth input fields to be shown to the customers. The customer would have to enter the field values to connect with your application. Once connected, Cobalt sets the values against the respective Key Name provided for the field in the headers.

Note: Currently Cobalt only supports setting the Key based field values in the headers of the api calls.

Oauth1 based auth

Oauth1 based authentication mechanism in Cobalt takes client credentials from the end customer and make an api call using them. The api response provides the access token which then can be used for authenticating an api call made by your application.

Step 1: Define client credentials input fields to be taken from the users similar to the Keybased mechanism. Step 2: Configure the api call to be made using the credentials from the user to fetch the actual token, and a sample response. Step 3: Define where to set the fetched token while making the api call.

and done!

Oauth2 based auth

Like any Oauth2 auth mechanism, this type of authentication strategy requires two phases.

  1. Users are redirected to the app installation url using the applications client credentials, where they provide the login credentials
  2. The application makes a callback to a provided url with Code (If grant type for the mechanism selected is Authorization Code), using which the server fetches an access_token and a refresh_token to authenticate an api on behalf of the user.

Note: Cobalt only supports Authorization Code grant type based Oauth2 mechanism across its platform.

To set up an Oauth2 based Authorization mechanism,

Step 1: Enter Client Credentials

Step 2: Copy the Redirect URL and make sure your application redirects the Authorization Code to this URL.

Step 3: Mention the scopes if any and make sure they are enabled by your application too.

Step 4: Provide the installation URL, to which the user would be redirected to enter their login credentials.

Step 5: Provide the Token URL to which Cobalt would make an api call upon receiving the Authorization Code to fetch the access token, and a sample response.

Note: Cobalt only supports Bearer tokens for Oauth2 auth mechanism. This token is set for the Authorization field in the headers of the api calls made by the app.

"Authorization": "Bearer <access_token>"

Triggers

You can setup custom event triggers for your customers. Your customers can select from these event triggers while creating a workflow as start triggers. Whenever you fire these triggers (Event occurs in your application), all associated workflows will be executed.

To set a trigger, Click on New Trigger, enter the name of the Event and provide a sample response that you would send when that event would occur in your app,

Sample event model
{
  "customer_name": "Mark Wood",
  "age": 30,
  "associated_emails": ["mark@example.com", "wood.mark@sampleemail.com"],
  "is_new": true,
  "address": {
    "house_number": 24,
    "apartment": "Greenville Apartments",
    "street": "Swan lake st.",
    "city": "Bengaluru"
  }
}

The above properties can now be used as event variables in the associated workflow. Click on Create Trigger to save the Event Trigger.

To trigger this event, just make a POST api call to the provided Event URL with the newly created payload. It would look something like this:

Sample Trigger payload
{
  "event": "Customer Created",
  "payload": {
    "customer_name": "Mark Wood",
    "age": 30,
    "associated_emails": ["mark@example.com", "wood.mark@sampleemail.com"],
    "is_new": true,
    "address": {
        "house_number": 24,
        "apartment": "Greenville Apartments",
        "street": "Swan lake st.",
        "city": "Bengaluru"
    }
  }
}

Actions

These are your application actions for the users to select while creating a Workflow. These are generally the api calls to be made to your or a third party server. Setting up an action for your app is very similar to that of custom action. Refer this guide for more details.