Update a form question

PATCH /forms/{formId}/questions/{id}

Update a form question by its ID

Headers

Path parameters

  • formId string Required

    Minimum length is 1.

  • id string Required

    Minimum length is 1.

application/json

Body

  • defaultValue string | null

    Minimum length is 1.

  • externalId string | null

    Minimum length is 1, maximum length is 255.

  • targetProperty string | null

    Minimum length is 1.

  • required boolean | null
  • hidden boolean | null
  • Values are ADDRESS, BOOLEAN, DATE, DATE_TIME, EMAIL, FETCH, FILE, LANGUAGE, LONG_TEXT, MULTI_FILE, MULTI_SELECT, NUMBER, PHONE, SELECT, SHORT_TEXT, TIME_ZONE, or URL.

  • validator object | null

    Additional properties are allowed.

    Hide validator attributes Show validator attributes object | null
    • regex string

      A regular expression

      Minimum length is 1.

    • Additional properties are allowed.

      Hide translations attribute Show translations attribute object
      • errorMessage array[object]
        Hide errorMessage attributes Show errorMessage attributes object
        • language string Required

          Values are da, de, el, en, es, fr, ja, nl, no, or pl.

        • value string Required

          Minimum length is 1.

  • Additional properties are allowed.

    Hide translations attributes Show translations attributes object
    • label array[object]
      Hide label attributes Show label attributes object
      • language string Required

        Values are da, de, el, en, es, fr, ja, nl, no, or pl.

      • value string Required

        Minimum length is 1.

    • helpText array[object]
      Hide helpText attributes Show helpText attributes object
      • language string Required

        Values are da, de, el, en, es, fr, ja, nl, no, or pl.

      • value string Required

        Minimum length is 1, maximum length is 1024.

    • placeholder array[object]
      Hide placeholder attributes Show placeholder attributes object
      • language string Required

        Values are da, de, el, en, es, fr, ja, nl, no, or pl.

      • value string Required

        Minimum length is 1, maximum length is 1024.

  • order integer | null

    Minimum value is 0.

  • answerOptions array[object]

    Should be used in combination with inputType: SELECT or inputType: MULTI_SELECT

    Hide answerOptions attributes Show answerOptions attributes object
    • externalId string | null

      Minimum length is 1, maximum length is 255.

    • value string | null

      Minimum length is 1, maximum length is 255.

    • translations object Required

      Additional properties are NOT allowed.

      Hide translations attribute Show translations attribute object
      • label array[object] Required

        At least 1 element.

        Hide label attributes Show label attributes object
        • language string Required

          Values are da, de, el, en, es, fr, ja, nl, no, or pl.

        • value string Required

          Minimum length is 1.

    • order integer | null

      Minimum value is 0. Default value is 0.

  • Minimum length is 1.

