Note: You must be an Enterprise Edition or Unlimited Edition customer to have API access.
API versions prior to 2.0: The ID of a record is always a 15-character case-sensitive ID and should not be compared in a case-insensitive manner.
API versions 2.0 and higher: The API can return either a case-sensitive or a case-insensitive ID field value. The case-insensitive ID is identical to the 15-character case-sensitive ID with three extra characters appended to indicate the case of each of the original 15 characters. When inserting or updating records, the API accepts either the 15-character case-sensitive ID or the 18-character case-insensitive ID. When querying or searching records using the API, you must specify a value of "1" for the "useCaseSafeIDs" parameter to indicate that you want the API to return case-insensitive IDs. If you do not specify the "useCaseSafeIDs" parameter, you automatically receive case-sensitive IDs.
API 2.5: Defaults to 18 characters on the ID (case safe) and provides no option to use the 15-character ID explicitly.
The "Reports" tool queries the database directly and therefore returns a 15-character case-sensitive ID. Tools such as the Data Loader, Demand Tools or the Weekly Data Export service will export records with the 18-character ID.
You'll find this info under 'Field Types - ID Field Type.'
- ID fields in the Salesforce user interface contain 15-character, base-62, case-sensitive strings. Each of the 15 characters can be a numeric digit (0-9), a lowercase letter (a-z), or an uppercase letter (A-Z). Two unique IDs may only be different by a change in case.
- Because there are applications like Access which do not recognize that 50130000000014c is a different ID from 50130000000014C, an 18-digit, case-safe version of the ID is returned by all API calls. The 18 character IDs have been formed by adding a suffix to each ID in the Force.com API. 18-character IDs can be safely compared for uniqueness by case-insensitive applications, and can be used in all API calls when creating, editing, or deleting data.
- If you need to convert the 18-character ID to a 15-character version, truncate the last three characters. Salesforce recommends that you use the 18-character ID.
Good to know: The 18-character reference IDs are just case-safe. For instance, if you fire a SOQL query for record ID "00330000000xEftMGH" and "00330000000xEftmgh," The latter will give no results. This means that they are case sensitive in Salesforce. But when used with tools like Excel/Access, you can devise methods to produce case-safe IDs as per the points below.