Skip to content

Instantly share code, notes, and snippets.

@keitase
Created November 13, 2018 18:47
Show Gist options
  • Save keitase/b8f8a0c3e5349864dbb3a0a4e0885180 to your computer and use it in GitHub Desktop.
Save keitase/b8f8a0c3e5349864dbb3a0a4e0885180 to your computer and use it in GitHub Desktop.
fabian-example-json
{
"openapi": "3.0.1",
"info": {
"contact": {
"email": "[email protected]",
"name": "Ruist Support",
"url": "http://www.ruist.com/"
},
"description": "API to initiate and manage live user sessions with a DirectLine application on Ruist's runtime platform",
"title": "Ruist API (Beta)",
"version": "0.0.1"
},
"servers": [
{
"description": "Production API",
"url": "https://api.ruist.io/v1"
}
],
"paths": {
"/session/active": {
"get": {
"parameters": [],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/SessionList"
},
"type": "array"
}
}
},
"description": "successful operation"
}
},
"security": [
{
"api_key": []
}
],
"tags": [
"Manage"
],
"description": "Lists all active sessions",
"operationId": "getActiveSessions",
"summary": "All active sessions across all applications"
}
},
"/session/active/{appId}": {
"get": {
"parameters": [
{
"description": "Id of application",
"in": "path",
"name": "appId",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/SessionInfo"
},
"type": "array"
}
}
},
"description": "successful operation"
},
"400": {
"description": "Invalid appId value"
}
},
"security": [
{
"api_key": []
}
],
"tags": [
"Manage"
],
"description": "Lists all active sessions for a given app",
"operationId": "getActiveSessionsByAppId",
"summary": "All active sessions of an application"
}
},
"/session/start": {
"post": {
"parameters": [],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionInfo"
}
}
},
"description": "Session successfully initiated"
},
"400": {
"description": "Bad Request"
}
},
"security": [
{
"api_key": []
}
],
"tags": [
"Lifecycle"
],
"description": "",
"operationId": "startSession",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionStartRequest"
}
}
},
"description": "session init request",
"required": true
},
"summary": "Request a new session be initiated"
}
},
"/session/stop/{sessionId}": {
"get": {
"parameters": [
{
"description": "sessionId to stop",
"in": "path",
"name": "sessionId",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"400": {
"description": "Invalid input"
}
},
"security": [
{
"api_key": []
}
],
"tags": [
"Lifecycle"
],
"description": "",
"operationId": "stopSession",
"summary": "Request terminate an active session"
}
},
"/session/{sessionId}": {
"get": {
"parameters": [
{
"description": "Id of Session to return",
"in": "path",
"name": "sessionId",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionInfo"
}
}
},
"description": "successful operation"
},
"400": {
"description": "Invalid sessionId value"
}
},
"security": [
{
"api_key": []
}
],
"tags": [
"Manage"
],
"description": "Sessions are queried by ID",
"operationId": "getSessionById",
"summary": "Obtain information about an existing session"
}
},
"/{deploymentId}/{sessionId}/{triggerId}": {
"parameters": [
{
"description": "deploymentId of the session",
"in": "path",
"name": "deploymentId",
"required": true,
"schema": {
"example": "foo",
"type": "string"
}
},
{
"description": "Id of the session that the trigger exists in",
"in": "path",
"name": "sessionId",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "Id of the trigger to run",
"in": "path",
"name": "triggerId",
"required": true,
"schema": {
"type": "string"
}
}
],
"get": {
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionTriggerResult"
}
}
},
"description": "Trigger successfully executed"
},
"400": {
"description": "Bad Request"
}
},
"tags": [
"API Triggers"
],
"summary": "Run a session API trigger without parameters"
},
"post": {
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionTriggerResult"
}
}
},
"description": "Trigger successfully executed"
},
"400": {
"description": "Bad Request"
}
},
"tags": [
"API Triggers"
],
"summary": "Run a session API trigger with parameters"
}
}
},
"components": {
"callbacks": {},
"links": {},
"schemas": {
"SessionInfo": {
"properties": {
"createdAt": {
"format": "date-time",
"type": "string"
},
"expiresAt": {
"format": "date-time",
"type": "string"
},
"originatingSourceId": {
"type": "string"
},
"originatingTriggerId": {
"type": "string"
},
"originatingType": {
"enum": [
"api",
"trigger"
],
"type": "string"
},
"sessionId": {
"type": "string"
},
"sessionVariables": {
"description": "Session variables (can be read or set by triggers or activities, for example)",
"items": {
"example": {
"customerAccount": 239873,
"identifiedCustomer": true,
"isMobile": true
},
"type": "string"
},
"type": "array"
},
"status": {
"enum": [
"ACTIVE",
"DISQUALIFIED",
"DISPOSED"
],
"type": "string"
},
"triggers": {
"items": {
"$ref": "#/components/schemas/SessionTrigger"
},
"type": "array"
}
},
"type": "object"
},
"SessionList": {
"properties": {
"next": {
"description": "\"URL to fetch next N sessions from\"",
"example": "https://api.ruist.io/v1/sessions?createdBefore=DATE",
"type": "string"
},
"sessions": {
"items": {
"$ref": "#/components/schemas/SessionInfo"
},
"type": "array"
}
},
"type": "object"
},
"SessionStartRequest": {
"properties": {
"parameters": {
"description": "Input parameters for the targeted trigger to start a new session. These variables will be used primarily during the init phase and possibly used to disqualify a new session request",
"items": {
"example": {
"inputParam1": "param1Value",
"inputParam2": "param2Value"
},
"type": "string"
},
"type": "array"
},
"applicationId": {
"type": "string"
},
"triggerId": {
"type": "string"
}
},
"required": [
"applicationId",
"identifier",
"sourceId"
],
"type": "object"
},
"SessionTrigger": {
"properties": {
"createdAt": {
"format": "date-time",
"type": "string"
},
"expiresAt": {
"format": "date-time",
"type": "string"
},
"hasSecureState": {
"type": "boolean"
},
"id": {
"format": "uuid",
"type": "string"
},
"name": {
"example": "Send Text Message ABC",
"type": "string"
},
"status": {
"enum": [
"ACTIVE",
"EXPIRED"
],
"type": "string"
},
"triggerMessageAddress": {
"example": "[email protected]",
"type": "string"
},
"triggerPhoneNumber": {
"example": "555-555-5555",
"type": "string"
},
"triggerRunUrl": {
"format": "uri",
"type": "string"
},
"triggerSipAddress": {
"format": "email",
"type": "string"
},
"type": {
"enum": [
"API",
"Web",
"Voice",
"Message"
],
"type": "string"
},
"usesRemaining": {
"type": "number"
}
},
"type": "object"
},
"SessionTriggerResult": {
"properties": {
"success": {
"example": true,
"type": "boolean"
}
},
"type": "object"
}
},
"securitySchemes": {
"api_key": {
"in": "header",
"name": "Ruist Secret API Key",
"type": "apiKey"
}
}
},
"security": [
{
"api_key": []
}
],
"tags": [
{
"description": "Initiate and terminate sessions",
"name": "Lifecycle"
},
{
"description": "Manage active sessions",
"name": "Manage"
},
{
"description": "Triggers",
"name": "API Triggers"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment