Salesforce component
Available as of Camel 2.12
This component supports producer and consumer endpoints to communicate with Salesforce using Java DTOs.
There is a companion maven plugin [Camel Salesforce Plugin] that generates these DTOs.
Maven users will need to add the following dependency to their pom.xml
for this component:
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-salesforce</artifactId> <version>x.x.x</version> <!-- use the same version as your Camel core version --> </dependency>
URI format
The URI scheme for a salesforce component is as follows
force:topic?options
You can append query options to the URI in the following format, ?option=value&option=value&...
Supported Salesforce APIs
The component supports the following Salesforce APIs
Producer endpoints can use the following APIs. Most of the APIs process one record at a time, the Query API can retrieve multiple Records.
Rest API supported:
- getVersions - Gets supported Salesforce REST API versions
- getResources - Gets available Salesforce REST Resource endpoints
- getGlobalObjects - Gets metadata for all available SObject types
- getBasicInfo - Gets basic metadata for a specific SObject type
- getDescription - Gets comprehensive metadata for a specific SObject type
- getSObject - Gets an SObject using its Salesforce Id
- createSObject - Creates an SObject
- updateSObject - Updates an SObject using Id
- deleteSObject - Deletes an SObject using Id
- getSObjectWithId - Gets an SObject using an external (user defined) id field
- upsertSObject - Updates or inserts an SObject using an external id
- deleteSObjectWithId - Deletes an SObject using an external id
- query - Runs a Salesforce SOQL query
- queryMore - Retrieves more results (in case of large number of results) using result link returned from the 'query' API
- search - Runs a Salesforce SOSL query
Component and endpoint options
Name |
Default Value |
Description |
---|---|---|
|
|
Username for account. This is mandatory. |
|
|
Password for account. This is mandatory. |
|
|
Whether to return data in JSON format. If this option is false, then XML is returned in Atom format. |
|
|
To transform the JSON from a String to a Map in the message body. |
|
|
If the JSON Map contains only a single entry, then flattern by storing that single entry value as the message body. |
Message Headers
The following headers can be used by the producer.
Name |
Type |
Description |
---|---|---|
|
|
Mandatory: The command to execute in MS ADO.Net Data Service |
Examples
For example, the following producer endpoint uses the upsertSObject API, with the sObjectIdName parameter specifying 'Name' as the external id field.
The request message body should be an SObject DTO generated using the maven plugin.
The response message will either be null
if an existing record was updated, or CreateSObjectResult
with an id of the new record, or a list of errors while creating the new object.
...to("force:upsertSObject?sObjectIdName=Name")...