This is our blog


Salesforce CRM REST API – The most basic recipe

Salesforce CRM REST API – The most basic recipe


Salesforce provides various methods to read, add, delete or update data. The user interface is only one! If you need to connect to Salesforce from external systems to retrieve or modify records in small volumes, the Salesforce REST API web service is by far the easiest to use.

There are many guides on the internet explaining concepts such as the REST protocol, OAuth2, hand-shaking, callbacks, session management, etc, however if your requirements are simple, wading through the text can be somewhat dull. Salesforce’s own documentation is certainly the most comprehensive. Personally, I find it good reading material when I need a sleep aid. If you’re looking for something a bit more straight-forward and to the point, however, read on…

Really, for basic API use, you need to do two things:

  1. Get a new access token
  2. Use this access token in each subsequent API call-out until it expires, in which case see point 1


1x user account on the Salesforce org (sandbox, prod or developer will suffice) including:
* Username
* Password
* Security Token [what’s this?]

1x Security Profile applied to this user that allows create/read/update/delete permissions on the objects you wish to modify
NB: Every API resource request we make will be with this user, so all the operations on the data you modify through your API calls will be logged against this user in audit logs.

Instructions – Setup

    1. Create a Connected App in your target org
    2. To create a connected app, click “Setup” near your name in the top right corner then
    3. In the left-hand navigation bar type “apps” and select the item as shown below:

  1. Scroll to the bottom of the page to the “Connected Apps” section and click “New”
  2. Provide a new name for the Connected App, and a bogus callback URL (any URL will do as we won’t be using it) and save.
  3. Once this is done, a “Client Secret” and “Client Id” will be generated. The client secret is a series of numbers, whereas the client id is a long series of seemingly random UTF-8 characters. You will need to save these details somewhere for now
  4. Once you have created your Connected App, you can start to test connecting to SF via API. To do this, you will need to develop an application using any internet technology/platform capable of connecting to the internet and posting/retrieving data using the HTTPS protocol (e.g. Java, PHP, Apex, etc). However to simplify testing, you may want to use either the “curl” command-line in Unix/Linux (or via Cygwin on Windows) or even simpler, use a REST-based API testing client such as the Google Chrome plugin “Advanced REST client” available for free on the Google Chrome Web Store here. The rest of this recipe will use the Advanced REST Client chrome app for instructions.

Instructions – Getting an Access Token

  1. Let’s start by getting what is called an OAuth2 access token from your Salesforce sandbox. To do this, in the Google Chrome Advanced REST Client “URL” input box, type:

    (for prod, just replace “test” in the URL with “login”)

  2. Select POST as the method and in the “Raw Headers” section type:
    Content-Type: application/x-www-form-urlencoded
  3. In the “Data Form” section, enter your client_id, client_secret, username, password* and a final additional parameter called “grant_type” = “password”
    *PS: The password should be your normal salesforce password + your users security token. E.g. if your password is “myPassword!” and your security token is “61WhVHCHUkBIBGUm4ayC3588” then enter “myPassword!61WhVHCHUkBIBGUm4ayC3588”
  4. Your screen should now look something like this:
  5. Once this detail is provided, hit SEND
  6. In the HTTP response body, you will now have an “access_token” as well as an “instance_url”. You will be using the “instance_url” in all subsequent requests to create/read/update/delete data, and in every request, you will need to provide the access_token in the header. Generally, the access_token will be valid for 2 hours, but this depends on your salesforce settings. The timeout duration can be modified.

Instructions – Using the Access Token to Securely Modify Your Data

  1. Now that you have your instance_url and access_token, we can create some data! Let’s try create a Lead via API. In the “URL” input box within your Google Chrome Advanced REST Client, enter:

    where instance_url = the instance_url you got back from the Access Token request in the previous step. This should be something like “” or “” etc.

  2. In the Raw Headers section, enter the following:
    Content-Type: application/json
    Accept-Type: application/json
    Authorization: Bearer ACCESS_TOKEN

    ACCESS_TOKEN = the access token you got back in the previous step, so it should look something like this:

    Content-Type: application/json
    Accept-Type: application/json
    Authorization: Bearer 3j9ApkCiRpiZNuEfUy7MT7jG1E2wjpjgCeIqDrssp6735vIlOGZn91yRLoZEer
  3. In the “Raw Payload” section enter a JSON payload structure of Lead information such as this:
      "FirstName": "Test",
      "LastName": "Lead",
      "Email": "",
      "Phone": "0123456789",
      "Company" : "Test Company",
      "LeadSource": "Web",
      "Country" : "United Kingdom"

    JSON is a data format standard used by many REST API services. You can read up more on JSON data formats here.

  4. Your screen should now look something like this:
  5. When you are ready, hit SEND. You will now see the result of your request in the Response Body. To test that your lead has successfully been created, log into your target Salesforce org, navigate to the Leads object, and select “Today’s Leads” from the List Views. If everything has worked, your Lead should be at the top of the list!

