Sugar Market

Sugar Market

Sugar Market is available in the Marketing hub.

Element Information Details
Provider API Documentation Sugar Market API documentation
Authentication Basic
Events Polling
Bulk Supported
Virtual Data Resources and Transformations Supported

Sugar Market Element

Authentication Prerequisites

The Sugar Market element uses the Basic authentication workflow. Before you can authenticate an instance of the Sugar Market element, you would primarily require the API Username and Password, for which you will need to contact the Sugar Market team. For more details on the same, read about Authentication in Sugar Market API Documentation.

Provider sandbox

A Sugar Market account and sandbox are required. Only 'Administrator' accounts can generate the credentials required to authenticate with the element. 

There are default values provided by Sugar for API username and password. The only parameters required by the user are:

  • Sugar Market Site URL 
  • Username 
  • Password

Required Authentication Parameters

You can authenticate an element instance using the UI or via API calls. For detailed information on how to authenticate an instance, see our related documentation:

To authenticate an instance of the Sugar Market element, you will need the following parameters:

Parameter Name/UI ValueAPI Value/KeyDescriptionSource
Site URLsite.urlThe unique URL established for your Sugar Market site.This is the same URL that you use to sign in to your Sugar Market platform. Contact your Sugar admin for assistance.
UsernameusernameThe username you use to sign in to your Sugar Market site.Contact your Sugar admin for assistance.
PasswordpasswordThe password you use to sign in to your Sugar Market site.Contact your Sugar admin for assistance.

Sample Configuration JSON

"configuration": {
    "site.url": "http://my-sugar-market-url.com",
    "username": "MyUsername",
    "password": "MyPassw0rd"
  }

Optional Authentication Parameters

Parameter NameAPI ValueDescription
Default select fieldsdefault.select.fields.mapGeneric map used to specify default fields for bulk download and GET /all requests. Each key should be the canonical objectName and values may be specified as a comma-delimited string or a list of strings.
Instance Variablesinstance.variablesStates what the instance variables are.
Synchronous Bulk Notificationsynchronous.bulk.notificationEnables synchronous bulk callback notification.
Filter Null Values from Responsefilter.response.nullsUsed to enable/disable filtering of null values from the responses

Element Fact Sheet and Reference

Authentication and Configuration Parameters

To see all authentication parameters for the Sugar Market element, follow these steps:

  1. Sign in to Cloud Elements and navigate to Elements.
  2. Hover over the card for an element, and then click My Resources. 
  3. In the top navigation toolbar, click Setup.
  4. From the Setup page, you can view a complete list of the element's authentication and configuration parameters.

Element Resources

In order to provide users with normalized APIs across Hubs, Cloud Elements resources were mapped to the following Vendor resources.

