Artisan IMG > Sugar Market (sugarmarket) (f81143d9-a8f1-46c9-bb00-4b9aed6e5d1e)

Sugar Market
1.2

Sugar Market, previously Salesfusion, is the marketing automation platform built to work for you. Nurture leads and drive revenue.

Overview
Copy

Sugar Market allows mid-sized marketing teams reach audiences and measure success throughout the buyer journey. Sugar Market can capture leads by creating conversion-focused landing pages, emails and forms with intuitive, drag-and-drop builders. With Sugar Market it is possible to easily uncover which tactics are working (and where improvements are needed) to refine campaigns and constantly deliver results.

Authentication
Copy

IMPORTANT!: Whilst any account with sufficient roles and access privileges applied to it can be used to authenticate to the Sugar Market connector on Tray.io (for example, an admin user account), Sugar Market themselves recommend that you set up a separate account for dedicated API access. The steps below will guide you through this process.

Setting up an API account within Sugar Market
Copy

First, log into the Sugar Market application using an admin user account. Once at your dashboard, click on your profile picture in the top right and select 'Administration View'

Once at the Administrator View page, locate and click on 'Roles' under the 'User Adminstration' section.

Here, you will find a listing of the roles that you can assign to users. You may already have a role named 'API Access', which you are free to assign to a user account if you wish. If you would like to create your own role, click on the 'New' button on the top of the page.

On the pop-up modal, enter the name and description for your role. When you are ready to proceed, click 'Save'.

You will then be redirected to the details page for this specific role. First, you want to ensure that the role has the correct level of access you require. In this example, we are going to give this role 'Data Access' and 'Navigation Access' by clicking on the associated checkboxes.

Next, we can set up granular access to specific services. Click on the 'Navigation Access' tab and you will be redirected to an access control page. This page will allow you to select which specific areas of your account you would like to provide this role access to. In the example below, we have selected specific items from the 'Access Denied' column and used the arrow buttons to move them accross to the 'Access Provided' column. Once you are happy with your selection, click 'Save and Stay' in the top right hand corner of the page.

Once the site has finished saving your changes, you will see a "Success! Role Saved." banner appear on the top of the page. Once saved, click on the 'Users' tab to be redirected to the page that allows you to select the users that you wish to assign this role to. In this case, we have selected a single account by using the checkbox to the left of the account listing. Once ready, click 'Add User' button.

The page will reload and a "Success! User added successfully." will appear. You will also notice that the user account will now be listed under the "Users Assigned to Role" section of the page.

Once complete, you will have successfully assigned a dedicated API access role to an account. You can now use this account when authenticating to the Sugar Market connector on Tray.io.

Authenticating on Tray.io
Copy

Once you have an Sugar Market account set up for API access, you can then proceed to use that account with the Sugar Market connector for Tray.io. The first thing you will need to do is go to your Tray.io account page and select the workflow you wish to work on. Once in the workflow builder itself, search and drag the Sugar Market connector from the connectors panel (on the left hand side) onto your workflow.

With the new Sugar Market connector step highlighted, in the properties panel on the right, click on the Authenticate tab and 'Add new authentication' (located under the 'Authentication' field).

This will result in a Tray.io authentication popup window. The first page will ask you to name your authentication, and state which type of authentication you wish to create ('Personal' or 'Organization'). The second screen will ask you to provide your Sugar Market credentials, specifically your 'Username', 'Password' and 'Domain name'.

Once you have added these fields to your Tray.io authentication popup window, click on the 'Create authentication' button. Go back to your settings authentication field (within the workflow builder properties panel), and select the recently added authentication from the dropdown options now available.

Your connector authentication setup should now be complete.

Available Operations
Copy

The examples below show one or two of the available connector operations in use.

Please see the Full Operations Reference at the end of this page for details on all available operations for this connector.

Using the Raw HTTP Request ('Universal Operation')
Copy

As of version 1.0, you can effectively create your own operations.

This is a very powerful feature which you can put to use when there is an endpoint in Sugar Market which is not used by any of our operations.

To use this you will first of all need to research the endpoint in the Sugar Market RESTFUL API documentation 2.0, to find the exact format that Sugar Market will be expecting the endpoint to be passed in.

Note that you will only need to add the suffix to the endpoint, as the base URL will be automatically set.

The base URL for Sugar Market is: https://developer.salesfusion.com/api/2.0/

For example, say that the 'List contacts' operation did not exist in our Sugar Market connector, and you wanted to use this endpoint, you would use the Sugar Market API docs to find the relevant endpoint - which in this case is a GET request called: /contacts/.

More details can be found here.

So if you know what your method, endpoint and other required information, you can get the contacts information with the following settings:

Method: GET

Endpoint: /contacts/

Body Type : None

The final example outcome being: https://developer.salesfusion.com/api/2.0/contacts/

Example Usage
Copy

TRAY POTENTIAL: Tray.io is extremely flexible. By design there is no fixed way of working with it - you can pull whatever data you need from other services and work with it using our core and helper connectors. This demo which follows shows only one possible way of working with Tray.io and the Sugar Market connector. Once you've finished working through this example please see our Introduction to working with data and jsonpaths page and Data Guide for more details.

Below is an example of a way in which you could potentially use the Sugar Market connector, to get the existing contacts from your account one by one.

  1. Setup using a manual trigger and the List contacts operation.

  2. Add a Loop connector to iterate through the contacts found.

  3. Get all the available data for each contact, individually.

The final outcome should look like this:

1 - Setup Trigger & List contacts
Copy

Once you have clicked 'Create new workflow' from your main Tray.io dashboard named it, select the Manual trigger from the trigger options available:

After you have been redirected to the Tray.io workflow dashboard, from the connectors panel on the left, add a Sugar Market connector to your second step. Set the operation to 'List contacts'.

Feel free to re-name your steps as you go along to make things clearer for yourself and other users.

When run, this workflow will list all the contacts within the Sugar Market account under your credentials.

2 - Add a Loop connector
Copy

Next, search for the Loop collection connector within your connector panel, and drag it into your workflow as your next step. Set your operations to 'Loop list'.

The Loop Collection connector allows you to iterate through a list of results. In this example, we will use it to iterate through the data found within the previous List contacts connector step.

In order to specify the list you want to loop through, start by using the 'List' mapping icon (found next to the list input field, within the properties panel) to generate the connector-snake.

While hovering over the 'List contacts' step (with the tail end of the connector-snake), select results from the list of output properties displayed. This will auto-populate a jsonpath within your 'List' input field, and update the type selector to jsonpath.

For more clarification on the pathways you have available, open the Debug panel to view your step's Input and Output.

JSONPATHS: For more information on what jsonpaths are and how to use jsonpaths with Tray, please see our pages on Basic data concepts and Mapping data between steps

CONNECTOR-SNAKE: The simplest and easiest way to generate your jsonpaths is to use our feature called the Connector-snake. Please see the main page for more details.

When run, this workflow will iterate through the list of contacts provided by the earlier step.

3 - Get Contacts
Copy

The last step is to drag a Sugar Market connector inside of the Loop Collection step itself. Set the operation to 'Get contact'. As you can see, the 'Contact ID' field is required.

INTERPOLATION: When you wish to include JSON generated data within another input/output result, use our Interpolation method as described here.

When run, the workflow will now iterate through the list of contacts provided, and get all the details available for each individual one.

You can also check the Debug panel for more details on the provided output:

BEST PRACTICES: Whenever you do decide to create your own workflow, be sure to check out some of our key articles such as: