huginn/huginn

POST an array with PostAgent

Aperta

#2248 aperta il 27 mar 2018

 (4 commenti) (0 reazioni) (0 assegnatari)Ruby (4264 fork)batch import
help wanted

Metriche repository

Star
 (49.270 stelle)
Metriche merge PR
 (Merge medio 4g 2h) (15 PR mergiate in 30 g)

Descrizione

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?

Guida contributor