Generate Salesforce Postman Collection (with auto-obtained refresh token)
sf_generate_postman_collectionCreates an import-ready Postman collection for your Salesforce org, auto-obtaining an OAuth2 refresh token and embedding credentials for immediate use with sample REST and service requests.
Instructions
Creates a complete, import-ready Postman collection for your Salesforce org:
Auto-obtains a refresh token using the username+password flow (no browser).
Bakes ALL credentials into the collection (collection variables + OAuth2 config).
Saves the .postman_collection.json to disk.
Returns a ready_for_quickstart block — call sf_quickstart immediately after, or save the file path and use sf_import_postman_credentials any time later.
The generated collection includes: • Password flow, auth-code flow (Steps 1–3), and refresh-token requests • Test scripts that auto-save tokens to collection variables on every response • Salesforce REST API folder (validate, list SObjects, SOQL, create Account) • Ballerina service folder (health check, Account CRUD via local service)
This is the recommended first step — run it once, reuse the collection forever.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sf_client_id | Yes | Salesforce Connected App Consumer Key (Client ID) | |
| sf_client_secret | Yes | Salesforce Connected App Consumer Secret (Client Secret) | |
| sf_base_url | Yes | Salesforce org instance URL, e.g. https://myorg.my.salesforce.com (sandbox auto-detected from hostname) | |
| username | Yes | Salesforce username (email). Used to auto-obtain a refresh token via the password flow. | |
| password | Yes | Salesforce password. Append your security token if required: myPassword + ABC123 → myPasswordABC123 | |
| redirect_uri | No | Redirect URI registered in your Connected App (also written into the collection). | https://login.salesforce.com/services/oauth2/success |
| collection_name | No | Display name for the Postman collection (default: 'Salesforce Integration'). | Salesforce Integration |
| output_path | No | Where to save the .postman_collection.json. Defaults to ~/WSO2Integrator/<collection_name>.postman_collection.json |