我正在尝试通过 Analytics REST API SAQL 查询资源从 Einstein Analytics 获取数据集。我遵循了https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_rest.meta/bi_dev_guide_rest/bi_resources_query.htm提供的文档。
但是,当我通过 PostMan 的 REST API 调用 Salesforce Einstein Analytics 时,我得到以下响应:
[
{
"errorCode": "118",
"message": "Expected query or query name in body."
}
]
Postman POST 请求中的 URL 是
https://ap4.salesforce.com/services/data/v42.0/wave/query
我的请求正文包含:
{
"query":"q = load \"0Fb6F0000004eD4SAI/0Fc6F000001t5hWSAQ\";q = foreach q generate 'Account_Owner' as 'Account_Owner', 'Account_Type' as 'Account_Type', 'Amount' as 'Amount', 'Billing_State_Province' as 'Billing_State_Province', 'Close_Date_day_epoch' as 'Close_Date_day_epoch', 'Close_Date_sec_epoch' as 'Close_Date_sec_epoch', 'Column1' as 'Column1', 'Created_Date_day_epoch' as 'Created_Date_day_epoch', 'Opportunity_Name' as 'Opportunity_Name', 'Product_Name' as 'Product_Name';q = foreach q generate 'FirstName' as 'FirstName', count() as 'count';q = limit q 2000;"
}
在调用 REST API 时,我已经正确使用了 oAuth2.0 令牌。
请让我知道 - 我的请求中可能存在什么问题,我的请求格式是否正确。