You need to sign in to do that
Don't have an account?
Per Støvring Sørensen
'Raw' URL to use REST API
I want to use a 'raw' URL to send a REST API call to SFDC e.g.:
https://my_salesforce_instance.com/services/data/v47.0/query?q=SELECT+id,name+FROM+user+WHERE+Alias='ebrow'&Bearer=<Token Value>
but I am getting "Invalid Session ID". Naturally I have verified the <Token Value> using PowerShell to initiate the call.
Is there a way/syntax where I can contain all the required information in a URL string so I can do the call directly from my browser?
https://my_salesforce_instance.com/services/data/v47.0/query?q=SELECT+id,name+FROM+user+WHERE+Alias='ebrow'&Bearer=<Token Value>
but I am getting "Invalid Session ID". Naturally I have verified the <Token Value> using PowerShell to initiate the call.
Is there a way/syntax where I can contain all the required information in a URL string so I can do the call directly from my browser?
The TARGETUSERNAME can be an ALIAS by opening a browser with force:auth:web:login previously.
C:\> sfdx auth:web:login -a SETALIAS -r INSTANCEURL
Example :
C:\>sfdx force:auth:web:login -a SANDBOX1 --instanceurl=https://test.salesforce.com ( open a browser, enter your user/password and allow )
Successfully authorized <your user name> with org ID <your id>
You may now close the browser
C:\>sfdx force:org:list (quite slow, check, connected for the alias name)
C:\>sfdx force:data:soql:query -u SANDBOX1 -q "select id,name from account limit 10"
Installation of the SFDX CLI: https://developer.salesforce.com/tools/sfdxcli
1) You need Salesforce API Library for JavaScript applications (both on Node.js and web browser) http://jsforce.github.io/ (http://jsforce.github.io/)
https://github.com/jsforce/jsforce
2) From a browser, but with an already connected user on Salesforce ( just UserInfo.getSessionID() in Apex )
https://github.com/regularcoder/deepfield/blob/master/classes/DeepFieldController.cls
2) The problem of the workbench (PHP) is that it is a connected app already known by all the orgs that can use a OAUTH process login directly.
private function oauthProcessLogin($code, $hostName, $apiVersion, $startUrl) {
https://github.com/forceworkbench/forceworkbench/blob/master/workbench/controllers/LoginController.php
https://github.com/forceworkbench/forceworkbench/tree/master/workbench/soapclient