Responses

  • 200 application/json

    Successful operation

    Hide response attribute Show response attribute object
    • data object Required

      Additional properties are NOT allowed.

      Hide data attributes Show data attributes object
      • id string Required

        Minimum length is 1.

      • form object Required

        Additional properties are NOT allowed.

        Hide form attribute Show form attribute object
        • id string Required

          Minimum length is 1.

      • fetchConfiguration object | null

        Additional properties are NOT allowed.

        Hide fetchConfiguration attribute Show fetchConfiguration attribute object | null
        • id string Required

          Minimum length is 1.

      • order integer Required

        Minimum value is 0.

      • defaultValue string | null

        Minimum length is 1.

      • externalId string | null

        Minimum length is 1, maximum length is 255.

      • targetProperty string | null

        Minimum length is 1.

      • required boolean Required
      • hidden boolean Required
      • inputType string Required

        Values are ADDRESS, BOOLEAN, DATE, DATE_TIME, EMAIL, FETCH, FILE, LANGUAGE, LONG_TEXT, MULTI_FILE, MULTI_SELECT, NUMBER, PHONE, SELECT, SHORT_TEXT, TIME_ZONE, or URL.

      • validator object | null

        Additional properties are NOT allowed.

        Hide validator attributes Show validator attributes object | null
        • regex string Required

          A regular expression

          Minimum length is 1.

        • errorMessage object | null Required

          Additional properties are NOT allowed.

          Hide errorMessage attributes Show errorMessage attributes object | null
          • language string Required

            Values are da, de, el, en, es, fr, ja, nl, no, or pl.

          • value string Required
        • translations object Required

          Additional properties are NOT allowed.

          Hide translations attribute Show translations attribute object
          • errorMessage array[object]

            At least 0 elements.

            Hide errorMessage attributes Show errorMessage attributes object
            • language string Required

              Values are da, de, el, en, es, fr, ja, nl, no, or pl.

            • value string Required

              Minimum length is 1.

      • label object | null Required

        Additional properties are NOT allowed.

        Hide label attributes Show label attributes object | null
        • language string Required

          Values are da, de, el, en, es, fr, ja, nl, no, or pl.

        • value string Required
      • helpText object | null Required

        Additional properties are NOT allowed.

        Hide helpText attributes Show helpText attributes object | null
        • language string Required

          Values are da, de, el, en, es, fr, ja, nl, no, or pl.

        • value string Required
      • placeholder object | null Required

        Additional properties are NOT allowed.

        Hide placeholder attributes Show placeholder attributes object | null
        • language string Required

          Values are da, de, el, en, es, fr, ja, nl, no, or pl.

        • value string Required
      • createdAt string(date-time) Required

        Minimum length is 1.

      • updatedAt string(date-time) Required

        Minimum length is 1.

      • deletedAt string(date-time) | null Required

        Minimum length is 1.

      • answerOptions array[object] Required
        Hide answerOptions attributes Show answerOptions attributes object
        • externalId string | null

          Minimum length is 1, maximum length is 255.

        • value string | null

          Minimum length is 1, maximum length is 255.

        • label object | null Required

          Additional properties are NOT allowed.

          Hide label attributes Show label attributes object | null
          • language string Required

            Values are da, de, el, en, es, fr, ja, nl, no, or pl.

          • value string Required
        • order integer Required

          Minimum value is 0.

        • createdAt string(date-time) Required

          Minimum length is 1.

        • updatedAt string(date-time) Required

          Minimum length is 1.

        • deletedAt string(date-time) | null Required

          Minimum length is 1.

        • translations object Required

          Additional properties are NOT allowed.

          Hide translations attribute Show translations attribute object
          • label array[object] Required

            At least 1 element.

            Hide label attributes Show label attributes object
            • language string Required

              Values are da, de, el, en, es, fr, ja, nl, no, or pl.

            • value string Required

              Minimum length is 1.

      • translations object Required

        Additional properties are NOT allowed.

        Hide translations attributes Show translations attributes object
        • label array[object] Required

          At least 1 element.

          Hide label attributes Show label attributes object
          • language string Required

            Values are da, de, el, en, es, fr, ja, nl, no, or pl.

          • value string Required

            Minimum length is 1.

        • helpText array[object]

          At least 0 elements.

          Hide helpText attributes Show helpText attributes object
          • language string Required

            Values are da, de, el, en, es, fr, ja, nl, no, or pl.

          • value string Required

            Minimum length is 1, maximum length is 1024.

        • placeholder array[object]

          At least 0 elements.

          Hide placeholder attributes Show placeholder attributes object
          • language string Required

            Values are da, de, el, en, es, fr, ja, nl, no, or pl.

          • value string Required

            Minimum length is 1, maximum length is 1024.

  • 404 application/json

    Resource not found

    Hide response attribute Show response attribute object
    • errors array[object] Required

      At least 1 element.

      Hide errors attributes Show errors attributes object
      • message string Required

        Minimum length is 1.

      • code string Required

        Minimum length is 1.

      • type string Required

        Minimum length is 1.

      • statusCode string Required

        Minimum length is 1.

  • 422 application/json

    Business validation failed

    • QUESTION_FETCH_TYPE_WITHOUT_FETCH_CONFIGURATION
    • QUESTION_NON_FETCH_TYPE_WITH_FETCH_CONFIGURATION
    • QUESTION_NON_SELECTION_TYPE_WITH_ANSWER_OPTIONS
    • QUESTION_SELECTION_TYPE_WITHOUT_ANSWER_OPTIONS

    See Error codes

    Hide response attribute Show response attribute object
    • errors array[object] Required

      At least 1 element.

      Hide errors attributes Show errors attributes object
      • message string Required

        Minimum length is 1.

      • code string Required

        Minimum length is 1.

      • type string Required

        Minimum length is 1.

      • statusCode string Required

        Minimum length is 1.

      • arguments object | null

        Additional properties are allowed.

