APIs
Ticket Form API
Reference

API - Ticket Form - Reference

GET /ticket-forms/

Get all ticket forms associated with the user.

Example request

curl --request GET \
 --url https://api.aidbase.ai/v1/ticket-forms \
 --header 'accept: application/json' \
 --header 'Authorization: Bearer [YOUR_API_KEY]'

Example response

{
  "success": true,
  "data": [
    {
      "id": "f162e570-4952-465b-ad74-2a9e14518998",
      "public_id": "Aj96xCSIxAbsLhK5gb4Y1",
      "title": "Test Form",
      "allowed_domains": [
        "www.mywebsite.com",
        "app.mywebsite.com"
      ],
      "fields": [
        {
          "name": "What is your name?",
          "id": "d4qdd",
          "type": "TEXT",
          "required": true
        },
        {
          "name": "What do you work with?",
          "defaultSelectValues": [
            {
              "value": "ops-wxr",
              "label": "Ops"
            },
            {
              "value": "leadership-v38",
              "label": "Leadership"
            },
          ],
          "id": "y20j7",
          "type": "MULTI_SELECT",
          "required": true
        },
        ...
      ]
    },
    ...
  ]
}

GET /ticket-form/:id/

Get a specific ticket form by ID.

Example request

curl --request GET \
 --url https://api.aidbase.ai/v1/ticket-form/Aj96xCSIxAbsLhK5gb4Y1 \
 --header 'accept: application/json' \
 --header 'Authorization: Bearer [YOUR_API_KEY]'

Example response

{
  "success": true,
  "data": {
      "id": "f162e570-4952-465b-ad74-2a9e14518998",
      "public_id": "Aj96xCSIxAbsLhK5gb4Y1",
      "title": "Test Form",
      "allowed_domains": [
        "www.mywebsite.com",
        "app.mywebsite.com"
      ],
      "fields": [
        {
          "name": "What is your name?",
          "id": "d4qdd",
          "type": "TEXT",
          "required": true
        },
        {
          "name": "What do you work with?",
          "defaultSelectValues": [
            {
              "value": "ops-wxr",
              "label": "Ops"
            },
            {
              "value": "leadership-v38",
              "label": "Leadership"
            },
          ],
          "id": "y20j7",
          "type": "MULTI_SELECT",
          "required": true
        },
        ...
      ]
    }
}

GET /ticket-form/:id/knowledge

Get all knowledge items associated with a ticket form.

Example request

curl --request GET \
 --url https://api.aidbase.ai/v1/ticket-form/thcGFWKP4_XhwOC7ohwAQ/knowledge \
 --header 'accept: application/json' \
 --header 'Authorization: Bearer [YOUR_API_KEY]'

Example response

{
  "success": true,
  "data": {
    "items": [
      {
        "id": "24019214-f4ea-417b-9741-e13bc3b6c471",
        "type": "website",
        "base_url": "https://www.mywebsite.com/",
        "trained_at": "2023-12-24T06:05:17.365Z",
        "is_training": false,
        "training_failed_at": null,
        "training_failed_with": null
      },
      ...
    ],
    "total": 40,
    "has_more": true,
    "next_cursor": "MjUuNTA="
  }
}

PUT /ticket-form/:id/knowledge

Add a new knowledge item to a ticket-form.

ℹ️

The knowledge item must have a trained model.
The model can be trained using the /knowledge/:id/train endpoint.

Example request

curl --request PUT \
 --url https://api.aidbase.ai/v1/ticket-form/thcGFWKP4_XhwOC7ohwAQ/knowledge \
 --header 'accept: application/json' \
 --header 'Authorization: Bearer [YOUR_API_KEY]' \
 --data '{
    "knowledge_id": "24019214-f4ea-417b-9741-e13bc3b6c471"
 }'

Example response

{
  "success": true,
}

DELETE /ticket-form/:id/knowledge

Remove a knowledge item from a ticket form.

ℹ️

The knowledge item will be removed from the ticket form, but the knowledge item itself will not be deleted.

Example request

curl --request DELETE \
 --url https://api.aidbase.ai/v1/ticket-form/thcGFWKP4_XhwOC7ohwAQ/knowledge \
 --header 'accept: application/json' \
 --header 'Authorization: Bearer [YOUR_API_KEY]' \
 --data '{
    "knowledge_id": "24019214-f4ea-417b-9741-e13bc3b6c471"
 }'

Example response

{
  "success": true,
}

Aidbase Docs © 2024