K2 REST cloud service broker integration with Muhimbi Converter Service Online

As a SharePoint Consultant, I have been using K2’s workflows to automate day to day business requirements.

In my recent project, we had a requirement to Convert documents to PDF, Watermark documents using a K2 cloud workflow.

When it comes to Converting documents to PDF, I trust only the BEST ⭐”Muhimbi Converter for SharePoint Online/Converter Service Online.”

The on-premise version of the PDF Converter for SharePoint has supported K2. But for the online versions of K2 which does not support third party workflow actions, it’s a heartbreak..

The workaround would be to create a SharePoint Online workflow using SharePoint Designer and trigger that workflow from K2.

The above work around is OK, but wouldn’t it be great if we could use Muhimbi Actions as smart objects within the K2 workflow? Yes we can.. 🙂

In this BLOG we will integrate the Muhimbi Converter Service Online (REST-API), with K2 cloud (K2 REST service broker).


Before we begin:

Make sure the following prerequisites are in place.

The article has lots of images, which will help you in configuration, you can click on the images to open them in full screen.


A high level overview for K2 REST integration with Muhimbi Converter Service online comprises of the following components:

  • Descriptor File: The REST API uses a Swagger based API definition file to describe the available services. Use the swagger file published at: https://api.muhimbi.com/swagger/v1/k2
  • OAuth Resource: The OAuth resource in the Service Instance Authentication Mode settings is used to connect the REST endpoint. You need to provide Client ID, Client Secret etc.
  • Service Instance: The Service Instance of the REST Endpoint Broker which uses the descriptor file to connect a particular REST endpoint and uses the OAuth resource for authentication, in this step you will use the login for Muhimbi Converter Service Online.
  • SmartObjects: Once you have setup the Service Instance you can generate Muhimbi SmartObjects that can then be used in SmartForms, workflows or any other component that is able to interact with SmartObjects.

Note: The Integration of the K2 Cloud with Converter Service Online is relatively straight forward as long as these instructions are followed very carefully, let’s begin with the Integration process.


Step 1: Creating OAuth resource

  • Navigate to K2 Management portal.
  • Expand the Authentication Section >  OAuth >  Resource Types > Add a (+ New) Resource type ‘Muhimbi Converter Service Online(Production)‘.

Step1.png


Step 2: Adding Resource Type Parameters

With the ‘Muhimbi Converter Service Online(Production)‘ > Resource Type selected  > add the parameters with reference to the screenshot below.

Step2


Step 3: Creating an OAuth Resource

Create a new OAuth Resource with reference to the screenshot:

Step3.png


Step 4: Configuring Resource Parameters

With the ‘Muhimbi (Prod)’ Resource selected > add the parameters > with reference to the screenshot below.

Step4.png

Resource Parameters:

ClientID

  • client_id: 9D3E2BA4-56D7-41C1-98A9-3BFE9D043542
  • client_secret:  q0kzw5kb2jqdqoncnn0yxj0ehjlzg0kodiwmdenciulru9gdqo=
  • redirect_uri: https://<yourK2servername>.onk2.com/Identity/authorize/oauth/2

Token Replacement Values:

expires_in

999999999 seconds is equal to 30 years.


Step 5: Configuring Service Instance

Now that we have configured the OAuth, it’s time to Configure the Service Instance.

  • Navigate to the K2 Management portal.
  • Expand the Integration Section > Configure Service Instance > Under service Instance click on (+ Add).
  • The Descriptor Location file at: https://api.muhimbi.com/swagger/v1/k2

Configure Service Instance with reference to the screenshot below and Click OK.

Step5

Redirecting for Authorization

  • When you Click OK on the Configure the Service Instance.
  • The Page will Redirect for Authorization.

Step6

You need to add your Muhimbi credentials.

Muhimbilogin.png

On Successful Authorization, you will see the screen below

successfull

Congrats 😎 you have successfully created your Muhimbi Converter Service Online Instance.

Step 6: Verify a successful Authorization 

Navigate to K2 Management portal > Authentication > OAuth > Tokens.

token

In the Next blog we will ‘Create K2 Smart Objects for Muhimbi Converter Service Online‘….

Posted in K2

2 thoughts on “K2 REST cloud service broker integration with Muhimbi Converter Service Online

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s