Hopefully by following the example, you’ve started to piece together the fundamentals of OAuth2 authentication and how Salesforce implements it’s standard out-of-the-box Web Services. Each object has it’s own specific set of URI resources. To get the full list, just do a GET request on https://your_salesforce_instance/services/data/v39.0/ where v39.0 is the version of the API you want to interrogate. Otherwise, continue to explore the incredibly rich but dull catalogue of documentation on the Salesforce support and help websites.

Happy API-ing!

Securing your CRM code base

Securing your CRM code base

Any Salesforce admin or developer worth their salt in deployments will know that no Apex classes or Triggers will be making their way to a Production org without adequate code coverage. Salesforce devs need to write Unit Tests to sufficiently cover at least 75% of their code.

✔ Big green tick to Salesforce for enforcing quality on the platform and protecting against possible regression and class integrity.

What is not required however, is a code scan to highlight any potential security vulnerabilities. This is a recommended best-practice for any code deployment, however the practicalities of this can sometimes be outweighed by the benefits. I.e., there are costs involved with code scans.

At the time of writing, Salesforce does offer a free code scan service available here however there are no guaranteed service levels and depending on server activity, it could be days before your code scan results are returned (if ever). Premium services are available such as The Checkmarx solution for scanning Apex & Visualforce (and other languages such as Javascript) code.

If your company is not convinced in investing an Apex code scanning solution however, there are some best-practices you can implement:

SOQL Code Injections

Take care of passing SOQL as a String parameter to database functions, such as:

    String mySOQL = 'select id from account';
    List accounts = (List) Database.query(mySOQL);

Where “mySOQL” can be intercepted and manipulated (for example, through URL parameters). A safer way to execute the above code would be:

    List accounts = [select id from account];

Sometimes using the Database.Query function cannot be avoided (e.g. in the case of dynamic generation of SOQL), however if it can be, avoid!

Cross-site Scripting

Cross-site scripting (XSS) enables attackers to inject client-side scripts into web pages viewed by other users. One of the best preventative measures you can make to avoid XSS attacks in Salesforce is to avoid overriding the default “escaping” of characters within a Visualforce component as such:

<apex:outputText value=”val” name=”output1″ escape=”false” />

“Escape” within the context of VF page components is a Boolean value that specifies whether sensitive HTML and XML characters should be escaped in the HTML output generated. An escape character is a character which invokes an alternative interpretation on subsequent characters in a character sequence. Setting this Boolean to “false” may be a security risk because it allows arbitrary content, including JavaScript, that could be used in a malicious manner.

Cross-site Forgery

Cross-Site Request Forgery (CSRF) is an attack that forces an end user to execute unwanted actions on a web application in which they’re currently authenticated. For example, CSRF occurs when a user visits a malicious web page that makes their browser send requests to your application that the user did not intend. The best way to avoid this is to configure your Visualforce Pages and components to require CSRF protection on GET requests when editing the page in Salesforce:

There are many more examples of how to reduce your vulnerabilities, however these practices are probably the best spend of resource to mitigate risks in your Apex code.

Why should on-the-road Sales reps use Salesforce CRM?

Image from Flickr

Why should on-the-road Sales reps use Salesforce CRM?

Whatever the size of your company, there can be no denying that having sales representatives on the road meeting and greeting both existing and potential clients can work wonders in terms of securing contracts, creating sales opportunities or simply just touching base to do a little research on what clients are looking for from a supplier.

Of course, this information containing the needs, the wants and the general concerns of prospective clients needs to reach the administrative hub of your business so that your staff can implement changes and act on hot leads accordingly. But how much of this information gets lost in translation on the busy drive back to the office? Your reps might be visiting numerous clients every day, and any information or feedback they receive is most effectively used when acted upon immediately. At worst it could end up lost in the ether – but this is where Salesforce comes in.

CRM Care recommends Salesforce as it is a real-time, cloud-based intuitive system, and reps love it. It allows instant uploading of client or customer notes and much more. Here are just four reasons why your reps can’t afford not to be connected to the sales cloud.

1) Fantastic access to customer information

Salesforce apps allow your reps to see all of their opportunities, tasks, contacts, events and accounts in one easy to understand marketing cloud. It’s convenient and provides a complete view of the customer’s history without paper documents, notes or spreadsheets.

2) Planning made easy

Allow your reps to do their own planning on the road with complete access to customer histories, wherever they may be. Once meetings are complete, your reps can then arrange follow ups and take a look at the amount of time committed to their individual efforts before relaying this back to the office and saving as a reminder.

3) Effective time management

Prioritising is one of the main bugbears of being a rep, but Salesforce makes it easy to check on nearby opportunities and make better use of time.

4) Detailed reports

Reps can create reports detailing opportunities (both won and lost), products that have recently been sold and accounts that haven’t been visited in some time in order to gain a better understanding of how to maximise their time.

Why should you use Salesforce CRM for a SMB?

Image from Flickr
Image from Flickr - CRM Care

Image from Flickr – CRM Care

Why should you use Salesforce CRM for a SMB?

CRM Salesforce isn’t just a great idea for large organisations, small companies can also reap the benefits of this customer relationship management software. Salesforce can allow you to accelerate the growth of your small business in a cost-effective and efficient manner, allowing you to focus on delivering your product or service. Here, we look at the main benefits of using CRM Salesforce to help grow a smaller company…

1. Superior contact management

Are your customers and potential customers simply stored as a list of names and contact details? Salesforce can help you to take contact management to the next level by allowing you to keep comprehensive records of customer interactions. These records can be used as tools to monitor customer satisfaction, encourage repeat sales, and build your brand.

2. Targeted selling

Timing is everything, especially when it comes to targeting past and potential customers. The Salesforce CRM is a fantastic tool for making sure you contact the right people at the right time, even reminding you of the best times for communicating. This software means that you don’t have to rely on staff remembering to contact leads at the right times, and you can analyse all your interactions to maximise productivity.

3. Keep a lid on IT expenditure

Running a small business means that keeping your costs down is a priority, and having to employ IT experts as your company grows can be a drain on your potential profits. Because Salesforce is cloud-based and you can log in from any device from any location, your business can benefit from the latest customer relationship management technology, without having to employ an in-house team.

4. Harness the power of social media

Linking your CRM system to social media networks allows you to reach out to more potential customers and heighten awareness of your brand. For a small business, the value of this cannot be underestimated – it’s an efficient and cost-effective means of maintaining and increasing your market share.

5. Grows with your business

Salesforce can be scaled up as your business grows, as the cloud-based nature of this system is entirely customisable.

Find us on Twitter, Facebook and Medium

CRM Care Product Review: Edit Quotas Salesforce

CRM Care Product Review: Edit Quotas Salesforce

Quotas in Salesforce are a tricky task. They have an enormous amount of value, but Salesforce don’t make it easy for you to update and insert. Doing it the manual way will take considerable preparation especially if you go into the hundreds of users. This is where you can use a Salesforce Labs application called “Edit Quotas” (original, I know) to assist you in getting it right.

Official Blurb:editquota-lxp-classic-mode-page-03

Collaborative Forecasting is an excellent way to track your business. But entering your rep’s quotas can only be done through the API.

Edit Quotas is an app that lets a sales manager view and set quotas within the Salesforce graphical user interface.

  • Simple screens to view and edit your sales reps’ forecasts

  • Set new quotas quickly by copying quotas from a previous forecast period

  • Security controls guarantee that quotas can only be viewed and edited by those who are authorized.


Image and word source: Edit Quotas – AppExchange


Whats Good?

  • Very easy to install (as are all with Salesforce AppExchange applications)
  • It works on existing functionality within Salesforce profile settings. If you have Edit quotas enabled as permission enabled on the profile / permission set you can use it
  • If you use permission set (I would recommend) you can associate the edit quotas application. I would recommend separating up a separate forecast application within Salesforce for all your users.
  • Manual updates for individual months and quarters and instantly updated.
  • Data Loader can be used. If like me you need to do a mass insert on creation you can allow admins to do that, but delegate updating of quotas to other users WITHOUT admin permissions. This is a big plus.


Whats Bad?

  • With larger data sizes the application doesn’t reduce your workload, it only allows you to delegate some of the responsibility of maintaining it.
  • This should be a standard ‘out of the box’ functionality. I’m unsure on the data of how much forecasting is being used in Salesforce, but weirdly it does seem to be one of the forgotten functionalities.


If you are running forecasting out of Salesforce you need to have this weapon in your armoury. It isn’t going save you a lot of time but it will save you considerable aggravation in the future. This is just one of many tools you need to perform your forecasting within Salesforce.


Taking Salesforce admin to the next level: tips for passing Salesforce exams

Image from Flickr

Taking Salesforce admin to the next level: tips for passing Salesforce exams

As a Salesforce admin, your role can have significant impact, and over time you’ll learn to leverage it to create positive culture change across the organisation. But there comes a time when you want to communicate your knowledge and expertise to colleagues and employers, present and future. And that means Salesforce certification.

Read the study guide and prioritise

Your first strategy is to prioritise your study time by focusing on the topics that take up the highest percentage of the test. Why spend hours on Chatter (1%) when Standard and Custom Objects is 18% of the Salesforce exam? You need 68% to pass, so focus on nailing those percentage-heavy subjects and being confident of achieving the pass rate before focusing on 100% success.

Practice and use study aids

Make sure you block out study time in your calendar and let your team know that this is your priority. Find a study group if you learn best with other people, and share your tips and strategies for success. Use flash cards to memorise key data and fill in your knowledge gaps with the study guide. Best of all, you can practice and reinforce your study and learning by actually using Salesforce.

Take the 3 pass approach to your test strategy

Salesforce exams are multiple choice and you’ll have 90 minutes to complete and review your answers before you submit them. This is why the 3 pass approach makes sense.

Pass 1: Answer all the questions you’re 100% certain on – if that’s 39 out of 60 you’ve already achieved a pass – and flag more challenging questions for review

Pass 2: Go back to the questions you flagged for review and figure out the answers, removing the flag each time you complete

Pass 3: Review your answers before hitting submit

By taking this approach, you’ll have plenty of time to complete the Salesforce exam and won’t need to stress. Now hit submit for your instant result.

At CRM Care we have plenty of hints and tips on our blog [] to help you take your Salesforce admin game to the next level. Good luck!

Considering CRM for your SMB? Here’s your 5 point checklist

Image from Flickr

Considering CRM for your SMB? Here’s your 5 point checklist

As an SMB, you’re ideally placed to give great customer service. But even the most dedicated business can always do better at keeping track of customer relationships, so CRM software makes sense. You’ll find solutions at a range of price points to suit your budget, but with CRM it really is a case of ‘you get what you pay for’. With that in mind, it’s a good idea to be clear on the features you want from your CRM before you make any commitments.

Keep it in the cloud

Most businesses are familiar with the ease of cloud computing and you can use it for CRM too. We’d say this is a must-have feature for an SME as it’s both cost-effective and makes data easy to access from anywhere.


You may be happy with your CRM right out of the box, but it pays to be able to customise. That could be as simple as changing the colour palette to as complex as being able to create your own apps. Check how rich the customisation features are – you may not need them today, but your workforce may need them in the future.


Your business won’t always be the size it is when you make your CRM purchasing decisions. So you need a solution that is easily and quickly scalable to new demands and rapid growth. If a CRM solution doesn’t offer this feature, then it’s not the right solution for your business.

Unique features

Imagine you’re shopping for a new car. Every model comes with those extra ‘buy me’ features but, just like buying a car, you need to be very clear that those features actually work for you. There are some must-haves that should definitely make it on to your list: sales data, marketing automation, lead management and mobile access should all be key factors when you make your decision.

Customer support

CRM is one of the most crucial investments you’ll make, so make sure the customer support you’re offered is up to scratch: training, personalised app development and 24/7 support should all be on your wishlist.


Customising CRM – 3 killer tips on making Salesforce work for you

Image from Flickr

Customising CRM – 3 killer tips on making Salesforce work for you

If you’re a salesforce newbie, you may be feeling a little overwhelmed at all the new technology at your fingertips. By focusing on the core functionality, not the technology, and with a little customisation, you’ll uncover ways of working that make sense, and make salesforce the perfect solution for your needs.

Head to the AppExchange

This is an orienteering exercise that puts you on familiar ground. After all, the AppExchange is an app store like any other, full of free and paid apps that can increase functionality. Take a good look around and explore what’s on offer, focusing on the kind of apps that you feel can make your life easier. Think back to your training and areas of functionality that you didn’t quite grasp or that you thought could offer an improved user experience. Chances are there’s an app for that, and you can revisit when you’ve finished making your own tweaks.

Personalise your list views

