Vee API Code Samples

Selection of code samples that demonstrate the use of the Vee API. Copy and edit these code samples to suit your needs.

When using the code samples, remember to replace:

  • {vanity_name} with your tenant name
  • {api_key} with your API key
  • {security_token} with a valid security token

Ask Vee a question

Use this sample request to start a conversation with Vee.

Copy
cURL sample request: Ask Vee what the headcount by gender is in each organization
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/vee/question' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
-d '{
    "question": "What is the headcount by gender in each org?",
    "options": {
        "includeVisual": "true"
    }
}'

The response returns Vee's answer to the question and a conversationState object containing a unique ID for the conversation. To ask a follow-up question or continue the conversation with Vee, include the conversationState from the response in your next /question call.

Use this sample request to ask a follow-up question or continue a conversation with Vee.

Copy
cURL sample request: Ask Vee a follow-up question to the previous question
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/vee/question' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
-d '{
    "question": "what about by tenure?",
    "conversationState": {
      "questionState": [
        "Cl1XaGF0IGlzIHRoZ.."
      ]
    },
    "options": {
      "includeVisual": "false"
    }
}'

The response returns Vee's answer to the question and a new conversationState object containing a unique ID for the continued conversation.

Use this sample request to ask a question and request for relevant documents such as analyses and reports.

Copy
cURL sample request: Ask a question and request relevant documents
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/vee/question' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-d '{
    "question": "What is the turnover rate?",
    "options": {
        "includeRelatedAnalyses": true,
        "includeRelatedReports": true
    }
}'

The response returns Vee's answer to the question and a relatedDocuments object containing the details of the related document such as the unique ID, title, description, and URL to view the document in Visier, or the click-through link for Embedded Partners if configured.

Submit Vee feedback

Use this sample request to submit feedback about Vee's answer to a question. The request body must include the answer's response object, a rating of Vee's answer, and a description of how Vee should have answered the question or how Vee can improve the answer.

Copy
cURL sample request: Submit feedback that you want Vee to return more organizations in the answer
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/vee/feedback' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'
-H 'Content-Type: application/json' \
-d '{
    "conversation": {
        "conversationState": {
            "questionState": [
                  "Cl1XaGF0IGlzIHRoZ.."
            ]
        },
    },
    "isApproved": "false",
    "description": "I wanted to see more orgs in the answer!"
}'

The response returns whether the API request was successful.

Retrieve a list of Vee question categories

Use this sample request to get a list of categories for the Vee sample questions displayed in the conversation interface.

Copy
cURL sample request: Retrieve a list of Vee question categories
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/vee/sample-question-categories' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns a list of categories, such as Comparisons.

Retrieve a Vee question category's details

Use this sample response to get the details of a specific Vee sample question category.

Copy
cURL sample request: Retrieve a Vee question category’s details
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/vee/sample-question-categories/10df0b34-e937-4685-ad86-2a53be5ec13f' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns the details of a specific Vee sample question category.

Retrieve a list of sample questions to ask Vee

Use this sample request to get a list of sample questions to help your users start using Vee.

Copy
cURL sample request: Retrieve a list of sample questions
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1/vee/sample-questions' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns a list of questions, such as What is the turnover rate?.