Hybris REST API - 如何在特定日期时间之后修改客户

时间:2016-11-09 23:55:54

标签: web-services rest hybris

我需要使用外部系统创建Hybris客户同步应用程序。

我试图仅提取在特定日期之后修改但没有运气的客户。

查看Hybris文档,它表明这样的事情应该有效,但它不起作用:

http://localhost:9001/ws410/rest/customers?customer_query=modifiedtime%20%3E%202016%2D03%2D14&customers_size=5&customer_attributes=modifiedtime

它只会让所有客户回归。

我尝试过日期格式的各种变体等等。

任何人都有一个如何使用HYBRIS REST API创建查询的示例?

1 个答案:

答案 0 :(得分:2)

找到它。 有错误的资源(客户 - 而不是客户),并且必须在日期进行转换(或者至少有效)。

仅限日期:

http://tphybris-vm:9001/ws410/rest/customers?customers_size=50&customer_attributes=modifiedtime&customers_query=%7Bmodifiedtime%7D%20%3E%20TO_TIMESTAMP('2016-10-21'%2C%20'YYYY-MM-DD')

返回:

{
  "@uri" : "http://tphybris-vm:9001/ws410/rest/customers?customers_size=50&customer_attributes=modifiedtime&customers_query=%7Bmodifiedtime%7D%20%3E%20TO_TIMESTAMP('2016-10-21'%2C%20'YYYY-MM-DD')",
  "customer" : {
    "@uri" : "http://tphybris-vm:9001/ws410/rest/customers/anonymous",
    "modifiedtime" : "2016-10-21T10:30:01.099-07:00",
    "authorizedToUnlockPages" : "false",
    "loginDisabled" : "false"
  }
}

这是按日期时间:

http://tphybris-vm:9001/ws410/rest/customers?customers_size=50&customer_attributes=modifiedtime&customers_query=%7Bmodifiedtime%7D%20%3E%20TO_TIMESTAMP('2016-10-21%2010%3A30%3A00'%2C%20'YYYY-MM-DD%20HH%3AMI%3ASS')

返回:

{
  "@uri" : "http://tphybris-vm:9001/ws410/rest/customers?customers_size=50&customer_attributes=modifiedtime&customers_query=%7Bmodifiedtime%7D%20%3E%20TO_TIMESTAMP('2016-10-21%2010%3A30%3A00'%2C%20'YYYY-MM-DD%20HH%3AMI%3ASS')",
  "customer" : {
    "@uri" : "http://tphybris-vm:9001/ws410/rest/customers/anonymous",
    "modifiedtime" : "2016-10-21T10:30:01.099-07:00",
    "authorizedToUnlockPages" : "false",
    "loginDisabled" : "false"
  }
}