Reputation: 31
Given an existing report on SalesForce that I created, can I update the content of the report using simple_salesforce package in python?
# A Pseudo code to get the expected result
from simple_salesforce import Salesforce
sf = Salesforce(username='my_user_name',
password='my_password',
security_token='my_security_token')
export_url = "link to the report I want to change"
session = requests.Session()
response = requests.get(export_url,
headers=sf.headers,
cookies={'sid': sf.session_id})
# this part is pseudo-code, for instance, I want to change a column of the report, I change it and then upload the new version as the current report
response.update(response, data)
Upvotes: 0
Views: 468
Reputation: 19637
You're bit out of Simple's comfort zone. You don't manipulate data, you don't even use restful
call for "normal" API operations. You just (ab)use simple's login functionality to get the session id and pretend you're a browser. So you can experiment with requests below in Postman for example and then go back to your Python program.
I wonder if you're overcomplicating it. Are you sure you absolutely need a report?
simple
might not be best tool for the task, sfdx
might fare better.Upvotes: 1