Python Forum
Access my organization Salesforce and read report - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/Forum-Python-Coding)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/Forum-Web-Scraping-Web-Development)
+--- Thread: Access my organization Salesforce and read report (/Thread-Access-my-organization-Salesforce-and-read-report)



Access my organization Salesforce and read report - DannyPt - Jun-24-2019

Hi guys,

I am trying to create a program that would read a report from my organization's salesforce.
We work with cases in salesforce and the idea is to read the report from it and then show if a case has appear or if disappeared.

I think that i will have some issues with the login because my organization uses Salesforce main page but then it goes to another login page that is my organization page.

To summarize the login this is how it seems to work:

Salesforce login page -> My organization login page -> if successful goes back to salesforce login page and does the login.

Can someone give me some clues on how to do it?

I have read the simple-salesforce package, but it always askes for the token or the organization id, and i don't have both of them and i don't even know if i can request/reset my token, it doesn't appear any token in the "Reset Token" page.

Thanks


RE: Access my organization Salesforce and read report - DannyPt - Jun-24-2019

I was thinking on another approach for this issue that would be using the login from the web browser.

The user would have to login in their web browser and then python would use that cookie to maintain the login.

Is it possible?


RE: Access my organization Salesforce and read report - micseydel - Jun-30-2019

Really what you should be able to do is simply use their API and get a token from your organization for it. It sounds like you're automating something, they should be more than happy to help.

If you don't work at a company which does the right things, you would have to resort to mechanize or Selenium to simulate / control a web browser.

Alternatively, you can use web browser developer tools to reverse-engineer whatever requests are happening and then just code that up (this isn't always an option). It could be as simple as grabbing the cookie out of your web browser and then using it to replicate whatever calls are of interest to you.