100% found this document useful (1 vote)
656 views2 pages

Salesforce Api Developer Cheatsheet

Use the Force.com Web Services API to create, retrieve, update, or delete records. The API also allows you to maintain passwords, perform searches, retrieve metadata. The core calls are needed for logging in, querying, creating and deleting data.

Uploaded by

siva.shanmukh
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
656 views2 pages

Salesforce Api Developer Cheatsheet

Use the Force.com Web Services API to create, retrieve, update, or delete records. The API also allows you to maintain passwords, perform searches, retrieve metadata. The core calls are needed for logging in, querying, creating and deleting data.

Uploaded by

siva.shanmukh
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Integration Web Services API Cheat Sheet

Overview Utility Calls


Use the Force.com Web Services API to create, retrieve, update, or delete records in Force. These calls let you retrieve user information, send emails and reset passwords:
com from any external system that supports SOAP-based Web services, such as Java,
.NET, or PHP client applications. With more than 20 different calls, the API also allows you getServerTimestamp() Retrieves the current system timestamp from the API.
to maintain passwords, perform searches, retrieve metadata information about objects and
getUserInfo() Retrieves personal information for the user associated with the
more.
current session.
resetPassword() Changes a user’s password to a system-generated value.
Getting Started sendEmail() Immediately sends an email message.
To generate the WSDL representing your environment, go to Setup | Developer | API. The
Enterprise WSDL is a strongly typed representation of your data, while the Partner WSDL setPassword() Sets the specified user’s password to the specified value.
is a loosely typed representation, ideal for writing generic clients that work across different
organizations.
Primitive Data Types
The API uses the following primitive data types:
Core Calls base64 Base 64-encoded binary data.
These are the fundamental calls needed for logging in, querying, creating and deleting data:
boolean Boolean fields have one of these values: true (or 1), or false (or 0).
login() Logs in and starts a client session. byte A set of bits.
logout() Ends the session of the logged-in user. date Date data. Unlike dateTime fields, date fields contain no time value.
dateTime Date/time values (timestamps)
invalidateSessions() Ends one or more sessions.
double Double values.
create() Adds one or more new individual records. int Fields of this type contain numbers with no fractional portion.
delete() Deletes one or more individual records. string Character strings.
update() Updates one or more existing records. time Time values.

upsert() Creates new records and updates existing records; matches on


a custom field to determine the presence of existing records.
Field Types
undelete() Undeletes records from the Recycle Bin. In addition to the primitive data types, the API defines these data types for object fields:
emptyRecycleBin() Deletes records from the Recycle Bin immediately. anyType Polymorphic data type that represents a particular type
getDeleted() Retrieves the IDs of individual deleted records for a specified depending on the kind of field involved.
timespan. calculated Fields that are defined by a formula.
getUpdated() Retrieves the IDs of individual updated records for a specified combobox A combobox, which includes a set of enumerated values and
timespan. allows the user to specify a value not in the list.
currency Currency values.
convertLead() Converts a Lead into an Account, Contact, or (optionally) an
Opportunity. email Email addresses.
encryptedstring Encrypted text fields contain any combination of letters,
merge() Merges records of the same object type.
numbers, or symbols that are stored in encrypted form.
process() Submits an array of approval process instances for approval, ID Primary key field for the object.
or processes an array of approval process instances to be
approved, rejected, or removed. masterrecord When records are merged, the ID of the record that is saved
(the other records are deleted).
query() Executes a query against the specified object and returns data multipicklist Multi-select picklists, which include a set of enumerated values
that matches the specified criteria. from which multiple values can be selected.
queryAll() Same as query(), but includes deleted and archived items. percent Percentage values.
queryMore() Retrieves the next batch of records from a query. phone Phone numbers. Values can include alphabetic characters.
picklist Picklists, which include a set of enumerated values from which
retrieve() Retrieves one or more records based on the specified record
one value can be selected.
IDs.
reference Cross-references to a different object. Analogous to a foreign
search() Executes a text search in your organization’s data. key field in SQL.
textarea String that is displayed as a multiline text field.
url URL values.
Describe Calls
These calls let you dynamically retrieve information about objects and other aspects of
an organization:
API Fault Element
The following table lists the API fault elements that the API returns if an error occurs when
describeGlobal() Retrieves a list of available objects for your organization’s
processing a service request.
data.
describeLayout() Retrieves metadata about page layouts for the specified ApiQueryFault The row and column numbers where the problem occurred.
object type. LoginFault An error occurred during the login() call.
describeSObject() Superseded. Use describeSObjects() instead. InvalidSObjectFault An invalid sObject in a describeSObject(), describeSObjects(),
create(), update(), retrieve(), or query() call.
describeSObjects() Retrieves metadata (field list and object properties) for the
specified object types. InvalidFieldFault An invalid field in a retrieve() or query() call.
describeSoftphoneLayout() Describes the SoftPhone layout(s) created for an MalformedQueryFault A problem in the queryString passed in a query() call.
organization. InvalidQueryLocatorFault A problem in the queryLocator passed in a queryMore() call.
describeTabs() Describes the apps and tabs that have been configured for MalformedSearchFault A problem in the search passed in a search() call.
the user.
InvalidIdFault A specified ID was invalid in a setPassword() or resetPassword()
call.
UnexpectedErrorFault An unexpected error occurred. The error is not associated with
any other API fault.

