Introduction
SugarCRM is used to automates sales, marketing, and customer service processes to help businesses improve customer relationships.
This guide explains how to setup SugarCRM for use with Cyclr, as well as how to install a SugarCRM Connector.
SugarCRM’s own documentation for authenticating with their API using OAuth can be found here under “Authentication”.
Remote Setup within SugarCRM
In order to avoid login conflicts as explained by SugarCRM, a custom “platform” name should be setup within the SugarCRM portal. It is recommended to provide it with a name that describes and identifies how it will be used.
Registering a SugarCRM “Platform” Value
- As an admin in a SugarCRM instance, go to the Administration panel.
- Select “Configure API Platforms”.
- Enter a value to identify the new platform and select Add and then Save.
That Platform value is then provided when authenticating a SugarCRM Connector within Cyclr.
Cyclr Connector Installation
When installing a SugarCRM Connector, the following values are used:
| Property | Description |
|---|---|
| Client ID | Value should always be set to “sugar”. |
| Client Secret | Leave blank to let SugarCRM generate an OAuth Key automatically. |
| Username | The username of the resource owner (user) to connect as. |
| Password | The password of the resource owner (user). |
| SugarCRM Domain | The domain of the SugarCRM instance to connect to. For example, if the URL of the SugarCRM instance is “https://myaccount.sugarcrm.eu/”, you would enter “ myaccount.sugarcrm.eu” as the domain. |
| API Version | The SugarCRM API version to use entered in the format:v{{MajorVersion}}_{{MinorVersion}}}.For example, v11_4.Defaults to v11_4 if not set. |
| Platform | See above for details on setting a custom Platform value. This is done to prevent login conflicts. Defaults to “ base” if not set. |
Authentication using Cyclr’s API
SugarCRM uses OAuth 2 Password Credentials.
If installing a SugarCRM Connector using Cyclr’s API, your user won’t be automatically directed to the SugarCRM sign-in screen.
Instead, you must manually set the following 3 Account Connector Properties using Cyclr API calls:
- Domain
- Username
- Password
First set the SugarCRM Domain on an Account Connector:
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-d '{
"Name": "Domain",
"Value": "myaccount.sugarcrm.eu"
}'
'https://{CyclrAPIDomain}/v1.0/account/connectors/ACCOUNT_CONNECTOR_ID/properties'
The SugarCRM Domain should be in the format “myaccount.sugarcrm.eu” without “https://” or a final forward slash.
Platform should be the custom platform value you set earlier.
Set up SugarCRM Username and Password as account connector properties:
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-d '{
"Name": "Username",
"Value": "myuser"
}'
'https://{CyclrAPIDomain}/v1.0/account/connectors/ACCOUNT_CONNECTOR_ID/properties'
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-d '{
"Name": "Password",
"Value": "mypassword"
}'
'https://{CyclrAPIDomain}/v1.0/account/connectors/ACCOUNT_CONNECTOR_ID/properties'
Same as the OAuth Redirect flow, call /UpdateAccountConnectorOAuth with a one-time token. If the Domain, Username and Password are all correctly set up, your end-user will simply be redirected back to your application.
Applying Filters to Connector Methods
The following Connector Methods support the use of additional filters to refine your request:
- Get New And Updated Opportunities
- Search Opportunities
- Search Custom Objects
To apply an additional filter, you can add a custom field to the request with a **Field Location** in the format: field.operator, for example, campaign_name.$contains. You can then supply a value for that field when you make your requests, such as Leads.
The supported filter operators are as follows:
| Operator | Description |
|---|---|
| $equals | Performs an exact match on that field. |
| $not_equals | Matches on non-matching values. |
| $starts | Matches on anything that starts with the value. |
| $ends | Matches anything that ends with the value. |
| $contains | Matches anything that contains the value. |
| $in | Finds anything where field matches one of the values as specified as an array. |
| $not_in | Finds anything where field does not match any of the values as specified as an array. |
| $is_null | Checks if the field is null. This operation does not need a value specified. |
| $not_null | Checks if the field is not null. This operation does not need a value specified. |
| $lt | Matches when the field is less than the value. |
| $lte | Matches when the field is less than or equal to the value. |
| $gt | Matches when the field is greater than the value. |
| $gte | Matches when the field is greater than or equal to the value. |
For more information, see the Cyclr documentation on how to add custom fields.