条带API请求与邮递员一起工作,但与Apex Rest Callout一起失败
我正在尝试使用Apex对条带Api进行调用。我在Postman中使用相同的Http配置发出了完全相同的请求,并且工作正常。但是当使用Apex运行它时,我得到一个Http 400(错误请求),并显示以下错误消息:条带API请求与邮递员一起工作,但与Apex Rest Callout一起失败,rest,http,salesforce,stripe-payments,apex,Rest,Http,Salesforce,Stripe Payments,Apex,我正在尝试使用Apex对条带Api进行调用。我在Postman中使用相同的Http配置发出了完全相同的请求,并且工作正常。但是当使用Apex运行它时,我得到一个Http 400(错误请求),并显示以下错误消息: { "error": { "message": "This property cannot be expanded (data).", "type": "invalid_req
{
"error": {
"message": "This property cannot be expanded (data).",
"type": "invalid_request_error"
}
}
我想做的是从stripe查询一个支付意图列表,并展开存储在支付费用数据中的余额事务。我是这样做的
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setHeader('Authorization', 'Bearer Token');
request.setHeader('Content-Type', 'application/x-www-form-urlencoded');
String payload = 'expand[]=data.charges.data.balance_transaction';
request.setMethod('GET');
request.setEndpoint(API_ENDPOINT + '/v1/payment_intents');
request.setBody(payload);
HttpResponse response = http.send(request);
System.debug(response.getBody());
有人能帮我理解我这里缺少什么吗?试试
扩展[]=charges.data.balance\u transaction
。不起作用,抱歉