http://developer.force.com
Go to http://developer.force.com/cheatsheets for additional cheat sheets and resources.

Corporate Headquarters Latin America Japan Asia / Pacific Europe / Middle East / Africa
The Landmark @ One Market Suite 300 +1-415-536-4606 +81-3-5785-8201 +65-6302-5700 +4121-6953700
San Francisco, CA 94105
United States
©2010, salesforce.com, inc. All rights reserved. Salesforce.com and the “no software” logo are registered trademarks of salesforce.com, inc.,
1-800-NO-SOFTWARE and salesforce.com owns other registered and unregistered trademarks. Other names used herein may be trademarks of their respective owners.
www.salesforce.com

4/28/10

Common questions

Powered by AI

Utility calls like 'sendEmail()' and 'resetPassword()' significantly enhance user interaction by providing immediate communication capabilities and account security management, respectively. 'sendEmail()' allows the API to dispatch emails instantly to users, facilitating notifications and alerts. 'resetPassword()' ensures account security by allowing for system-generated password changes, thus safeguarding user accounts against unauthorized access .

Session management in the Force.com API is handled primarily through the 'login()', 'logout()', and 'invalidateSessions()' functions. 'login()' initiates a client session, 'logout()' terminates the session of the logged-in user, and 'invalidateSessions()' ends one or more sessions, ensuring control over session lifecycle and security .

Security and error management in API operations are strengthened through specific fault elements. 'InvalidIdFault' ensures data integrity and security by throwing errors when invalid IDs are encountered in operations like setting or resetting passwords. 'UnexpectedErrorFault' addresses unforeseen errors, allowing developers to handle exceptions not covered by specific faults, thus providing a mechanism to ensure application stability and error tracking .

Primitive data types such as 'boolean', 'date', 'dateTime', and 'string' ensure standardized data representation and manipulation. Field types like 'currency', 'email', 'ID', and 'multipicklist' allow for customized data handling, facilitating operations on diverse data types with specific properties. The polymorphic 'anyType' and sensitive data handling types, like 'encryptedstring', add flexibility and security, respectively, enhancing the robustness and precision of data operations .

'convertLead' function optimizes the sales process by transforming a lead into an account, contact, or opportunity, avoiding redundancy and streamlining customer relationship management. The 'merge' function addresses data consistency by consolidating records of the same object type, thereby eliminating duplicate records and maintaining data integrity. Together, these functions enhance data management by aligning data flow with business processes and maintaining a clean dataset .

The 'describeGlobal()' function retrieves a list of available objects in an organization’s data, providing an overview of accessible data types. 'describeSObjects()' offers detailed metadata, including field lists and object properties for specified object types, enabling dynamic adjustments based on object properties. 'describeTabs()' describes configured apps and tabs for the user, aiding in UI customization and navigation setup within an organization's Salesforce environment .

The Enterprise WSDL is a strongly typed representation of an organization's data, making it ideal for applications where the data structure is known and will not change. In contrast, the Partner WSDL is a loosely typed representation, designed for writing generic clients that work across different organizations, accommodating changes in data structure .

The Force.com Web Services API enables data manipulation from external systems by supporting SOAP-based web services, which enables integration with various client applications such as Java, .NET, or PHP. Key functionalities of the API include creating, retrieving, updating, or deleting records. It offers over 20 different calls for operations such as maintaining passwords, searching, retrieving metadata, or converting leads. Specifically, functions like 'create()', 'delete()', 'update()', and 'upsert()' allow for precise data management, while 'query()' and 'queryAll()' retrieve data meeting specific criteria, including deleted and archived items .

'query()' executes searches against specified objects to fetch records that meet defined criteria, facilitating targeted data retrieval. 'queryAll()' extends this by including deleted and archived records, ensuring comprehensive data access. 'queryMore()' helps in pagination by retrieving additional records in batches when the result set exceeds the initial query limits, ensuring efficient data handling in large datasets .

The Force.com API defines various fault elements to manage errors during API operations effectively. For example, 'ApiQueryFault' identifies the specific row and column where a problem occurred during a query. 'LoginFault', 'InvalidFieldFault', and 'MalformedQueryFault' handle errors during login, invalid field references, and malformed query strings respectively. These detailed fault mechanisms allow precise identification and troubleshooting of errors, enhancing robustness and operability of the API .

You might also like