Platform PlaceholderPlatform MethodCE ResourceVendor MethodVendor ResourceDescription
AccountsGET/accountsGET/accountsList accounts
GET/{id}/accounts/{id}GET/{id}/accounts/{PK}Retrieve an account
POST /accountsPOST/accountsCreate an account
PATCH/accounts/{id}PATCH/accounts/{PK}Update an account
DELETE/accounts/{id}DELETE/accounts/{PK}Delete an account
AlertsGET/alertsGET/alertsList alerts for user
GET/{id}/alerts/{id}GET/{id}/alerts/{PK}Retrieve an alert
CampaignsGET /email-campaignsGET/campaigns/emailList email campaigns
GET/{id}/email-campaigns{id}GET/{id}/campaigns/email/{id}Retrieve an email campaign
POST /email-campaignsPOST /campaigns/emailCreate an email campaign
PATCH /email-campaigns{id}PATCH/campaigns/email/{id}Update an email campaign
DELETE/email-campaigns{id}DELETE/campaigns/email/{id}Delete an email campaign 
Campaign ListsGET/email-campaigns/{id}/{action}GETcampaigns/email/{PK}/lists/
POST/email-campaigns/{id}/{action}POST/campaigns/email/{PK}/lists/
POST/email-campaigns/{id}/{action}PUT/campaigns/email/{PK}/lists/?archive=0
Campaigns Schedule POST/email-campaigns/{id}/{action}POST/campaigns/email/{PK}/schedule/
POST/email-campaigns/{id}/{action}POST/campaigns/email/{PK}/send/
POST/email-campaigns/{id}/{action}POST/campaigns/email/{PK}/recall/
Campaign StatisticsGET/email-campaigns/{id}/{action}GET/campaigns/email/{PK}/statistics/
GET/email-campaigns/{id}/{action}GET/campaigns/email/{PK}/recipients/
GET/email-campaigns/{id}/{action}GET/campaigns/email/{PK}/clicks/
GET/email-campaigns/{id}/{action}GET/campaigns/email/{PK}/opens/
GET/email-campaigns/{id}/{action}GET/campaigns/emails/{PK}/unsubscribes/
GET/email-campaigns/{id}/{action}GET/campaigns/email/{PK}/bounces/
GET/email-campaigns/{id}/{action}GET/campaigns/email/{PK}/schema/
Campaigns-SchemaGET/email-campaigns-schemaGET/campaigns/email/schema/
ContactsGET/contactsGET/contacts
GET/{id}/contacts/{id}GET/{id}/contacts/{PK}
POST/contactsPOST/contacts
PATCH/contacts/{id}PATCH/contacts/{PK}
DELETE/contacts/{id}DELETE/contacts/{PK}
OpportunitiesGET/opportunitiesGET/opportunities
GET/{id}/opportunities/{id}GET/{id}/opportunities/{PK}
POST/opportunitiesPOST/opportunities
PATCH/opportunities/{id}PATCH/opportunities/{PK}
DELETE/opportunities/{id}DELETE/opportunities/{PK}
Distribution ListsGET/distribution-listsGET/lists/distribution/
POST/distribution-listsPOST/lists/distribution/
GET/ {id}/distribution-lists/{id}GET/{id}lists/distribution/{PK}/
PATCH/distribution-lists/{id}PATCHlists/distribution/{PK}/
DELETE/distribution-lists/{id}DELETElists/distribution/{PK}/
GET/distribution-lists/{id}/contactsGET/lists/distribution/{PK}/contacts/
POST/distribution-lists/{id}/contactsPOST/lists/distribution/{PK}/contacts/
GET/ {id}/distribution-lists/{id}/contacts/{id}GET/{id}lists/distribution/{PK}/contacts/{contact_id}
DELETE/distribution-lists/{id}/contacts/{id}DELETElists/distribution/{PK}/contacts/{contact_id}
UsersGET/usersGET/users
GET/ {id}/users/{id}GET/{id}/users
/{PK}

POST/usersPOST/users
PATCH/users/{id}PATCH/users/{PK}
DELETE/users/{id}DELETE/users/{PK}
Legacy landing pagesGET/legacy-pagesGET/landing_pages/legacy/
GET/ {id}/legacy-pages/{id}GET/{id}/landing_pages/legacy/{PK}/
TasksGET/tasksGET/tasks
GET/ {id}/tasks/{id}GET/{id}/tasks/{PK}
POST/tasksPOST/tasks
PATCH/tasks/{id}PATCH/tasks/{PK}
DELETE/tasks/{id}DELETE/tasks/{PK}
Campaign NurturesGET/campaign-nurturesGET/campaigns/nurtures/
GET /{id}/campaign-nurtures/{id}GET/campaigns/nurtures/{PK}/
GET /{id}/campaign-nurtures/{id}/contactsGET/campaigns/nurtures/{PK}/contacts/
Campaign Nurtures SchemaGET/campaign-nurture-schemasGET/campaigns/nurtures/schema/
Campaign Nurtures StepsGET/campaign-nurture-stepsGET/campaigns/nurtures/steps/
GET/ {id}/campaign-nurture-steps/{id}GET/{id}/campaigns/nurtures/steps/{PK}/
GET /{id}/campaign-nurture-steps/{id}/schemaGET/{id}/campaigns/nurtures/steps/{PK}/schema/
EventsGET/eventsGET/events
GET /{id}/events/{id}GET/{id}/events/{pk}
GET /{id}/events/{id}/sessionsGET/{id}/events/{pk}/sessions/
GET/events/{id}/sessions/{id}GET/{id}/events/{pk}/sessions/{pk}
GET/events/{id}/sessions/{id}/attendeesGET/events/{event_id}/sessions/session_id/attendees/
GET/events/{id}/sessions/{id}GET/events/{event_id}/sessions/{pk}/
GET/events/{id}/session-schemaGET/events/{event_id}/sessions/schema/
Event-attendeesGET/events-attendeesGET/events/attendees/
GET/ {id}/events-attendees/{id}GET/{id}/events/attendees/{pk}/
PUT/events-attendees/{id}PUT/{id}/events/attendees/{pk}/
DELETE/events-attendees/{id}DEL/{id}/events/attendees/{pk}/
GET/ {id}/events-attendees/{id}/schemaGET/{id}/events/attendees/{pk}/schema/
Event-schemaGET/events-schemasGET/events/schema
Event-attendee-schemaGET/events-attendees-schemasGET/events/attendees/schema
ListenersGET/listener-historiesGET/listener/history/
Landing PagesGET/landing-pagesGET/landing_pages/
GET /{id}/landing-pages/{id}GET/{id}/landing_pages/{pk}/
POST/landing-pagesPOST/landing_pages/
PATCH/landing-pages/{id}PATCH/landing_pages/{pk}/
DELETE/landing-pages/{id}DELETE/landing_pages/{pk}/
FormsGET/formsGET/forms
GET /{id}/forms/{id}GET/{id}/forms/{pk}/
POST/formsPOST/forms
PATCH/forms/{id}PATCH/forms/{pk}/
DELETE/forms/{id}DELETE/forms/{pk}/
Web Activities GET/activitiesGET/webactivity/
GET/ {id}/activities/{id}GET/{id}/webactivity/{pk}/

