{"id":17303991,"url":"https://github.com/owainlewis/salesforce","last_synced_at":"2025-10-04T22:59:43.371Z","repository":{"id":49627670,"uuid":"9758450","full_name":"owainlewis/salesforce","owner":"owainlewis","description":"A Clojure library for interacting with Salesforce.com","archived":false,"fork":false,"pushed_at":"2023-12-06T11:43:10.000Z","size":68,"stargazers_count":49,"open_issues_count":4,"forks_count":45,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-09-02T02:46:07.089Z","etag":null,"topics":["salesforce","salesforce-api"],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/owainlewis.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-04-29T21:31:54.000Z","updated_at":"2025-06-06T17:01:46.000Z","dependencies_parsed_at":"2023-12-06T12:38:26.754Z","dependency_job_id":"4fd31cc6-cdf4-41b1-adb6-0f2ff244fbc4","html_url":"https://github.com/owainlewis/salesforce","commit_stats":{"total_commits":79,"total_committers":11,"mean_commits":7.181818181818182,"dds":"0.49367088607594933","last_synced_commit":"85b61bb813b6e226e691935cb81b13704e8780db"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/owainlewis/salesforce","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owainlewis%2Fsalesforce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owainlewis%2Fsalesforce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owainlewis%2Fsalesforce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owainlewis%2Fsalesforce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/owainlewis","download_url":"https://codeload.github.com/owainlewis/salesforce/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owainlewis%2Fsalesforce/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278380880,"owners_count":25977292,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["salesforce","salesforce-api"],"created_at":"2024-10-15T11:51:52.853Z","updated_at":"2025-10-04T22:59:43.356Z","avatar_url":"https://github.com/owainlewis.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Salesforce\n\nThis is an up to date wrapper for the Salesforce.com REST API. I initially found working with\nthe API to be a bit frustrating and hopefully this wrapper will make everything easy for you.\n\nMore information about the Salesforce REST API can be found at\n\n[http://www.salesforce.com/us/developer/docs/api_rest/](http://www.salesforce.com/us/developer/docs/api_rest/)\n\n## Build\n\n[![Clojars Project](https://img.shields.io/clojars/v/com.owainlewis/salesforce.svg)](https://clojars.org/com.owainlewis/salesforce)\n\n[![CircleCI](https://circleci.com/gh/owainlewis/salesforce.svg?style=svg)](https://circleci.com/gh/owainlewis/salesforce)\n\n\n## Usage\n\nWe first need to set up some authentication information as a Clojure map. All the information can be found in your Salesforce account.\n\nIn order to get an auth token and information about your account we call the auth! function\nlike this\n\n```clojure\n(use 'salesforce.core)\n\n(def config\n  {:client-id \"\"\n   :client-secret \"\"\n   :username \"\"\n   :password \"\"\n   :security-token \"\"})\n\n(def auth-info (auth! config))\n```\nYou can optionally pass in :login-host if you want to use test.salesforce.com or my.salesforce.com addresses\n\nThis returns a map of information about your account including an authorization token that will allow you to make requests to the REST API.\n\nThe response looks something like this\n\n```clojure\n{:id \"https://login.salesforce.com/id/1234\",\n :issued_at \"1367488271359\",\n :instance_url \"https://na15.salesforce.com\",\n :signature \"1234\",\n :access_token \"1234\"}\n```\n\nNow you can use your auth-config to make requests to the API.\n\n```clojure\n(resources auth-info)\n```\n\n## Setting the API version\n\nThere are multiple versions of the Salesforce API so you need to decare the version you want to use.\n\nYou can easily get the latest API version with the following function\n\n```clojure\n(latest-version) ;; =\u003e \"39.0\"\n```\n\nYou can set a version in several ways.\n\nGlobally\n\n```clojure\n(set-version! \"39.0\")\n```\n\nInside a macro\n\n```clojure\n(with-version \"39.0\"\n  ;; Do stuff here )\n\n```\n\nOr just using the latest version (this is slow as it needs to make an additional http request)\n\n```clojure\n(with-latest-version\n  ;; Do stuff here)\n```\n\n## SObjects\n\nThe following methods are available\n\n+ so-\u003eall\n+ so-\u003eget\n+ so-\u003ecreate\n+ so-\u003eupdate\n+ so-\u003edelete\n+ so-\u003edescribe\n\nGet all sobjects\n\n```clojure\n(so-\u003eobjects auth-info)\n```\n\nGet all records\n\n```clojure\n(so-\u003eall \"Account\" auth-info)\n```\n\nGet recently created items\n\n```clojure\n(so-\u003erecent \"Account\" auth-info)\n```\n\nGet a single record\n\n```clojure\n;; Fetch all the info\n(so-\u003eget \"Account\" \"001i0000007nAs3\" auth-info)\n;; Fetch only the name and website attributes\n(so-\u003eget \"Account\" \"001i0000007nAs3\" [\"Name\" \"Website\"] auth-info))\n```\n\nCreate a record\n\n```clojure\n(so-\u003ecreate \"Account\" {:Name \"My Account\"} auth-info)\n```\n\nUpdate a record\n\n```clojure\n(so-\u003eupdate \"Account\" \"001i0000007nAs3\" {:Name \"My New Account Name\"} auth-info)\n```\n\nDelete a record\n\n```clojure\n(so-\u003edelete \"Account\" \"001i0000008Ge2OAAS\" auth-info)\n```\n\nDescribe an record\n\n```clojure\n(so-\u003edescribe \"Account\" auth-info)\n```\n\n## Salesforce Object Query Language\n\nSalesforce provides a query language called SOQL that lets you run custom queries on the API.\n\n```clojure\n(soql \"SELECT name from Account\" auth-info)\n```\n\nSalesforce provides a search language called SOSL that lets you run custom searches on the API.\n\n```clojure\n(sosl \"FIND {Joe Smith} IN Name Fields RETURNING lead\" auth-info)\n```\n\n## A sample session\n\nThis final example shows an example REPL session using the API\n\n```clojure\n\n(def config\n  {:client-id \"\"\n   :client-secret \"\"\n   :username \"\"\n   :password \"\"\n   :security-token \"\"})\n\n;; Get auth info needed to make http requests\n(def auth (auth! config))\n\n;; Get and then set the latest API version globally\n(set-version! (latest-version))\n\n;; Now we are all set to access the salesforce API\n(so-\u003eobjects auth)\n\n;; Get all information from accounts\n(so-\u003eall \"Account\" auth)\n\n;; Fetch a single account\n(so-\u003eget \"Account\" \"001i0000008Ge2TAAS\" auth)\n\n;; Create a new account\n(so-\u003ecreate \"Account\" {:Name \"My new account\"} auth)\n\n;; Update the account\n(so-\u003eupdate \"Account\" \"001i0000008JTPpAAO\" {:Name \"My Updated Account Name\"} auth)\n\n\n;; Delete the account we just created\n(so-\u003edelete \"Account\" \"001i0000008JTPpAAO\" auth)\n\n;; Finally use SOQL to find account information\n(:records (soql \"SELECT name from Account\" auth))\n\n;; You can also pass a clojure java.jdbc array to the soql query\n;; The classes on the array will be serialized following the SOQLable protocol, which can be extended in your program.\n(soql [\"select * from fruits where name = ? and price \u003e= ? and created = ?\" \"apple\" 9/5 (java.time.LocalDate/of 2020 10 10)] auth)\n```\n\n## Contributors\n\n+ Owain Lewis\n+ Rod Pugh\n+ Lucas Severo\n\n## License\n\nDistributed under the Eclipse Public License, the same as Clojure.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowainlewis%2Fsalesforce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fowainlewis%2Fsalesforce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowainlewis%2Fsalesforce/lists"}