0

我正在尝试/v1/customers/:customer_id/deliveries使用 firebase 向端点发布帖子。我正在从 Angular 应用程序发送查询参数。

查询对象

{ 
  pickup_name: 'Patrick O',
  pickup_phone_number: '619-***-****',
  dropoff_name: 'Wendell And Chad',
  dropoff_phone_number: '619-***-****',
  manifest: 'Cheese',
  quote_id: 'Mc26u6TwH_qKkF',
  dropoff_address: '4606 Market Street, San Diego, CA',
  pickup_address: '1041 Market Street, San Diego, CA' 
}

响应(Firebase 函数)

Unhandled error { StatusCodeError: 400 - {"kind":"error","code":"invalid_params","message":"The parameters of your request were invalid.","params":{"__all__":"invalid price quote"}}
...
name: 'StatusCodeError',
  statusCode: 400,
  message: '400 - {"kind":"error","code":"invalid_params","message":"The parameters of your request were invalid.","params":{"__all__":"invalid price quote"}}',
  error: 
   { kind: 'error',
     code: 'invalid_params',
     message: 'The parameters of your request were invalid.',
     params: { __all__: 'invalid price quote' } }, ...

我没有遇到__all__Postmates Api Docs 中的错误。感谢您的时间和考虑。

4

1 回答 1

1

该问题已通过从查询参数中删除 quote_id 属性得到解决

查询对象

{ 
  pickup_name: 'Patrick O',
  pickup_phone_number: '619-***-****',
  dropoff_name: 'Wendell And Chad',
  dropoff_phone_number: '619-***-****',
  manifest: 'Cheese',
  dropoff_address: '4606 Market Street, San Diego, CA',
  pickup_address: '1041 Market Street, San Diego, CA' 
}

我尚未对其进行测试,但我相信可以使用 quote_id 属性,但字符串必须是完整的引号 ID。

quote_id: 'dqt_Mc26u6TwH_qKkF',反对quote_id: 'Mc26u6TwH_qKkF',喜欢我有它。

我将在验证后者后更新答案

于 2020-03-30T18:51:55.283 回答