我试图通过执行一些ZOQL。
我参考了ZOQL文档,并使用REST端点v1/action/ 这来执行ZOQL。
首先,我尝试了一个非常简单的请求,并得到了结果。
{
"queryString": "select AccountId, FirstName, LastName from contact"
}现在,我尝试使用星号查询,如下所示
{
"queryString": "select * from contact"
}但我犯了个错误
{
"faultcode": "fns:MALFORMED_QUERY",
"faultstring": "You have an error in your ZOQL syntax",
"detail": {
"MalformedQueryFault": {
"FaultCode": "MALFORMED_QUERY",
"FaultMessage": "You have an error in your ZOQL syntax"
}
}
}在这里中,我发现ZOQL支持星号。对于涉及多个对象的ZOQL,我甚至得到了相同的错误。喜欢
SELECT Subscription.Name, Account.Name FROM Subscription WHERE Subscription.Status='Active' AND DefaultPaymentMethod.CreditCardType='Visa'上述查询在Zuora SOAP API中也不起作用。
如何在Zuora或Zuora中使用星号执行查询?
发布于 2016-11-22 07:18:17
发布于 2018-07-17 15:17:28
在查询中使用*是因为:
1)您想要所有可用的字段
或
2)您想知道哪些字段是可用的。
对于后一种情况,请使用REST服务的描述函数,如下所示:
https://{servicename}.zuora.com:####/v1/describe/Invoice
它将将发票(或任何其他)对象的XML描述返回为:
<?xml version="1.0" encoding="UTF-8"?>
<object href="https://services470.zuora.com/apps/api/describe/Invoice">
<name>Invoice</name>
<label>Invoice</label>
<fields>
<field>
<name>AccountId</name>
<label>Account ID</label>
<selectable>true</selectable>
<createable>true</createable>
<updateable>false</updateable>
<filterable>true</filterable>
<custom>false</custom>
<maxlength></maxlength>
<required>true</required>
<type>text</type>
<contexts>
<context>soap</context>
</contexts>
</field>
<field>
<name>AdjustmentAmount</name>
<label>Adjustment Amount</label>
<selectable>true</selectable>
<createable>false</createable>
<updateable>false</updateable>
<filterable>true</filterable>
<custom>false</custom>
<maxlength></maxlength>
<required>true</required>
<type>decimal</type>
<contexts>
<context>soap</context>
<context>export</context>
</contexts>
</field>
<!-- All fields for Invoice...ETC -->
</fields>
</object>https://stackoverflow.com/questions/40463600
复制相似问题