| CARVIEW |
Select Language
HTTP/1.1 200 OK
Connection: keep-alive
Server: nginx/1.24.0 (Ubuntu)
Content-Type: text/html; charset=utf-8
Cache-Control: public, max-age=300
Content-Encoding: gzip
Via: 1.1 varnish, 1.1 varnish
Accept-Ranges: bytes
Age: 0
Date: Sun, 18 Jan 2026 01:29:21 GMT
X-Served-By: cache-dfw-kdfw8210114-DFW, cache-bom-vanm7210086-BOM
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1768699761.213047,VS0,VE758
Vary: Accept, Accept-Encoding
transfer-encoding: chunked
hsforce: Salesforce API Client
[Skip to Readme]
hsforce: Salesforce API Client
This package provides bindings to Salesforce API https://github.com/tzmfreedom/hsforce#readme
[Skip to Readme]
Downloads
- hsforce-0.1.0.1.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
| Versions [RSS] | 0.1.0.0, 0.1.0.1 |
|---|---|
| Change log | ChangeLog.md |
| Dependencies | aeson (>=1.4.2 && <1.5), base (>=4.7 && <5), bytestring (>=0.10.8 && <0.11), fast-tagsoup (>=1.0.14 && <1.1), HaXml (>=1.25.4 && <1.26), http-conduit (>=2.3.4 && <2.4), network-uri (>=2.6.1 && <2.7), regex-posix (>=0.95.2 && <0.96), tagsoup (>=0.14.7 && <0.15), template-haskell (>=2.14.0 && <2.15), text (>=1.2.2 && <1.3), unordered-containers (>=0.2.7 && <0.3), uri-encode (>=1.5.0 && <1.6) [details] |
| License | BSD-3-Clause |
| Copyright | 2019 Makoto Tajitsu |
| Author | Makoto Tajitsu |
| Maintainer | makoto_tajitsu@hotmail.co.jp |
| Uploaded | by tzmfreedom at 2019-03-04T05:56:27Z |
| Category | Web |
| Home page | https://github.com/tzmfreedom/hsforce#readme |
| Bug tracker | https://github.com/tzmfreedom/hsforce/issues |
| Source repo | head: git clone https://github.com/tzmfreedom/hsforce |
| Distributions | |
| Downloads | 1061 total (8 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs available [build log] Last success reported on 2019-03-04 [all 1 reports] |
Readme for hsforce-0.1.0.1
[back to package description]hsforce
Usage
Login and create Salesforce client.
main :: IO ()
main = do
username <- getEnv "SALESFORCE_USERNAME"
password <- getEnv "SALESFORCE_PASSWORD"
endpoint <- getEnv "SALESFORCE_ENDPOINT"
version <- getEnv "SALESFORCE_VERSION"
client <- login username password endpoint version
create data type that is SObject class.
import Data.Aeson as JSON
import Data.Maybe
data Account = Account{
sfid :: Maybe String,
name :: Maybe String,
ex :: Maybe String
} deriving Show
instance SObject Account where
typeName a = "Account"
getSfid = fromJust . sfid
instance FromJSON Account where
parseJSON = withObject "Account" $ \v -> do
sfid <- v .: "Id"
name <- v .:? "Name"
ex <- v .:? "Ex__c"
return Account{..}
instance ToJSON Account where
toJSON (Account{sfid, name, ex}) =
object ["Name" .= name]
CRUD API
-- insert object
insert client Account{sfid = Nothing, name = Just "hogehoge", ex = Nothing}
-- update object
update client Account{sfid = Just "xxxx", name = Just "foobar"}
-- upsert object
upsert client Account{sfid = Nothing, name = Just "foobar", ex = Just "aaa"} "Ex__c" "aaa"
-- delete object
delete client Account{sfid = Just "xxxx"}
-- query
query client "SELECT Id, Name FROM Account WHERE Name = 'foobar'" (Proxy :: Proxy Account)
-- queryMore
queryMore client "/services/data/v20.0/query/01gD0000002HU6KIAW-2000" (Proxy :: Proxy Account)
-- queryAll
queryAll client "SELECT Id, Name FROM Account WHERE Name = 'foobar'" (Proxy :: Proxy Account)
-- queryAllMore
queryAllMore client "/services/data/v20.0/queryMore/01gD0000002HU6KIAW-2000" (Proxy :: Proxy Account)
-- explain
explain client "SELECT Id FROM Account"
-- describe
describe client "Account" (Proxy :: Proxy Account)
-- describeDetail
describeDetail client "Account"
-- describeGlobal
describeGlobal client
-- recordCount
recordCount client ["Account", "Contact", "Opportunity"]
-- versions
versions client