I’m looking to create a custom GPT using a custom action for the Solarwinds Service desk API(documentation can be found by searching for “samanage api”). This is my first time using custom actions and I am having trouble authenticating the token that I have and was looking for any insight into how I could build the schema to allow for that authentication. Thank you!
Below is the schema that the custom actions GPT created for me. I am receiving a 401 error code when trying to test the api call.
openapi: 3.1.0
info:
title: SolarWinds ITSM API
description: Operations available on the SolarWinds ITSM API to manage incidents.
version: 1.0.0
servers:
- url: https://api.samanage.com/
description: Main production server for US-based customers
components:
securitySchemes:
samanageAuth:
type: apiKey
in: header
name: X-Samanage-Authorization
description: |
Admins can generate a token directly from the user setup page.
The token should be included in the `X-Samanage-Authorization` header in the format `Bearer API_TOKEN_STRING`.
security:
- samanageAuth: []
paths:
/incidents.json:
get:
operationId: getIncidents
summary: Retrieve a list of incidents
description: Fetches a list of incidents from the SolarWinds ITSM platform.
parameters:
- name: assigned_to[]
in: query
description: Filter incidents by assigned user IDs
required: false
schema:
type: array
items:
type: integer
- name: sort_by
in: query
description: Sort the incidents by a specific field
required: false
schema:
type: string
- name: sort_order
in: query
description: Order of sorting, ascending or descending
required: false
schema:
type: string
enum: [asc, desc]
responses:
'200':
description: A list of incidents
content:
application/json:
schema:
type: object
properties:
incidents:
type: array
items:
$ref: '#/components/schemas/Incident'
'401':
description: Unauthorized - Authentication failed
'406':
description: Not Acceptable - API version not supported
components:
schemas:
Incident:
type: object
properties:
id:
type: integer
description: The unique identifier for the incident
title:
type: string
description: Title of the incident
description:
type: string
description: Detailed description of the incident
status:
type: string
description: Current status of the incident