Get URL for Salesforce Lead (Python Beatbox SOAP API)

243 Views Asked by At

I'm using Beatbox to access Salesforce's SOAP API. I can query for a series of Leads—

SELECT Id FROM Lead

Does anyone know how I can create a URL to view each Lead on the website?

2

There are 2 best solutions below

1
On BEST ANSWER

You need to find out the URL of your instance (naX.salesforce.com) and generate a link pointing to:

http://naX.salesforce.com/<leadId>

If the user is not logged in it will ask for credentials and redirect him after the login is completed.

0
On

You can get the URL of your Salesforce instance from Beatbox. Assuming you started out connecting with something like this:

#!/usr/bin/env python3
from urllib.parse import urlparse
import beatbox
svc = beatbox.Client()

Get the URL here:

svc._Client__serverUrl

Format it a bit:

print('{}://{}/'.format(
    urlparse(svc._Client__serverUrl).scheme,
    urlparse(svc._Client__serverUrl).netloc)
)

Sample output:

https://na59.salesforce.com/