Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- This totally ignores OAuth2 and from the source code of the library,
- it's hitting v29 of the SFDC API which I have to assume allows direct
- connections like this. I've been away from Salesforce for 4 years now, but
- I'm sort of suprised credetials like this are still OK for org access
- """
- import json
- import uuid
- from simple_salesforce import Salesforce
- sf = Salesforce(username={thing1},
- password={thing2},
- security_token={oooh a secret...in a script??})
- record = sf.Contact.create({'LastName': str(uuid.uuid4()), 'Email': 'testing@foo.com'})
- print("Record created....here's proof:")
- print(record)
- properties = list(record.items())
- id = properties[0][1]
- print("Dat Contact Id <<< {} >>>".format(id))
- raw_record = sf.Contact.get(id)
- print("Raw SFDC data:")
- print(raw_record)
- output = json.dumps(raw_record, indent=4, sort_keys=True)
- print("Finally, JSON output:")
- print(output)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement