Legacy Dev Forum Posts

 View Only

Sign Up

Web services data actions, input with arrays

  • 1.  Web services data actions, input with arrays

    Posted 06-05-2025 18:40

    Cherruel_Gildas | 2017-10-02 04:36:03 UTC | #1

    This was the closest category as it seems there is no category for the recently released Web Services Data Actions.

    Defined a new action and wrote the Input Contract as follows:

    {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "object",
      "required": [
        "tenant",
        "to",
        "message"
      ],
      "properties": {
        "tenant": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "messages": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "maxItems": 5
        }
      }
    }

    When I run a test, I get this error:

    {
      "status": 400,
      "code": "bad.request",
      "message": "The request could not be understood by the server due to malformed syntax.",
      "messageParams": {},
      "contextId": "XXXXXXX-7e4c-4463-863b-DEADBEEF",
      "details": [],
      "errors": [
        {
          "status": 400,
          "code": "BAD_REQUEST",
          "message": "The value provided in the request body is in the wrong format. Only key-value JSON pairs are supported. Example: {'FirstName' : 'Joe', 'LastName' : 'Williams'}",
          "messageParams": {},
          "details": [],
          "errors": []
        }
      ]
    }

    Question: How can we input arrays of strings?!?


    tim.smith | 2017-10-02 17:17:04 UTC | #2

    Only key-value pairs are supported for data action inputs. If you have array-type data, you'll need to flatten it to an explicit list of parameters first (e.g. message1, message2, message3, etc..).


    Cherruel_Gildas | 2017-10-10 00:24:32 UTC | #3

    Ok, noted. Thanks Tim.


    system | 2017-11-10 00:24:50 UTC | #4

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 1880