Overview
A client-mode connector for the SugarCRM REST API (Sugar Sell, Sugar Serve and Sugar Enterprise, SugarCloud or on-premise) that connects plant and product events to CRM records. A connected machine that raises an alarm can open a Case on the customer’s Account, the team can add notes while it is handled, and the Case can be closed when the alarm clears. Records can be upserted by an external id kept in thesync_key field (an asset serial, for example), Accounts can be kept current from live data, and any module can be listed, filtered, counted and searched.
Most events take the module name from the payload (Cases, Accounts, Contacts, Bugs, custom modules), so one connector covers the whole instance. Topics use crm/sugarcrm/<object>/<verb>; each response is published on <source topic>/response.
The template was checked against the Sugar 25.2 REST API endpoint reference (each packaged endpoint is still published in the 26.1 reference) and a local mock of a Sugar instance. Sugar is hosted per customer, so there is no shared public host to probe. It has not been run against a real Sugar instance yet, so status stays blocked until an authenticated smoke passes.
Setup
- Set
BASE_ADDRESSin the connector to your instance URL, for examplehttps://acme.sugarondemand.com. Endpoints carry/rest/v11_24, the version the 25.2 reference covers. Newer releases keep serving older versions (26.1 goes up tov11_27), so change the prefix only if you need a newer endpoint. - Create a dedicated integration user. The
sync_keyevents (RecordGetBySyncKey,RecordUpsertBySyncKey) need an admin user. - In Admin > Configure API Platforms, add a platform name for the broker (for example
coreflux). Logging in with the defaultbaseplatform can sign the same user out of the web client.
Authentication
Sugar uses two-legged OAuth 2.0 with a password grant (see REST API authentication):-
Publish to
crm/sugarcrm/oauth/token(eventTokenGet): -
Read
access_token(valid 3600 seconds) andrefresh_token(valid 14 days) fromcrm/sugarcrm/oauth/token/response. Passaccess_tokenin every other payload; the connector sends it in theOAuth-Tokenheader. -
When a call answers 401, publish
{"body": {"grant_type": "refresh_token", "refresh_token": "<refresh token>", "client_id": "sugar", "client_secret": "", "platform": "coreflux"}}tocrm/sugarcrm/oauth/refreshfor a new pair. Keep only the refresh token, never the password, in long-term storage.
Payload fields
Events
No DELETE events are packaged on purpose.
TokenGet, TokenRefresh and Logout are POSTs but only handle the session; RecordsFilter, RecordsCount, CasesFilter and DuplicateCheck are POSTs that only read.
Connector excerpt
The full connector is inSugarcrmRestApi.lot. The first events look like this:
Examples
- Case from an alarm
- Note and close
- Open cases for an account
- Upsert by asset id
Find the customer’s Account with The response is the created Case, including its
crm/sugarcrm/accounts/filter ("query": "filter%5B0%5D%5Bname%5D%5B%24starts%5D=ACME&fields=id,name"), then publish to crm/sugarcrm/cases/create:id.Receiving changes from Sugar
Sugar pushes record changes out with Web Logic Hooks (Admin > Web Logic Hooks): pick a module, a trigger event (for example after save) and a URL, and Sugar sends the record as JSON. Deliveries are queued and sent by the “Dispatch Web Logic Hook” scheduled job, so they arrive on the next cron run, not instantly. Point the hook at a separate server-mode REST_API connector that enablesENABLE_SERVER; Sugar does not sign deliveries, so restrict that endpoint (network or a secret path).

