{"id":19417990,"url":"https://github.com/americanexpress/jacos","last_synced_at":"2026-03-07T08:03:24.022Z","repository":{"id":45416782,"uuid":"252784766","full_name":"americanexpress/jacos","owner":"americanexpress","description":"Java/Spring based SDK to enable insert, update and upsert of files and records in the SalesForce in Bulk, Single Record and Multi Record Mode","archived":false,"fork":false,"pushed_at":"2021-12-14T21:43:37.000Z","size":158,"stargazers_count":7,"open_issues_count":5,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-01-13T21:55:47.701Z","etag":null,"topics":["connector","java","rest","salesforce","spring"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/americanexpress.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2020-04-03T16:31:03.000Z","updated_at":"2025-01-14T23:48:18.000Z","dependencies_parsed_at":"2022-09-11T02:11:05.493Z","dependency_job_id":null,"html_url":"https://github.com/americanexpress/jacos","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/americanexpress/jacos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanexpress%2Fjacos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanexpress%2Fjacos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanexpress%2Fjacos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanexpress%2Fjacos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/americanexpress","download_url":"https://codeload.github.com/americanexpress/jacos/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/americanexpress%2Fjacos/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30209797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T05:23:27.321Z","status":"ssl_error","status_checked_at":"2026-03-07T05:00:17.256Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["connector","java","rest","salesforce","spring"],"created_at":"2024-11-10T13:12:19.705Z","updated_at":"2026-03-07T08:03:23.994Z","avatar_url":"https://github.com/americanexpress.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Java Connector for Salesforce (JaCoS)\n\n![JaCoS](images/jacos.png) \n\n**Simple Java/Spring based SDK to enable seamless insert, update and upsert of files and records in the SalesForce in Bulk, Single Record and Multi Record Mode**. \n\n## Features\n\n- Support Bulk upload of files of any size (even more than 150 MB) using Salesforce Bulk V2 API\n- Customized chunking of records for Bulk mode operations\n- Support for record by record insert, update and upsert\n- Support for multi record insert, update and upsert for similar and dissimilar object\n- Inbuilt and configurable Salesforce oAuth2 security support\n- Auto-refresh-ability for oAuth2 access token supported\n- Inbuilt and configurable proxy support to Salesforce servers\n- Easy to configure and use\n\n\n### Prerequisite\n- Maven 3+\n- Java 8+\n- Salesforce oAuth2\n- Spring framework.\n\n### Get Started\n\n1. To use JaCoS, Add the maven dependency in your project\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.americanexpress.jacos\u003c/groupId\u003e\n    \u003cartifactId\u003eJacos-Core\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n2. Add the annotation '@EnableJacos' in your Spring Application Main class. For example:\n\n```java\n@SpringBootApplication\n@EnableJacos\npublic class TestApp {\n   private static final Logger logger = LoggerFactory.getLogger(TestApp.class);\n\n```\n\n3. In the application.yml  or application.properties, configure the following salesforce basic properties:\n\n- instance_url : instance url of the salesforce server\n- api_version: Salesforce API version. For example 'v42.0'. Please make sure that you are using version 42.0 or above, if you wish to use multi record operations\n- chunkSizeInMB: Configure this if you are using bulk API. Leave it to the default value of 100, if you are not sure.\n\n```yaml\njacos:\n  sfdc:\n     instance_url: 'https://example.my.salesforce.com'\n     api_version: 'v42.0'\n     chunkSizeInMB: 100\n```\n\n### To setup proxy to salesforce server, you can use the following  properties:\n\n- proxyEnabled : true or false\n- host: proxy host value\n- port: proxy port value\n- timeout: read time out /connection time out for the http connection to salesforce server\n- user (optional) : proxy username\n- password (optional) : proxy password\n\n```yaml\njacos:\n  sfdc:\n      proxy:\n        proxyEnabled: true\n        host: proxy.host.com\n        port: 8090\n        timeout: 1000\n\n```\n\n### You can configure oAuth security for salesforce connection using as follows:\n\n```yaml\njacos:\n  sfdc:\n    security:\n      oauth2:\n        client:\n          access_token_uri: https://example.salesforce.com/services/oauth2/token\n          client_id: client_id\n          client_secret: client_secret\n          grant_type: refresh_token\n          refresh_token: token1\n          content_type: 'application/x-www-form-urlencoded'\n```\n\n### JaCoS Currently supports 3 kinds of operation. They are as follows:\n\n- Bulk Operation\n- Part Operation\n- MultiPart Operation\n\n**Note: All header names in the input CSV should map to Salesforce API names.**\n\n4. For Part and MultiPart Operations, you have the option to send custom REST headers while calling the SF APIs:    \n\n```yaml\njacos:  \n sfdc:  \n  requestHeaders:  \n    exampleHeaderKey1: exampleHeaderValue1\n    exampleHeaderKey2 : exampleHeaderValue2\n```\n### Bulk Operation\n\nThe bulk operation is based on [Salesforce Bulk V2 REST API](https://developer.salesforce.com/docs/atlas.en-us.api_bulk_v2.meta/api_bulk_v2/introduction_bulk_api_2.htm).\n\nCreate the bean of BulkApi2Operations and invoking the Salesforce APIs\n\n```yaml\n@Autowired\nprivate BulkApi2Operations bulkApi2Operations;\n```\n\nBulkApi2Operations abstracts process of getting the access token from the refresh token and invoking the REST end points of Salesforce.\n\n```yaml\nOperationInfo operationInfo = new OperationInfo(\"\u003cObject type like Lead/Contact/Account/..\u003e\", OperationEnum.Insert/OperationEnum.Update/..,\"External Id mapping field\");\n```\n\n- OperationInfo is the place holder/class which contains the information regarding the operations.\n- External Id mapping field is the field used for performing Update/Upsert Operation on any Object. \n- Now you are done with all the prerequisites of invoking the Bulk Operation APIs. \n- All you need to do is just call the services offered by BulkApi2Operations.\n\n```yaml\nbulkApi2Operations.performSFOperation(operationInfo, \"Content in csv format\");\n      [example]: Content in csv format\n                 Ingest:\n                        \"Company_c,LastName_c,State\\n\" +\n                        \"March28TestComapany,March28TestName,Open\\n\"+\n                        \"March28TestComapany2,March28TestName2,Open\\n\";\n                 Update:\n                        \"Id,Company,LastName,State\\n\" +\n                        \"sfdc_id,March28TestComapany_v2,March28TestName_v2,Open\\n\";\n                 Delete:\n                        \"Id\\n\" +\n                        \"sfdc_id\";\n\n  bulkApi2Operations.performSFOperationFromFile(operationInfo, \"csv file path\");\n      [example]: File Content in csv format\n                 Ingest:\n                        Company,LastName,State\n                        April3TestComapany,April3TestName,Open\n                        April3TestComapany2,April3TestName2,Open\n                 * Note: Other operations are similar\n```\n\n### Part Operation\n\nThe part operation is based on [Salesforce sObject REST API](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_basic_info.htm)\n\nFor uploading data into Salesforce org record by record, use Part Operation API. To use Part Operation API, First autowire the PartApi2Operations object like\n\n```yaml\n@Autowired\nprivate PartApi2Operations partApi2Operations;\nForm an  OperationInfo object using OperationInfo constructor like the following:\n\nOperationInfo operationInfo = new OperationInfo(objectType, OperationEnum.valueOf(operationType.toUpperCase()), \"\u003ccontent as a json string\u003e\");\n\n```\n\nThe OperationInfo object contains various metadata info for some salesforce operation. The constructor of operation Info is as follows:\n\n```yaml\npublic OperationInfo(String objectType, OperationEnum operationType, String externalIdField)\n```\n- where objectType is the name of the object you are sending for insert / upsert / update. For example - Lead or Account\n- operationType is the enum denoting various operations which can have the values INSERT or UPDATE or UPSERT.\n- externalIdField is the id value for an update operation , null for an insert operation and \u003cfieldname\u003e:\u003cfieldvalue\u003e for an upsert operation.\n- To call the API to send a record to the salesforce org using Part API, invoke:\n\n```yaml\nresponse = partApi2Operations.performSFOperation(operationInfo, jsonBody);\n\n```\n\n### Multi Part Operation\n\nThe multi-part operation is based on [Salesforce sObject Collection REST API](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_sobjects_collections.htm)\n\n- For uploading data into Salesforce org record by record, use Part Operation API. \n- First autowire the PartApi2Operations object like:\n\n```yaml\n@Autowired\nprivate PartApi2Operations partApi2Operations;\nForm an  OperationInfo object using OperationInfo constructor like the following:\n\nOperationInfo operationInfo = new OperationInfo(null, OperationEnum.MULTIINSERT, null);\n```\n\n- The OperationInfo object contains various metadata info for some salesforce operation. The constructor of operation Info is as follows:\n\n```yaml\npublic OperationInfo(String objectType, OperationEnum operationType, String externalIdField)\n```\n\n- where objectType can be null for multi-record operations\n- operationType is the enum denoting various operations which can have the values MULTIINSERT or MULTIUPDATE .\n- externalIdField can be null for multi-record operations.\n\nTo call the API to send a record to the salesforce org using Part API , use:\n\n```yaml\nresponse = partApi2Operations.performSFOperation(operationInfo, jsonBody);\n```\n### Multi Part Operation using file\n\n- This operation read data from \u003ccode\u003einputFile\u003c/code\u003e and perform the part operation using salesforce composite API. \n- It splits input file into multiple chunks then each send it to SF using the composite API. \n- The number of records per chunk is decided based on the SF API limit (200) and can be changed using the CompositeUpdateReqFileSerializer while init.\n- Each SF operation status is written in outputFilePath with schema \"ID,STATUS,ERROR\"\n\n```yaml\n* @param operationInfo   contains the operation details. Supported types are MULTIINSERT or MULTIUPDATE.\n * @param inputFile       input file to process\n * @param outputFilePath  Path to write each operation output\n * @throws PartApiException\n *\n \npartApi2Operations.performSFOperation( operationInfo,  inputFile, outputFilePath)\n\n\n```\nNote: All header names in the input CSV should map to Salesforce API names.\n\n### Custom REST API Operation\n\nThe Custom REST API operation is based on [Exposing Salesforce Apex Classes as REST Web Services](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest.htm)\n\n- To call any custom REST api developed and exposed through Salesforce \n\n```java\n@Autowired\nprivate PartApi2Operations partApi2Operations;\n//Form an  OperationInfo object using OperationInfo constructor like the following:\n\nString metaDataJson = \"{ \\\"method\\\": \\\"GET\\\"}\";\n\nOperationInfo operationInfo = new OperationInfo(restUri, OperationEnum.CUSTOMRESTAPI, metaDataJson);\n```\n\n- The OperationInfo object contains various metadata info for some salesforce operation. The constructor of operation Info is as follows:\n\n```java\npublic OperationInfo(String restUri, OperationEnum operationType, String metaDataJson)\n```\n\n- where restUri is the relative REST URI path of the Custom REST API exposed through Salesforce\n- operationType is the enum denoting operation which should have the value CUSTOMRESTAPI .\n- metaDataJson should contain a json string which currently supports a mandatory field called method. The value of the method should be the HTTP method of the custom REST API.\n\nTo call the API to send a record to the salesforce org using Custom REST API , use:\n\n```java\nresponse = partApi2Operations.performSFOperation(operationInfo, jsonBody);\n```\n\n### Contributing\n\nWe welcome Your interest in the American Express Open Source Community on Github. Any Contributor to\nany Open Source Project managed by the American Express Open Source Community must accept and sign\nan Agreement indicating agreement to the terms below. Except for the rights granted in this \nAgreement to American Express and to recipients of software distributed by American Express, You\nreserve all right, title, and interest, if any, in and to Your Contributions. Please\n[fill out the Agreement](https://cla-assistant.io/americanexpress/jacos).\n\n### License\nAny contributions made under this project will be governed by the\n[Apache License 2.0](./LICENSE.txt).\n\n\n### Code of Conduct\nThis project adheres to the [American Express Community Guidelines](./CODE_OF_CONDUCT.md). \nBy participating, you are expected to honor these guidelines.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famericanexpress%2Fjacos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famericanexpress%2Fjacos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famericanexpress%2Fjacos/lists"}