PATCH /forms/{formId}/questions/{id}
curl \
 -X PATCH https://api.development.pexipengage.com/enterprises/acme/forms/123/questions/123 \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" \
 -H "X-Correlation-Id: a4f0048e-c983-11ed-afa1-0242ac120002" \
 -H "Accept-Language: en *" \
 -d '{"defaultValue":"string","externalId":"ABCD1234","targetProperty":"string","required":true,"hidden":true,"inputType":"SELECT","validator":{"regex":"^.{8}","translations":{"errorMessage":[{"language":"en","value":"Lorem ipsum"}]}},"translations":{"label":[{"language":"en","value":"Lorem ipsum"}],"helpText":[{"language":"en","value":"Lorem ipsum"}],"placeholder":[{"language":"en","value":"Lorem ipsum"}]},"order":5,"answerOptions":[{"externalId":"ABCD1234","value":"string","translations":{"label":[{"language":"en","value":"Lorem ipsum"}]},"order":5}],"fetchConfigurationId":"123"}'
Request examples
# Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
X-Correlation-Id: a4f0048e-c983-11ed-afa1-0242ac120002
Accept-Language: en *

# Payload
{
  "defaultValue": "string",
  "externalId": "ABCD1234",
  "targetProperty": "string",
  "required": true,
  "hidden": true,
  "inputType": "SELECT",
  "validator": {
    "regex": "^.{8}",
    "translations": {
      "errorMessage": [
        {
          "language": "en",
          "value": "Lorem ipsum"
        }
      ]
    }
  },
  "translations": {
    "label": [
      {
        "language": "en",
        "value": "Lorem ipsum"
      }
    ],
    "helpText": [
      {
        "language": "en",
        "value": "Lorem ipsum"
      }
    ],
    "placeholder": [
      {
        "language": "en",
        "value": "Lorem ipsum"
      }
    ]
  },
  "order": 5,
  "answerOptions": [
    {
      "externalId": "ABCD1234",
      "value": "string",
      "translations": {
        "label": [
          {
            "language": "en",
            "value": "Lorem ipsum"
          }
        ]
      },
      "order": 5
    }
  ],
  "fetchConfigurationId": "123"
}
Response examples (200)
{
  "data": {
    "id": "123",
    "form": {
      "id": "123"
    },
    "fetchConfiguration": {
      "id": "123"
    },
    "order": 5,
    "defaultValue": "string",
    "externalId": "ABCD1234",
    "targetProperty": "string",
    "required": true,
    "hidden": true,
    "inputType": "SELECT",
    "validator": {
      "regex": "^.{8}",
      "errorMessage": {
        "language": "en",
        "value": "Lorem ipsum"
      },
      "translations": {
        "errorMessage": [
          {
            "language": "en",
            "value": "Lorem ipsum"
          }
        ]
      }
    },
    "label": {
      "language": "en",
      "value": "Lorem ipsum"
    },
    "helpText": {
      "language": "en",
      "value": "Lorem ipsum"
    },
    "placeholder": {
      "language": "en",
      "value": "Lorem ipsum"
    },
    "createdAt": "2022-08-17T19:05:21.362Z",
    "updatedAt": "2022-08-17T19:05:21.362Z",
    "deletedAt": "2022-08-17T19:05:21.362Z",
    "answerOptions": [
      {
        "externalId": "ABCD1234",
        "value": "string",
        "label": {
          "language": "en",
          "value": "Lorem ipsum"
        },
        "order": 5,
        "createdAt": "2022-08-17T19:05:21.362Z",
        "updatedAt": "2022-08-17T19:05:21.362Z",
        "deletedAt": "2022-08-17T19:05:21.362Z",
        "translations": {
          "label": [
            {
              "language": "en",
              "value": "Lorem ipsum"
            }
          ]
        }
      }
    ],
    "translations": {
      "label": [
        {
          "language": "en",
          "value": "Lorem ipsum"
        }
      ],
      "helpText": [
        {
          "language": "en",
          "value": "Lorem ipsum"
        }
      ],
      "placeholder": [
        {
          "language": "en",
          "value": "Lorem ipsum"
        }
      ]
    }
  }
}
Response examples (404)
{
  "errors": [
    {
      "message": "string",
      "code": "string",
      "type": "string",
      "statusCode": "string"
    }
  ]
}
Response examples (422)
{
  "errors": [
    {
      "message": "string",
      "code": "string",
      "type": "string",
      "statusCode": "string",
      "arguments": {}
    }
  ]
}