huginn/huginn

POST an array with PostAgent

Ouverte

#2 248 ouverte le 27 mars 2018

 (4 commentaires) (0 réaction) (0 personne assignée)Ruby (4 264 forks)batch import
help wanted

Métriques du dépôt

Stars
 (49 270 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

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?

Guide contributeur