Skip to content

Instantly share code, notes, and snippets.

@owenallenaz
Created June 21, 2024 16:39
Show Gist options
  • Save owenallenaz/79bf726d1c8bd1dd087859cd84501024 to your computer and use it in GitHub Desktop.
Save owenallenaz/79bf726d1c8bd1dd087859cd84501024 to your computer and use it in GitHub Desktop.
Apex open AI actions
openapi: 3.0.0
info:
title: Simpleview Apex GraphQL API
description: API for interacting with Simpleview Apex data via GraphQL.
version: 1.0.0
servers:
- url: https://graph.dev.simpleviewdms.dev
description: Simpleview Apex GraphQL endpoint
paths:
/client/test/graph/contacts_insert/:
post:
operationId: contacts_insert
summary: Insert a new contact
description: Inserts a new contact with specified details into the database.
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- query
- operationName
- variables
properties:
query:
type: string
description: The GraphQL mutation query.
example: "mutation dms_contacts_insert($input: dms_model_contacts_insert_input!) { dms { models { contacts_insert(input: $input) { success message ids } } } }"
operationName:
type: string
example: "dms_contacts_insert"
variables:
type: object
description: The variables for the mutation, including contact details.
properties:
input:
type: object
properties:
data:
type: object
properties:
first_name:
type: string
last_name:
type: string
is_send_email:
type: boolean
phones:
type: object
description: "Adds phone numbers to the contact, each entry in the docs array is a different number"
properties:
docs:
type: array
items:
type: object
properties:
is_primary:
type: boolean
phone_type_id:
type: string
enum:
- "mobile"
- "direct"
phone_number:
type: string
description: "A contacts phone number, it must be formatted in E.164 format."
emails:
type: object
description: "Adds new emails to the contact, each entry in the docs array is a different email"
properties:
docs:
type: array
items:
type: object
required:
- is_primary
- email_type
- email_address
properties:
email_type_id:
type: string
enum:
- "personal"
- "work"
is_primary:
type: boolean
email_address:
type: string
responses:
'200':
description: Contact insertion response
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
message:
type: string
ids:
type: array
items:
type: string
/client/test/graph/contacts_query/:
post:
operationId: contacts_query
summary: Query contact details
description: Queries details of contacts based on filter criteria and limits.
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- query
- operationName
- variables
properties:
query:
type: string
description: The GraphQL query string.
example: "query dms_contacts_query($input: dms_model_contacts_query_input) { dms { models { contacts_query(input: $input) { count docs { first_name last_name title emails { is_primary email_type { label } email_address } } } } } }"
operationName:
type: string
example: dms_contacts_query
variables:
type: object
description: Input variables for the query.
properties:
input:
type: object
properties:
filter:
type: object
properties:
keyword:
type: object
properties:
terms:
type: string
example: "Owen"
limit:
type: integer
example: 10
responses:
'200':
description: Successful response with contact details
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
dms:
type: object
properties:
models:
type: object
properties:
contacts_query:
type: object
properties:
count:
type: integer
docs:
type: array
items:
type: object
properties:
first_name:
type: string
last_name:
type: string
title:
type: string
emails:
type: array
items:
type: object
properties:
is_primary:
type: boolean
email_type:
type: object
properties:
label:
type: string
email_address:
type: string
phones:
type: array
items:
type: object
required:
- is_primary
- phone_type
- phone_number
properties:
is_primary:
type: boolean
phone_type:
type: object
properties:
label:
type: string
phone_number:
type: string
/client/test/graph/properties_query/:
post:
summary: Query Property Details
operationId: properties_query
description: >
Executes a GraphQL query to retrieve details about properties, including
name, brand, web URL, and meeting facility information, based on specific
filter criteria.
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- query
- operationName
- variables
properties:
query:
type: string
description: The GraphQL query string.
example: "query dms_properties_query($input: dms_model_properties_query_input) {...}"
operationName:
type: string
example: "dms_properties_query"
variables:
type: object
description: The input variables for the query.
properties:
input:
type: object
properties:
filter:
type: object
properties:
keyword:
type: object
properties:
terms:
type: string
description: "Search for properties that match the passed string"
example: Hilton
dining_facility:
type: object
properties:
match:
type: "object"
properties:
cuisines:
type: "object"
properties:
match:
type: "object"
properties:
keyword:
type: "object"
properties:
terms:
type: string
description: "Search for cuisines that match the passed string"
example: "Barbecue"
meeting_facility:
type: object
properties:
match:
type: object
properties:
rooms:
type: object
properties:
gt:
type: integer
description: "Greater than; used to filter properties with more than a specified number of rooms."
example: 10
responses:
'200':
description: Successfully retrieved property details.
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
dms:
type: object
properties:
models:
type: object
properties:
properties_query:
type: object
properties:
count:
type: integer
description: The total number of properties matching the query.
docs:
type: array
items:
type: object
properties:
name:
type: string
description: The name of the property.
brand:
type: string
description: The brand of the property.
weburl:
type: string
description: The website URL of the property.
meeting_facility:
type: object
properties:
rooms:
type: integer
description: The number of rooms available in the meeting facility.
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT

This GPT, named Simpleview Assistant, is designed to communicate with the Simpleview Apex API, assisting users by generating API queries, interpreting API responses, and facilitating interactions with the Simpleview Apex system. It focuses on helping developers with their CRM tasks, offering guidance on utilizing Simpleview Apex's API effectively. The Assistant can help format and refine API requests, translate API responses into actionable insights, and provide technical advice on integration and usage patterns. It assumes a level of technical expertise from the user, offering explanations and suggestions with a developer-focused approach. The Assistant will maintain a professional tone, tailored to users with a solid understanding of programming and API interaction, but it will also ensure clarity and precision in communication to accommodate a range of technical backgrounds.

When formatting a phone_number format it in E.164 syntax.

contacts_insert

When the user asks to insert a contact use the following parameters:

  • query: mutation dms_contacts_insert($input: dms_model_contacts_insert_input!) { dms { models { contacts_insert(input: $input) { success message ids } } } }
  • operationName: dms_contacts_insert

When inserting a contact if the information is not provided do not assume it.

contacts_query

When the user asks to retrieve a list of contacts use the following parameters:

  • query - query dms_contacts_query($input: dms_model_contacts_query_input) { dms { models { contacts_query(input: $input) { count docs { first_name last_name title emails { is_primary email_type { label } email_address } } } } } }
  • operationName - dms_contacts_query

Return the data using the array stored at dms.models.contacts_query.docs.

properties_query

When the user asks to retrieve a list of properties use the following parameters:

  • query: query dms_properties_query($input: dms_model_properties_query_input) { dms { models { properties_query(input: $input) { count docs { name brand weburl meeting_facility { rooms } } } } } }
  • operationName: dms_properties_query

Return the data using the array stored at dms.models.properties_query.docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment