SugarCRM
Datafly Signal delivers identified-user events to SugarCRM server-to-server using the Sugar REST API. When a visitor identifies themselves (form submission, sign-up, gated download), Signal creates a record in your chosen Sugar module — typically Leads — with the user’s traits, the lead source, and a marketing opt-out flag derived from consent.
Prerequisites
Before configuring SugarCRM in Signal you need a Sugar instance (SugarCloud or on-site), a dedicated API user, and an OAuth client key.
Step 1: Note Your Instance URL
Your instance URL is the base address of your Sugar deployment, with no trailing slash:
- SugarCloud:
https://<yourcompany>.sugarondemand.com - On-site: your Sugar server URL (e.g.
https://crm.example.com)
All REST API calls are made under <instance_url>/rest/<version>/.
Step 2: Create a Dedicated API User
- In Sugar, go to Admin > User Management > Create New User.
- Create a regular user (e.g.
signal-integration) with a strong password. - Grant it a role with create and edit access to the module(s) you will write to (Leads and/or Contacts).
Use a dedicated service user rather than an admin’s interactive login. This keeps API activity auditable and avoids session conflicts.
Step 3: Confirm an OAuth Client Key
Sugar’s REST API authenticates with OAuth2. Most instances have a default client with client_id = sugar and an empty secret. To use a dedicated key:
- Go to Admin > OAuth Keys > Create OAuth Key.
- Set a Consumer Key (this is your
client_id) and optionally a Consumer Secret. - Set OAuth Version to OAuth 2.0.
Step 4: Choose a Platform Name
The OAuth token request requires a platform value. It must not be base, mobile, or portal — using those can log out interactive sessions. Pick a unique name such as datafly_signal.
Configure in Signal
Configuration Fields
| Field | Required | Description |
|---|---|---|
instance_url | Yes | Base URL of your Sugar instance, e.g. https://yourcompany.sugarondemand.com. |
api_version | Yes | REST API version path segment, e.g. v11_24. v11 works as a stable alias. |
client_id | Yes | OAuth2 consumer key (often sugar). |
client_secret | No | OAuth2 consumer secret. Often blank for the default client. |
username | Yes | Username of the dedicated API user. |
password | Yes | Password for the API user. |
platform | Yes | Custom platform name (not base/mobile/portal), e.g. datafly_signal. |
module | Yes | Default Sugar module to create records in, e.g. Leads. |
Management UI Setup
Add the integration
Go to Integrations > Add Integration > SugarCRM and choose the Lead Capture preset.
Enter your credentials
Fill in instance_url, api_version, client_id, client_secret (if any), username, password, platform, and the default module.
Select consent categories
Choose the consent category that should gate marketing (typically marketing). Signal uses this to set the Sugar email opt-out flag.
Save
Click Save. Signal mints an OAuth token on the first delivery and caches it until it expires.
API Endpoint
Signal authenticates with the OAuth2 password grant, then creates records with the standard Sugar “create a record” resource.
Token request:
POST {instance_url}/rest/{api_version}/oauth2/token
Content-Type: application/json
{
"grant_type": "password",
"client_id": "sugar",
"client_secret": "",
"username": "signal-integration",
"password": "••••••••",
"platform": "datafly_signal"
}The response carries an access_token (default lifetime 3600s), token_type of bearer, and a refresh_token. Signal sends the token on every create as a standard bearer header (Authorization: Bearer <access_token>), supported by the Sugar REST API since the Fall ‘18 release.
Create request:
POST {instance_url}/rest/{api_version}/{module}
Authorization: Bearer {access_token}
Content-Type: application/jsonIdentity Signals
SugarCRM is a system of record, not an advertising platform, so Signal sends identity traits in plain text (not hashed) — they are written directly into Sugar fields you will read in the CRM UI.
| Signal trait | Sugar field | Notes |
|---|---|---|
last_name | last_name | Required by the Leads/Contacts modules. |
first_name | first_name | |
email | email[].email_address | Delivered in Sugar’s email link-field array, lowercased and trimmed, with primary_address set to 1. |
phone | phone_mobile | |
title | title | Job title. |
company | account_name | Company / account name. |
website | website |
Consent → Opt-Out
Sugar’s email array carries an opt_out flag. Signal maps your canonical marketing consent to it:
| Marketing consent | email[].opt_out |
|---|---|
true (granted) | 0 |
false / absent | 1 |
This keeps SugarCRM aligned with the visitor’s stated marketing preference at the moment the record is created. Records written without marketing consent are flagged opt-out so your marketing tools exclude them.
How to Send User Data
Call datafly.identify() when a user submits a form, registers, or logs in, then track the conversion:
datafly.identify("user-123", {
first_name: "Jane",
last_name: "Doe",
email: "jane.doe@example.com",
phone: "+44 7700 900123",
title: "Head of Marketing",
company: "Acme Ltd",
website: "https://acme.example.com"
});Event Mapping
Lead Capture preset
| Signal event | Sugar action |
|---|---|
Lead Generated | Create a record in the configured module (default Leads) |
Signed Up | Create a record in the configured module (default Leads) |
Identity traits map globally on every delivered event; the per-event mappings add lead_source, description, and campaign attribution.
Example: Lead Generated
Datafly.js call:
datafly.identify("user-123", {
first_name: "Jane",
last_name: "Doe",
email: "jane.doe@example.com",
phone: "+44 7700 900123",
company: "Acme Ltd",
title: "Head of Marketing"
});
datafly.track("Lead Generated", {
lead_source: "Web Site",
description: "Requested a demo via the pricing page"
});SugarCRM payload sent by Signal (POST /rest/v11_24/Leads):
{
"first_name": "Jane",
"last_name": "Doe",
"phone_mobile": "+44 7700 900123",
"title": "Head of Marketing",
"account_name": "Acme Ltd",
"lead_source": "Web Site",
"description": "Requested a demo via the pricing page",
"email": [
{
"email_address": "jane.doe@example.com",
"primary_address": "1",
"opt_out": "0"
}
]
}A successful create returns HTTP 200 with the new record, including its generated id.
The email array is Sugar’s modern link-field shape. The legacy email1 scalar field is deprecated and may be removed in a future Sugar release, so this blueprint uses the array form.
Testing
Send a test event
Trigger a Lead Generated event from your site (or the Event Debugger) with an identified user.
Check the Sugar module
In SugarCRM, open the Leads list view. The new record should appear within seconds, with name, email, phone, and lead source populated.
Verify the opt-out flag
Open the record and confirm the email’s Opted Out state matches the visitor’s marketing consent.
Troubleshooting
| Problem | Solution |
|---|---|
401 invalid_grant on the token request | Check username, password, client_id, and client_secret. Confirm the OAuth key is OAuth 2.0 and the user is active. |
| Sessions getting logged out | Your platform is set to base, mobile, or portal. Change it to a unique value like datafly_signal. |
403 on create | The API user’s role lacks create/edit permission on the module. Grant module access in Admin > Role Management. |
400 validation error | A required field is missing (Leads require last_name) or a field name does not exist on your module. Check Studio for custom field names. |
404 not found | Wrong instance_url, unknown module, or an unsupported api_version. Confirm the version your Sugar release supports. |
| Email not saved | Ensure the email is sent in the array shape (email[].email_address); the legacy email1 field is deprecated. |