- Step1.
通过Request获取accessToken。
HttpMethod:POST
RequestUrl:https://login.salesforce.com/services/oauth2/token
Parameters:
1 content-type:application/x-www-form-urlencoded 2 grant_type:password 3 client_id:app_client_id 4 client_secret:app_client_secret 5 username:username 6 password:password+Security Token 7 redirect_uri:https://localhost/oauth_callback.php
Response
1 { 2 "access_token": "access_token", 3 "instance_url": "https://instance.salesforce.com", 4 "id": "orgId", 5 "token_type": "Bearer", 6 "issued_at": "issued_at",
7 "signature": ""
8 }
- Step2.
复制access_token,构造request如下
"Url":"https://instance.salesforce.com/services/apexrest/interfacepath"
"Method":"HttpMethod"
"content-type":application/json
"authorization":"Bearer access_token"