Getting started with SugarCRM REST API using UltraStudio

Integrating with SugarCRM using UltraStudio

What is SugarCRM

What is UltraStudio

Use case scenario

  • accept SOAP requests
  • extract out required parameters from the request message
  • set those parameters to the SugarCRM request
  • send a message to SugarCRM with extracted data
  • handle the response from the SugarCRM
  • send back the response status to SMS Gateway as a SOAP message
Web service flow diagram

Implementation

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap.services.samples/">
<soapenv:Body>
<soap:registerUser>
<request>
<name>John Doe</name>
<email>john@org.com</email>
<description>John Doe is a SMS based registered user for bank transaction service</description>
<phoneNo>0094793874987</phoneNo>
</request>
</soap:registerUser>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap.services.samples/">
<soapenv:Body>
<soap:registerUser>
<response>
<status>Success</status>
<userId>registered-user-account-id</userId>
</response>
</soap:registerUser>
</soapenv:Body>
</soapenv:Envelope>
Integration flow of the implementation

HTTP Ingress Connector (1)

  • Port — 8280
  • Service Path — /service/user-registration

Logger Processing Element (2)

  • Log Template — Message received with payload : @{message.payload}
  • Log Level — INFO

XPath String Extractor (3)

  • Variable Name — sugar.account.name
  • XPath — //request/name

XPath String Extractor (4)

  • Variable Name — sugar.account.email
  • XPath — //request/email

XPath String Extractor (5)

  • Variable Name — sugar.account.phoneNo
  • XPath — //request/phoneNo

SugarCRM Egress Connector (6)

  • SugarCRM Server Base URL — https://<your-sugarcrm-account-base-url>/rest/v10
  • SugarCRM Username — sugar-crm-user
  • SugarCRM Password — sugar-crm-password

SugarCRM Accounts Operation (7)

  • Operation — CREATE — since we are going to create an account
  • Account Name — @{variable.sugar.account.name}
  • Account Type — Customer
  • Email Addresses — @{variable.sugar.account.email}
  • Description — @{variable.sugar.account.name} is a SMS based registered user for bank transaction service
  • Phone Number — @{variable.sugar.account.phoneNo}

JSON Path Extractor (8)

  • Variable Name — sugarcrm.account.id
  • JSON Path — id

String Payload Setter (9)

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap.services.samples/">
<soapenv:Body>
<soap:registerUser>
<response>
<status>Success</status>
<userId>@{variable.sugarcrm.account.id}</userId>
</response>
</soap:registerUser>
</soapenv:Body>
</soapenv:Envelope>

Run it…

Test it…

Handling Error Scenarios

Call To Action

  • Clap. Appreciate and let others find this article.
  • Comment. Share your views on this article.
  • Follow me. Manjula Piyumal to receive updates on articles like this.
  • Keep in touch. LinkedIn, Twitter

--

--

--

Software Engineer who loves to work on integration space. I speak Java, Scala, Javascript, English and Sinhala

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

MOBILE CLOUD COMPUTING

Of umbrellas, transducers, reactive streams & mushrooms (Pt. 3)

Nobody wants to be woken up at 4 am

CS373 Spring 2022: Abinith Thallam Week 2

Angular CI/CD using Azure DevOps Pipeline ➫

Deploying Models using Azure Functions… A tutorial

#100DaysofCode Chapter 1 ~ HTML and CSS Basics

Interview with 2018 EMPEX LA Speaker Todd Resudek

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Manjula Piyumal

Manjula Piyumal

Software Engineer who loves to work on integration space. I speak Java, Scala, Javascript, English and Sinhala

More from Medium

Getting list of Git files owned by a specific owner based on the CODEOWNERS file

Git — A Version Control System

Zwannah API Structure Specification (Actors-Supporters Arrangement)