Streamlining Patterns in some Resources

Sugar Market API has patterns across some of its resources, that is, the resources shown in the table below follow the pattern of /campaigns/email/{PK}/{action} where PK is the primary key or object id of the object.
In our implementation we built the same where action is a parameter. So, we have GET and POST on /campaigns/email/{PK}/{action} to support all the actions as stated below. (actions=lists,schedule,recall and so on...)

GET/campaigns/email/{PK}/lists/
POST/campaigns/email/{PK}/lists/
PUT/campaigns/email/{PK}/lists/?archive=0
POST/campaigns/email/{PK}/schedule/
POST/campaigns/email/{PK}/send/
POST/campaigns/email/{PK}/recall/
GET/campaigns/email/{PK}/statistics/
GET/campaigns/email/{PK}/recipients/
GET/campaigns/email/{PK}/clicks/
GET/campaigns/email/{PK}/opens/
GET/campaigns/emails/{PK}/unsubscribes/
GET/campaigns/email/{PK}/bounces/
GET/campaigns/email/{PK}/schema/
GET/campaigns/email/schema/

Events and Supported Resources

The Sugar Market element supports events via polling. For detailed information about our Events framework and how to configure an element instance with events, see our documentation:

You can set up polling events for the following resources of the Sugar Market element:

  • accounts
  • contacts
  • legacyPages
  • events

Example data for an event created for Sugar Market element

