DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Join us today at 1 PM EST: "3-Step Approach to Comprehensive Runtime Application Security"
Save your seat
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. SugarCRM Web Services API: Integrate Your Application With SugarCRM

SugarCRM Web Services API: Integrate Your Application With SugarCRM

Let's take a look at this brief article that explores SugarCRM web services and how to integrate your application with SugarCRM.

Shailesh Chaudhary user avatar by
Shailesh Chaudhary
·
Sep. 04, 18 · Tutorial
Like (2)
Save
Tweet
Share
9.38K Views

Join the DZone community and get the full member experience.

Join For Free

As of 7.x, SOAP support is no longer offered with the new APIs. The legacy APIs are still accessible in the product, however, any existing integrations should be updated to use the latest REST endpoints of SugarCRM data migration. Web Services allow for communication between different applications and platforms. Sugar currently supports REST and SOAP APIs. The following sections will outline how to interact with the APIs and what versions of the API we recommend for use.

API versioning is the process of creating a new set of API endpoints for new functionality while leaving preexisting endpoints available for third-party applications and integrations to continue using. This helps to extend the application in an upgrade-safe manner.

When working with the Web Service API, you should be using the latest API specific to your release. A quick reference of this can be found below:

Release REST Version REST URL SOAP Version SOAP URL
7.9.x v10 /rest/v10/ v4.1 /service/v4_1/soap.php
7.8.x v10 /rest/v10/ v4.1 /service/v4_1/soap.php
7.7.x v10 /rest/v10/ v4.1 /service/v4_1/soap.php
6.5.x v4.1 /service/v4_1/rest.php v4.1

/service/v4_1/soap.php

Best Practices When Integrating and Migrating Sugar

REST stands for "Representational State Transfer." As of 7.x, REST is a core component of Sugar that defines how all information is exchanged within the application. This v10 API is separate from the v2-v4_1 REST APIs in that it has been rebuilt with the latest REST standards. Most functionality in the system, whether fetching or posting data, is interacting with the API in some way.

How to Access the v10 REST Service

The base endpoint for the v10 REST service can be found at:

http://<site_url>/rest/v10/

For your reference, all v10 endpoints can be found by navigating to http://<site_url>/rest/v10/help. Once you have identified your instance's base endpoint, we can begin by authenticating.

Authentication

Sugar 7 uses two-legged OAuth2 for authentication. You simply need to do a POST to /rest/v10/oauth2/token with the following parameters:

grant_type String Type of request. Available grant types are "password" and "refresh_token".
client_id String The client_id of "sugar" will automatically create an OAuth Key in the system and can be used for "password" authentication. The client_id of "support_portal" will create an OAuth Key if the portal system is enabled and will allow for portal authentication. Other client_id's can be created by the administrator in the OAuthKeys section in the Administration section and can be used in the future for additional grant types, if the client secret is filled in, it will be checked to validate use of the client id.
client_secret String The client's secret key.
username String The username of the user authenticating to the system.
password String The plaintext password the user authenticating to the system.
platform String Defaults to "base" allows you to have custom meta-data per platform. This parameter should be an identifiable string. Do not use random GUIDS or changing variables. Doing so may result in large ./cache directories.

First, we are going to login using a grant_type of "password" and a platform of "custom." Normally, when logging into Sugar, users log in with a platform type of "base". We are using "custom" to avoid any potential login conflicts.

curl -X POST -H Cache-Control:no-cache -d '{ 
    "grant_type":"password", 
    "client_id":"sugar", 
    "client_secret":"", 
    "username":"<username>", 
    "password":"<password>", 
    "platform":"custom" 
}' http:/<site_url>/rest/v10/oauth2/token

The SugarCRM integration allows you to create customer contacts, leads, or opportunities from ongoing or archived chats and save them in your SugarCRM. This API is not just an add-on integrating functions in sugar; it helps to empower your organization's goals.

API application Web Service Integration REST Web Protocols Strings Data Types authentication SOAP

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Data Mesh vs. Data Fabric: A Tale of Two New Data Paradigms
  • Simulate Network Latency and Packet Drop In Linux
  • Playwright vs. Cypress: The King Is Dead, Long Live the King?
  • When AI Strengthens Good Old Chatbots: A Brief History of Conversational AI

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: