0
即時通訊新的調用第三方的API,我面臨的問題時,請求貝寶獲取安全令牌。貝寶付款整合與銷售隊伍
我使用構造這樣做..
公衆共享類payPalCallouts { 公共字符串reqBody {獲得;設置;}
public payPalCallouts(){
http h = new http();
httpRequest req = new httpRequest();
req.setEndpoint('https://api.sandbox.paypal.com/v1/oauth2/token');
reqBody = 'client_id={client-Id}&secret={secret}';
req.setHeader('grant_type','client_credentials');
req.setHeader('content-type','application/x-www-form-urlencoded');
req.setMethod('POST');
req.setBody(reqBody);
HttpResponse res = h.send(req);
}
}
我響應了日誌...
錯誤消息:System.HttpResponse [Status = Not Acceptable,StatusCode = 406]
在此先感謝我期待您的迴應:)