{
  "id": "Af39j449iEFidDeh1ua6",
  "status": "NOTIFIED",
  "timestamp": "Tue Nov 17 2020 06:55:22 pm",
  "accountId": 16271,
  "element": "sugarmarket",
  "elementInstance": "879101",
  "error": "",
  "providerData": {
    "accounts": [
      {
        "account": "https://developer.salesfusion.com/api/2.0/accounts/388/",
        "account_id": 388,
        "account_name": "Kamba",
        "billing_city": "Cupertino",
        "contacts": "https://developer.salesfusion.com/api/2.0/accounts/388/contacts/",
        "created_by": "https://developer.salesfusion.com/api/2.0/users/4/",
        "created_by_id": 4,
        "created_date": "2020-11-17T18:55:00Z",
        "eventType": "CREATED",
        "key_account": false,
        "objectId": "388",
        "owner": "https://developer.salesfusion.com/api/2.0/users/1/",
        "owner_id": 1,
        "phone": "",
        "updated_by": "https://developer.salesfusion.com/api/2.0/users/4/",
        "updated_by_id": 4,
        "updated_date": "2020-11-17T18:55:00Z"
      }
    ],
    "instance_id": 879101,
    "objectType": "accounts",
    "pollDate": 1605639297882
  },
  "eventElementInstances": [
    {
      "eventId": "AXXXj7pFlliXZYNYlua6",
      "elementInstanceId": 879101,
      "userId": 18375,
      "accountId": 16271,
      "notificationId": 149215795,
      "notifiedData": {
        "accountId": 16271,
        "companyId": 6812,
        "elementKey": "sugarmarket",
        "eventId": "AXXXj7pFlliXZYNYlua6",
        "events": [
          {
            "objectType": "accounts",
            "objectId": "388",
            "pollDate": "2020-11-17T18:54:57Z",
            "eventType": "CREATED",
            "elementKey": "sugarmarket",
            "hubKey": "marketing"
          }
        ],
        "instanceId": 879101,
        "instanceName": "Demo",
        "instanceTags": [
          "Demo"
        ],
        "instance_id": 879101,
        "raw": {
          "accounts": [
            {
              "account": "https://developer.salesfusion.com/api/2.0/accounts/388/",
              "account_id": 388,
              "account_name": "Kamba",
              "billing_city": "Cupertino",
              "contacts": "https://developer.salesfusion.com/api/2.0/accounts/388/contacts/",
              "created_by": "https://developer.salesfusion.com/api/2.0/users/4/",
              "created_by_id": 4,
              "created_date": "2020-11-17T18:55:00Z",
              "key_account": false,
              "owner": "https://developer.salesfusion.com/api/2.0/users/1/",
              "owner_id": 1,
              "phone": "",
              "updated_by": "https://developer.salesfusion.com/api/2.0/users/4/",
              "updated_by_id": 4,
              "updated_date": "2020-11-17T18:55:00Z"
            }
          ],
          "eventHeaders": {
            "Raw-Element-Key": "sugarmarket",
            "encodedid": "ODc5MTAx",
            "id": "879101"
          },
          "objectType": "accounts",
          "pollDate": 1605639297882
        },
        "userId": 18375
      },
      "createdDate": "2020-11-17T18:55:22Z",
      "updatedDate": "2020-11-17T18:55:22Z",
      "objectIds": [
        {
          "value": "388"
        }
      ]
    }
  ]
  }


Bulk

Bulk provides an option to upload a large number of resources, such as contacts, to a service provider all at once. You can use bulk to download a csv or json file from a large number of records or upload a csv or json file to add multiple records. See Using Bulk for more information on managing bulk.

Note: When there is no native bulk available from the provider, Cloud Elements provides a bulk service for uploading and downloading data from the endpoint. Sugar Market element makes use of Bulk V3. For more information, see our Bulk documentation.

Bulk Details

Bulk InformationDetails
Bulk TypeCloud Elements Bulk.
Upsert SupportNo
Field Selection SupportYes. You can specify fields within a resource. For example, select name,id from contacts.
Order By SupportNo

Querying

The Cloud Elements Query Language ( CEQL ) provides a standard way to search across all of our elements. Rather than having users research how to query each resource at a provider, we've normalized your search experience. Cloud Elements translates your queries to the API provider's search syntax. CEQL represents the "where" portion of a typical query that can include many other components like field selection, sorting, and pagination. For more details on Querying, see Querying with CEQL.

To determine whether where clause is supported for an object, you can make an API call to object/{objectName}/metadata while providing the Element version and check for "filterable"="true". In the example shown below, we're checking it for the object - accounts.

A few examples for the usage of where clause would be:

  • /accounts?where=account_id='385'
  • /accounts?where=account_name='BulkUploadTest'
  • /accounts?where=created_date>'2020-07-02T13:41:00Z' 
  • /accounts?where=account_name='test' and billing_city='Cupertino'

And shown below is a short video on how to make an API call using the where clause.


There are several operators that are valid to be used for querying. You can find more details on them here. But each object which has "filterable"="true",  can also tell you what operators can be used for that particular filterable, as shown below.

Element Extension

Element Builder gives you the integration tools to extend the current feature set of any of our elements by adding a resource or method. If your use case requires a resource our element doesn’t currently support, you can easily add it in yourself using Element Builder.

Sugar Market is an extendable element and therefore, you can customize it according to your needs. For more details, read the Extend Elements article which gives a description in detail as to how it can be done.

Discovery APIs

Discovery APIs  are usually used in conjunction with a specific authenticated element instance to:

  • Identify data objects in aan element
  • Identify data objects and their source (the vendor, a VDR, or Cloud Elements library)
  • Find metadata, including custom fields, related to an object
  • Retrieve the Open API specifications (API docs) of an object

However, Discovery APIs are not supported by Cloud Elements for the Sugar Market element, as there is no support by the vendor for the same.

Element API Documentation

The base URL for all API requests is https://api.cloud-elements.com/elements/api-v2.

Provider Documentation