Skip to content

Commit 26e9d70

Browse files
committed
Added README.me
1 parent 3b54345 commit 26e9d70

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# salesforce-python
2+
3+
salesforce-python is an API wrapper for Sales written in Python
4+
5+
## Installing
6+
```
7+
pip install git+git://github.com/GearPlug/salesforce-python.git
8+
```
9+
10+
## Usage
11+
```
12+
from salesforce.client import Client
13+
14+
client = Client('CLIENT_KEY', 'CLIENT_SECRET', 'https://na50.salesforce.com/', 'v41.0')
15+
```
16+
17+
Get authorization url
18+
```
19+
url = client.authorization_url('REDIRECT_URI')
20+
```
21+
22+
Exchange the code for a token
23+
```
24+
token = client.exchange_code('REDIRECT_URI', 'CODE')
25+
```
26+
27+
Set the token
28+
```
29+
client.set_access_token('TOKEN')
30+
```
31+
32+
Refresh the token
33+
```
34+
new_token = client.refresh_token()
35+
```
36+
37+
Get user information
38+
```
39+
user = client.get_user_info()
40+
```
41+
42+
Get API versions
43+
```
44+
user = client.get_versions()
45+
```
46+
47+
Get all resources by the version specified in the client instantiation.
48+
```
49+
versions = client.get_versions()
50+
```
51+
52+
Get all objects described
53+
```
54+
metadata = client.get_describe_global()
55+
```
56+
57+
Get an object
58+
```
59+
object = client.get_sobject('Lead)
60+
```
61+
62+
Create an object
63+
```
64+
data = {'LastName': 'Doe', 'IsConverted': 'False', 'Status': 'Open - Not Contacted', 'IsUnreadByOwner': 'False', 'Company': 'NA', 'FirstName': 'John'}
65+
response = client.create_sobject('Lead', data)
66+
```
67+
68+
Get an object described
69+
```
70+
metadata = client.get_sobject_describe('Lead')
71+
```
72+
73+
## Requirements
74+
- requests

0 commit comments

Comments
 (0)