This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jwt | |
import requests | |
import datetime | |
from simple_salesforce import Salesforce | |
from simple_salesforce.exceptions import SalesforceAuthenticationFailed | |
def jwt_login(consumer_id, username, private_key, sandbox=False): | |
endpoint = 'https://test.salesforce.com' if sandbox is True else 'https://login.salesforce.com' | |
jwt_payload = jwt.encode( | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Usage: | |
1. Define a NetSuite environment in Postman (https://www.getpostman.com/docs/postman/environments_and_globals/manage_environments) | |
with the following keys set: account, consumerKey, consumerSecret, tokenId, tokenSecret | |
2. Add this script to your "Pre Request Script" in Postman (https://www.getpostman.com/docs/postman/scripts/pre_request_scripts) | |
3. Add the Token Passport in your request with variable placeholders |