APIs to configure company travel policies.
curl -i -X GET \ 'https://developer.spotnana.com/_mock/openapi/policyapi/v2/companies/{companyId}/questions' \ -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
{ "length": 0, "elements": [ { … } ] }
Question display name that the user will see. For eg, 'Choose the purpose of your trip'.
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.
Whether its compulsory to answer the question or not.
Whether the question is disabled or not. If true, this should not be asked.
Conditions to select the custom field for given context.
curl -i -X POST \ 'https://developer.spotnana.com/_mock/openapi/policyapi/v2/companies/{companyId}/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": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string" } ], "departments": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string" } ], "costCenters": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string" } ], "offices": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string" } ] }, "travelTypes": [ "AIR" ], "travelRegionTypes": [ "DOMESTIC" ], "tripUsageTypes": [ "STANDARD" ] } }'
{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08" }
curl -i -X GET \ 'https://developer.spotnana.com/_mock/openapi/policyapi/v2/companies/{companyId}/questions/{questionId}' \ -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
OK
Question display name that the user will see. For eg, 'Choose the purpose of your trip'.
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.
Whether its compulsory to answer the question or not.
Whether the question is disabled or not. If true, this should not be asked.
Conditions to select the custom field for given context.
{ "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" } }
Question display name that the user will see. For eg, 'Choose the purpose of your trip'.
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.
Whether its compulsory to answer the question or not.
Whether the question is disabled or not. If true, this should not be asked.
Conditions to select the custom field for given context.
curl -i -X PUT \ 'https://developer.spotnana.com/_mock/openapi/policyapi/v2/companies/{companyId}/questions/{questionId}' \ -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": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string" } ], "departments": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string" } ], "costCenters": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string" } ], "offices": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string" } ] }, "travelTypes": [ "AIR" ], "travelRegionTypes": [ "DOMESTIC" ], "tripUsageTypes": [ "STANDARD" ] }, "questionType": { "preSearchQuestionType": "PURPOSE_OF_TRIP", "preCheckoutQuestionType": "OOP_REASON_CODE" } }'
curl -i -X DELETE \ 'https://developer.spotnana.com/_mock/openapi/policyapi/v2/companies/{companyId}/questions/{questionId}' \ -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'