List views are where you’re likely to spend most of your working life on salesforce. Start by feeling your way through the standard views and thinking about which information is most important for you. From there, you can start the process of customisation by creating personalised list views that offer the data and functionality you need, be it an expanded view of a single list or the ability to view multiple lists at once. Check with your administrator that you have the ability to customise lists, and then create the user experience that’s relevant for you.

Learn to love reports

At CRM Care, we love reports and dashboards because they’re so easy and intuitive to create and use. You can identify training needs by investigating which cases take you the longest to close and why, or motivate yourself to be more productive by comparing your stats with other employees across the workforce. There’s no better way to explore all the statistical information that salesforce has to offer than by mining reports and utilising dashboards for data at a glance.

We’ve only scratched the surface of salesforce’s potential, but you can check out the rest of the blog for more useful salesforce tips and tricks. Contact us today if you need more salesforce help from one of our expert team members.

Three ways Cloud CRM marketing can benefit your business

Image from Flickr

Three ways cloud crm marketing can benefit your business

Everyone’s on the go these days. With advances in smartphone technology, it’s possible to work remotely, move locations during the day, and even catch up on your admin in meetings. Marketing teams can benefit from using the Salesforce marketing cloud in three key ways:

1. Streamline your pipeline

Your role as a marketing team is to generate leads. It’s easy, however, for sneaky sales people to steal your lead and list it as their own if you’re still using basic Excel-based pipeline tracking. A cloud-based app, accessible from any laptop, PC, or smartphone, enables your marketing team to always be on top of new lead generation opportunities from the very start – so you’re able to take the credit where it’s due.

2. Stay in touch wherever you are

BYOD (Bring Your Own Device) is perhaps less fun than the old-school BYOB, but it’s far more useful. Businesses that implement BYOD have found significant increases in out-of-office productivity. Enabling a marketing cloud app like Salesforce means your team can instantly log ideas, track new campaigns, and work whenever they want.

You’ll notice a significant increase in productive work within a short time of using a cloud marketing service, as your teams start to work differently with a more flexible approach to the device they can use. Instead of playing Candy Crush on the train home, an idea could strike, an email could be answered, or the latest campaign stats combined into a report – all from their own smartphone!

3. Personalised customer journeys for greater conversion rates

Handling customer data in a CRM system like Salesforce enables you to get into the nitty gritty of individuals’ preferences. Personalised emails have time and again been proven to increase conversion rates – and a cloud marketing CRM like Salesforce enables so many features for personalisation, your customers will really feel like you treat them as an individual.

From forgotten baskets to birthday vouchers, a comprehensive CRM system will enable your marketing team to target customers on the most personal level. You’re guaranteed to see an increase in conversion rates with such tools at your fingertips!

Photo: a-digital train by Cea. licensed under Creative commons 2

Salesforce apps help give your business CRM direction

Image from Flickr

These days, it seems almost impossible to remember a time without smartphone applications. But ever since the launch of the App Store in July 2008, businesses were given a great new way to monitor decisions and know their audience. Indeed, salesforce apps are practically an industry in and of themselves.

Salesforce apps allow you to delve deep into the mind of your consumers, allowing you to cater better to your customer base. Best of all, you can check your clients’ feedback in real-time, which gives you the insights you need to improve how you cater to your customers.

Salesforce software has existed nearly as long as the modern computer has, so what exactly makes apps such a worthy prospect? One great reason is portability. Regardless of whether you’re a small business owner or the head of a large firm, being able to assess market trends – and especially the trends of your customers, in particular – will give you a great advantage in planning for the future. Best of all, perhaps, is that these apps are usually updated regularly, and you will typically find that these apps will cost less when compared to desktop-based programs.

The real-time data generated from these apps can usually be analysed via custom reports. Plus, they are often fed to you in seconds with a feed-first design. More than anything, however, is the ubiquitousness of apps. These days, nearly everyone has a smartphone, meaning that all of your employees can check reports at the swipe of a finger, even if they’re not in the office. This portable paradigm facilitates the possibility of remote (or virtual) worksites, and, if you’re a small business, it can give you the dynamism and insight needed to survive the brutal world of 21st-century business.

CRM provides this service for you in an understandable and professional manner, allowing you to stress less about the future and focus more on the present. Our CPQ and marketing software can also give you real-time pricing information for all of your products, allowing you to stay competitive but profitable. If you want to make sure your business isn’t lost in the noise, contact us today!

Photo: Apple iPhone 6 by Janitors licensed under Creative commons 2