huginn/huginn

POST an array with PostAgent

开放

#2,248 创建于 2018年3月27日

 (4 条评论) (0 个反应) (0 位负责人)Ruby (4,264 个派生)batch import
help wanted

仓库指标

星标
 (49,270 个星标)
PR 合并指标
 (平均合并 4天 2小时) (30 天内合并 15 个 PR)

描述

Hi,

I am trying to POST an array through the Post Agent. (For posting transactions to this API endpoint: /api/customers/bulk/v1 - https://developers.debitoor.com/api-reference#customers)

Unfortunately, the Huginn payload requires to be a hash.

I successfully post event like /api/customers/v1 with payload being a hash like this:

"payload": {
    "name": "John Doe",
    "paymentTermsId": "{{1 | as_object}}",
    "countryCode": "DK"
  }

But I cannot succeed in posting array like the one below:

[
    {
    "name": "John Doe",
    "paymentTermsId": "{{1 | as_object}}",
    "countryCode": "DK"
    }
]

Any clues?

贡献者指南