Skip to content

Policy API (v2)

Download OpenAPI description
Languages
Servers
Sandbox URL
https://api-ext-sboxmeta.partners.spotnana.com
Spotnana mock server
https://developer.spotnana.com/_mock/openapi/policyapi

Company Policies

APIs to configure company travel policies.

Operations

Custom Fields

APIs to manage company custom fields.

Operations

Get company questions

Request

Security
Bearer
Path
companyIdstring(uuid)required

Identifier for company.

Example: 4974a66b-7493-4f41-908c-58ba81093947
curl -i -X GET \
  https://api-ext-sboxmeta.partners.spotnana.com/v2/companies/4974a66b-7493-4f41-908c-58ba81093947/questions \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

OK

Bodyapplication/json
lengthinteger(int32)
elementsArray of objects(Reference object containing uuid and name of the entity.)

List of references containing id and name.

totalNumResultsinteger(int32)

Total number of results

Response
application/json
{ "length": 0, "elements": [ {} ], "totalNumResults": 0 }

Create company question

Request

Security
Bearer
Path
companyIdstring(uuid)required

Identifier for company.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Bodyapplication/json
namestringrequired

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

questionFormatstring(QuestionFormat)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.

Enum"INPUT_BOX""RADIO_BUTTON""CHECKBOX""CHECKBOX_WITH_PERCENTAGE"
optionInfoobject(OptionInfo)

Options related information for the question.

isRequiredbooleanrequired

Whether its compulsory to answer the question or not.

Default false
Example: true
isDisabledbooleanrequired

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

Default true
Example: false
customFieldLocationsArray of strings(CustomFieldLocation)
Items Enum"POLICY_APPROVAL_EMAIL""PNR_EMAIL""TRIP_EMAIL"
Example: ["POLICY_APPROVAL_EMAIL"]
matchConditionsobject(CustomFieldMatchConditions)

Conditions to select the custom field for given context.

includeInItinerarybooleanDeprecated

Whether to include this question in the itinerary related emails.

Default false
Example: true
curl -i -X POST \
  https://api-ext-sboxmeta.partners.spotnana.com/v2/companies/4974a66b-7493-4f41-908c-58ba81093947/questions \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "string",
    "questionFormat": "CHECKBOX",
    "optionInfo": {
      "source": "MANUAL",
      "sourceMetadata": {
        "companyConfig": {
          "optionsParam": "COST_CENTER"
        }
      },
      "totalNumOptions": 0,
      "options": [
        {
          "displayCode": "string",
          "displayValue": "string"
        }
      ]
    },
    "isRequired": true,
    "isDisabled": false,
    "includeInItinerary": true,
    "customFieldLocations": [
      "POLICY_APPROVAL_EMAIL"
    ],
    "matchConditions": {
      "travelerConditions": {
        "workerTypes": [
          "EMPLOYEE"
        ],
        "countries": [
          "string"
        ],
        "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"
      ],
      "tripUsageTypes": [
        "STANDARD"
      ]
    }
  }'

Responses

OK

Bodyapplication/json
idstring(uuid)required
Example: "b93dc51f-12dd-46c7-b7d6-1cb12cd3f5b3"
Response
application/json
{ "id": "b93dc51f-12dd-46c7-b7d6-1cb12cd3f5b3" }

Get company question

Request

Security
Bearer
Path
companyIdstring(uuid)required

Identifier for company.

Example: 4974a66b-7493-4f41-908c-58ba81093947
questionIdstring(uuid)required

Identifier for question.

Example: 1234a66b-7493-4f41-908c-58ba81093947
curl -i -X GET \
  https://api-ext-sboxmeta.partners.spotnana.com/v2/companies/4974a66b-7493-4f41-908c-58ba81093947/questions/1234a66b-7493-4f41-908c-58ba81093947 \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

OK

Bodyapplication/json
idstring(uuid)required
namestringrequired

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

questionFormatstring(QuestionFormat)

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.

Enum"INPUT_BOX""RADIO_BUTTON""CHECKBOX""CHECKBOX_WITH_PERCENTAGE"
optionInfoobject(OptionInfo)

Options related information for the question.

isRequiredbooleanrequired

Whether its compulsory to answer the question or not.

Default false
Example: true
isDisabledbooleanrequired

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

Default true
Example: true
customFieldLocationsArray of strings(CustomFieldLocation)
Items Enum"POLICY_APPROVAL_EMAIL""PNR_EMAIL""TRIP_EMAIL"
Example: ["POLICY_APPROVAL_EMAIL"]
matchConditionsobject(CustomFieldMatchConditions)

Conditions to select the custom field for given context.

questionTypeobject(QuestionType)

Question type.

includeInItinerarybooleanDeprecated

Whether to include this question in the itinerary related emails.

Default false
Example: true
Response
application/json
{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "questionFormat": "CHECKBOX", "optionInfo": { "source": "MANUAL", "sourceMetadata": {}, "totalNumOptions": 0, "options": [] }, "isRequired": true, "isDisabled": true, "includeInItinerary": true, "customFieldLocations": [ "POLICY_APPROVAL_EMAIL" ], "matchConditions": { "travelerConditions": {}, "travelTypes": [], "travelRegionTypes": [], "tripUsageTypes": [] }, "questionType": { "preSearchQuestionType": "PURPOSE_OF_TRIP", "preCheckoutQuestionType": "OOP_REASON_CODE" } }

Update company question

Request

Security
Bearer
Path
companyIdstring(uuid)required

Identifier for company.

Example: 4974a66b-7493-4f41-908c-58ba81093947
questionIdstring(uuid)required

Identifier for question.

Example: 1234a66b-7493-4f41-908c-58ba81093947
Bodyapplication/json
idstring(uuid)required
namestringrequired

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

questionFormatstring(QuestionFormat)

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.

Enum"INPUT_BOX""RADIO_BUTTON""CHECKBOX""CHECKBOX_WITH_PERCENTAGE"
optionInfoobject(OptionInfo)

Options related information for the question.

isRequiredbooleanrequired

Whether its compulsory to answer the question or not.

Default false
Example: true
isDisabledbooleanrequired

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

Default true
Example: true
customFieldLocationsArray of strings(CustomFieldLocation)
Items Enum"POLICY_APPROVAL_EMAIL""PNR_EMAIL""TRIP_EMAIL"
Example: ["POLICY_APPROVAL_EMAIL"]
matchConditionsobject(CustomFieldMatchConditions)

Conditions to select the custom field for given context.

questionTypeobject(QuestionType)

Question type.

includeInItinerarybooleanDeprecated

Whether to include this question in the itinerary related emails.

Default false
Example: true
curl -i -X PUT \
  https://api-ext-sboxmeta.partners.spotnana.com/v2/companies/4974a66b-7493-4f41-908c-58ba81093947/questions/1234a66b-7493-4f41-908c-58ba81093947 \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "questionFormat": "CHECKBOX",
    "optionInfo": {
      "source": "MANUAL",
      "sourceMetadata": {
        "companyConfig": {
          "optionsParam": "COST_CENTER"
        }
      },
      "totalNumOptions": 0,
      "options": [
        {
          "displayCode": "string",
          "displayValue": "string"
        }
      ]
    },
    "isRequired": true,
    "isDisabled": true,
    "includeInItinerary": true,
    "customFieldLocations": [
      "POLICY_APPROVAL_EMAIL"
    ],
    "matchConditions": {
      "travelerConditions": {
        "workerTypes": [
          "EMPLOYEE"
        ],
        "countries": [
          "string"
        ],
        "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"
      ],
      "tripUsageTypes": [
        "STANDARD"
      ]
    },
    "questionType": {
      "preSearchQuestionType": "PURPOSE_OF_TRIP",
      "preCheckoutQuestionType": "OOP_REASON_CODE"
    }
  }'

Responses

OK

Response
No content

Delete company question

Request

Security
Bearer
Path
companyIdstring(uuid)required

Identifier for company.

Example: 4974a66b-7493-4f41-908c-58ba81093947
questionIdstring(uuid)required

Identifier for question.

Example: 1234a66b-7493-4f41-908c-58ba81093947
curl -i -X DELETE \
  https://api-ext-sboxmeta.partners.spotnana.com/v2/companies/4974a66b-7493-4f41-908c-58ba81093947/questions/1234a66b-7493-4f41-908c-58ba81093947 \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

OK

Response
No content