v1

latestOpenAPI 3.1.02026-08-0610222105.1 KB
Custom Fields

Create company question

post/v2/companies/{companyId}/questions

Request body

namestring required

Question display name that the user will see. For eg, 'Choose the purpose of your trip'.

questionFormat'INPUT_BOX' | 'RADIO_BUTTON' | 'CHECKBOX' | 'CHECKBOX_WITH_PERCENTAGE' required

Question types. INPUT_BOX will make user enter a free flowing text. RADIO_BUTTON will have multiple options, user can select only one. CHECKBOX questions contain the possible set of options, from which the user can choose multiple options. CHECKBOX_WITH_PERCENTAGE is similar to checkbox, with the difference being that each option having an additional input field whose values must add up to 100.

isRequiredboolean required

Whether its compulsory to answer the question or not.

isDisabledboolean required

Whether the question is disabled or not. If true, this should not be asked.

includeInItineraryboolean

Whether to include this question in the itinerary related emails.

customFieldLocationsCustomFieldLocation[]

Example request

{
  "questionFormat": "CHECKBOX",
  "optionInfo": {
    "source": "MANUAL",
    "sourceMetadata": {
      "companyConfig": {
        "optionsParam": "COST_CENTER"
      }
    }
  },
  "isRequired": true,
  "includeInItinerary": true,
  "customFieldLocations": [
    "POLICY_APPROVAL_EMAIL"
  ],
  "matchConditions": {
    "travelerConditions": {
      "workerTypes": [
        "EMPLOYEE"
      ],
      "legalEntities": [
        {
          "id": "b93dc51f-12dd-46c7-b7d6-1cb12cd3f5b3",
          "name": "Name"
        }
      ],
      "departments": [
        {
          "id": "b93dc51f-12dd-46c7-b7d6-1cb12cd3f5b3",
          "name": "Name"
        }
      ],
      "costCenters": [
        {
          "id": "b93dc51f-12dd-46c7-b7d6-1cb12cd3f5b3",
          "name": "Name"
        }
      ],
      "offices": [
        {
          "id": "b93dc51f-12dd-46c7-b7d6-1cb12cd3f5b3",
          "name": "Name"
        }
      ]
    },
    "travelTypes": [
      "AIR"
    ],
    "travelRegionTypes": [
      "DOMESTIC"
    ]
  }
}

Response

OK

idstring uuid required

Example response

{
  "id": "b93dc51f-12dd-46c7-b7d6-1cb12cd3f5b3"
}