{"id":15178568,"url":"https://github.com/mideo/salesforce-api-client","last_synced_at":"2025-10-01T19:30:37.804Z","repository":{"id":57721534,"uuid":"61395064","full_name":"MideO/salesforce-api-client","owner":"MideO","description":"Salesforce  client ","archived":true,"fork":false,"pushed_at":"2017-08-20T11:35:00.000Z","size":213,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2024-12-06T19:35:46.738Z","etag":null,"topics":["ant","groovy","jar","salesforce","salesforce-metadata","salesforce-rest-api","salesforce-soap-api"],"latest_commit_sha":null,"homepage":"","language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MideO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-17T18:42:28.000Z","updated_at":"2024-05-22T14:47:04.000Z","dependencies_parsed_at":"2022-09-26T21:50:17.338Z","dependency_job_id":null,"html_url":"https://github.com/MideO/salesforce-api-client","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MideO%2Fsalesforce-api-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MideO%2Fsalesforce-api-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MideO%2Fsalesforce-api-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MideO%2Fsalesforce-api-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MideO","download_url":"https://codeload.github.com/MideO/salesforce-api-client/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234892715,"owners_count":18902907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ant","groovy","jar","salesforce","salesforce-metadata","salesforce-rest-api","salesforce-soap-api"],"created_at":"2024-09-27T15:05:32.415Z","updated_at":"2025-10-01T19:30:37.468Z","avatar_url":"https://github.com/MideO.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# salesforce-api-client\n\n[![Build Status](https://travis-ci.org/MideO/salesforce-api-client.svg?branch=master)](https://travis-ci.org/MideO/salesforce-api-client)\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.mideo/salesforce-api-client/badge.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.github.mideo%22%20a%3A%22salesforce-api-client%22)\n\n\n### Setup dependency\n\nJDK \"1.8\"\n\n#### In build.gradle\n\n##### Add maven url\n```groovy\nrepositories {\n    mavenCentral()\n}\n\n```\n\n##### Add dependency\n```groovy\ndependencies {\n    compile group: 'com.github.mideo', name:'salesforce-api-client', version: '0.0.2'\n}\n```\n\n##### Usage\n```Java\nSalesforceConfig config = new SalesforceConfig(\"https://test.salesforce.com\")\n                .clientId(\"dfghjkl\")\n                .clientSecret(\"fdghjkl;\")\n                .userName(\"a@b.com\")\n                .userToken(\"gfhjk\")\n                .password(\"fghjkl\");\nSalesforceConnectionClient connectionClient = new SalesforceConnectionClient(config);\nSalesforceWebServiceClient webClient = new SalesforceWebServiceClient(connectionClient);\n\n//Create sObject from POJO\nclass Account {\n        def name;\n        def email;\n        def id;\n}\n\nAccount account = new Account();\naccount.name =  \"testName bazz\";\naccount.email =  \"x@y.com\";\naccount.id = webClient.createObject(\"Account\", account);\n\n\n//Update sObject from POJO\nAccount account = new Account();\naccount.name =  \"testName2 bazzer\";\naccount.email =  \"acb@xys.com\";\nString result = webClient.updateObject(\"Account\",account.id,  account);\n\n\n//Create sObject from HashMap\nMap\u003cString,Object\u003e logData = new HashMap\u003c\u003e();\nlogData.put(\"Short_Description__c\",\"Api test\"+ DateTime.now().toString());\nlogData.put(\"Description__c\",\"test description Api test\"+ DateTime.now().toString()) \nString id = webClient.createObject(\"Log__c\", logData);\n\n            \n//Update sObject from HashMap\nlogData.put(\"Exception_Type__c\",\"dummyEx\"+ DateTime.now().toString());\nresult = webClient.updateObject(\"Log__c\",id, logData);\n\n\n//Retrieve Object\nMap\u003cString, Object\u003e resultMap = webClient.retrieveObject(\"Case\", caseId);\n            \n            \n//Delete sObject\nString result = webClient.deleteObject(contactId);\n\n                        \n//Execute Anonymous Apex \nExecuteAnonymousResult exectueResult = webClient.executeApexBlock(\"System.debug('test debug message');\");\n\n\n//Export data\nList\u003cMap\u003cString, String\u003e\u003e dataList = webClient\n                                    .setPublishStatusCheckTimeout(10000)\n                                    .exportDataFromTable(\"Account\");\n\n\n//Publish csv stream to sObject via bulk api\nPublishResult publishResult = webClient.publishCsvToTable(csvInputStream, \"Contact\");\n\n//Get published data status\nString status = getPublishedDataStatus(\n                        publishResult.jobInfo.getId, \n                        publishResult.batchInfo.getId\n                            );\n            \n//Export filtered data\nMap\u003cString,String\u003e filter = new HashMap\u003c\u003e();\nfilter.put(\"Product__c\",\"DummyBox\");\nfilter.put(\"Delivered\",true);\nList\u003cMap\u003cString, String\u003e\u003e dataList = webClient.exportDataFromTable(\"Order__c\", filter);\n\n\n//Export filtered data columns\nMap\u003cString,String\u003e filter = new HashMap\u003c\u003e();\nfilter.put(\"Product__c\",\"DummyBox\");\nfilter.put(\"Delivered\",true);\nList\u003cString\u003e columns = new ArrayList\u003c\u003e();\ncolumns.add(\"Short_Description__c\");\ncolumns.add(\"Description__c\");\nList\u003cMap\u003cString, String\u003e\u003e dataList = webClient.exportDataFromTable(\"Order__c\", columns, filter);\n\n```\n\n\n## Ant Tasks\n```Java\n\nRetrieving sObjects to csv \nDefine config json {\u003csObjectName\u003e: [\u003ccomma seperated list of columns\u003e]}\n\ne.g. conf.json\n    {\n        \"Settings__c\" : [\"Name\",\"Value__c\"],\n        \"Account\": [\"Name\",\"Email\"]\n    }\nIn build.xml\n\u003cproject name=\"Sample usage of Salesforce Ant tasks\" xmlns:sfApi=\"antlib:com.github.mideo.salesforce\"\u003e\n\u003ctaskdef resource=\"com/github/mideo/salesforce/antlib.xml\"  \n             uri=\"antlib:com.github.mideo.salesforce\" \n             classpath=\"lib/salesforce-api-client-0.0.1-SNAPSHOT.jar\"/\u003e\n\u003c!-- persistSObjectToCSV data to csv files   --\u003e\n\u003ctarget name=\"persistSObjectToCSV\" description=\"Retrieve Custom Settings to SFDC\"\u003e\n       \u003csfApi:persistSObjectToCSV \n        configFileName=\"conf.json\"\n        csvFilesRelativePath=\"config/customSettings\"\n        userName=\"${sf.username}\" \n        password=\"${sf.password}\" \n        serverUrl=\"${sf.serverurl}\" \n        /\u003e\n\u003c/target\u003e\n\n \nPublishing/Dataload csv files from directory to sObject\n\nIn build.xml\n\u003ctaskdef resource=\"com/github/mideo/salesforce/antlib.xml\"  \n         uri=\"antlib:com.github.mideo.salesforce\" \n         classpath=\"lib/salesforce-api-client-0.0.1-SNAPSHOT.jar\"/\u003e \n    \n    \u003c!-- publishCSV data to sfdc   --\u003e\n\u003ctarget name=\"publishCSV\" description=\"Publish Custom Settings to SFDC\"\u003e\n       \u003csfApi:publishCSV \n        csvFilesRelativePath=\"config/settings\"\n        userName=\"${sf.username}\" \n        password=\"${sf.password}\" \n        serverUrl=\"${sf.serverurl}\" \n       /\u003e\n\u003c/target\u003e\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmideo%2Fsalesforce-api-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmideo%2Fsalesforce-api-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmideo%2Fsalesforce-api-client/lists"}