Skip to main content

A simple library to interact with Salesforce REST API using OAuth 2.0 Client Credentials Flow.

Project description

SalesforceRESTAPI

A simple Python library to interact with the Salesforce REST API using OAuth 2.0 Client Credentials Flow.

Features

  • Authenticate with Salesforce using OAuth 2.0 Client Credentials
  • Basic CRUD operations (create, read, update, delete) for Salesforce objects
  • SOQL query support
  • Apex script execution via Tooling API
  • Record verification utilities

Installation

pip install SalesforceRESTAPI

Usage

from SalesforceRESTAPI import ArcSalesforceAPI

# Initialize the API client
sf = ArcSalesforceAPI()

# Authenticate
sf.authenticate(client_id='YOUR_CLIENT_ID', client_secret='YOUR_CLIENT_SECRET')

# Create a record
account_id = sf.create_record('Account', Name='Test Account', Industry='Technology')

# Get a record
account = sf.get_record('Account', account_id)

# Update a record
sf.update_record('Account', account_id, Name='Updated Name')

# Delete a record
sf.delete_record('Account', account_id)

# Run a SOQL query
results = sf.queryRecords('SELECT Id, Name FROM Account')

# Execute anonymous Apex
apex_result = sf.execute_apex('System.debug("Hello World");')

# Revoke authentication
sf.revoke()

Requirements

  • Python 3.6+
  • requests

License

MIT License. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

salesforcerestapi-0.1.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

salesforcerestapi-0.1.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file salesforcerestapi-0.1.1.tar.gz.

File metadata

  • Download URL: salesforcerestapi-0.1.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for salesforcerestapi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 67f7e65b18ead3589bd8b61485a1856dd1c2c5c6c1a6edff43e6bf21bdb7189e
MD5 5b1de2f6ecbf3946b79844dd6737e84d
BLAKE2b-256 9a6d6d486202ef99d28722b40045e094207fa8423283fcdc337c3e222a14f2ec

See more details on using hashes here.

File details

Details for the file salesforcerestapi-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for salesforcerestapi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7a416e8aae49be9951d8929d3d3bd226e927f1f03f20f820b1c14203b07c9c09
MD5 7dfb599383abbe9be6442dbb066b80f0
BLAKE2b-256 b57e2ebe815ef8d52523aaa3fb8bf583bea72c93a8f04ff1e21f5d6a864c43d7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page