PlaniaGPT

PlaniaGPT · Ações GPT

Plania api

## API Documentation of the Plania Api The API documentation for Plania Api serves as a comprehensive guide designed to assist developers in understanding and integrating the services offered by Plania. ### Overview Plania API enables businesses and developers to implement search and planning tools dedicated to the tourism sector. ### Search endpoints - [`/locations`](#/locations): Search and suggest locations based on user input and query - [`/activities`](#/activities): Search activities based on user input and/or location ### Trip requests - [`/triprequest`](#/triprequests): A trip plan can be computed for a defined destination and dates.

  • GET /main_getRoot
  • POST /triprequestCreate Triprequest
  • GET /triprequest/{id}Get a triprequest
  • PATCH /triprequest/{id}/change/{actid}Update Triprequest data
  • GET /activities/searchSearch Activities
  • GET /activities/{id}Get an activity
  • GET /locations/suggestSuggest Location
Esquema API original
{
  "openapi": "3.0.0",
  "info": {
    "title": "Plania api",
    "description": "## API Documentation of the Plania Api\n\nThe API documentation for Plania Api serves as a comprehensive guide designed to assist developers in understanding and integrating the services offered by Plania.\n\n### Overview\n\nPlania API enables businesses and developers to implement search and planning tools dedicated to the tourism sector.\n\n### Search endpoints\n\n- [`/locations`](#/locations): Search and suggest locations based on user input and query\n- [`/activities`](#/activities): Search activities based on user input and/or location\n\n### Trip requests\n\n- [`/triprequest`](#/triprequests): A trip plan can be computed for a defined destination and dates.\n",
    "contact": {
      "name": "Support team",
      "url": "https://www.plania.io/",
      "email": "info@plania.io"
    },
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.plania.io",
      "description": "Production"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "operationId": "main_getRoot",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/triprequest": {
      "post": {
        "tags": [
          "triprequests"
        ],
        "summary": "Create Triprequest",
        "operationId": "triprequest_create",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTriprequestBodyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/triprequest/{id}": {
      "get": {
        "tags": [
          "triprequests"
        ],
        "summary": "Get a triprequest",
        "operationId": "triprequest_findOne",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Triprequest found"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/triprequest/{id}/change/{actid}": {
      "patch": {
        "tags": [
          "triprequests"
        ],
        "summary": "Update Triprequest data",
        "operationId": "triprequest_change",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actid",
            "in": "path",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "newStartTime",
            "in": "query",
            "required": true,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "newEndTime",
            "in": "query",
            "required": true,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "force",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Data Updated Succesufully"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/activities/search": {
      "get": {
        "tags": [
          "activities"
        ],
        "summary": "Search Activities",
        "operationId": "activities_search",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The search is done succefully"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/activities/{id}": {
      "get": {
        "tags": [
          "activities"
        ],
        "summary": "Get an activity",
        "operationId": "activities_findOne",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The activity is returned succefully"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/locations/suggest": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Suggest Location",
        "operationId": "location_suggest",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ParticipantDto": {
        "required": [
          "age",
          "category"
        ],
        "type": "object",
        "properties": {
          "age": {
            "type": "number",
            "description": "Age of the user",
            "example": 25
          },
          "category": {
            "type": "number",
            "description": "Category of the participant",
            "default": 1
          }
        }
      },
      "CreateTriprequestBodyDto": {
        "required": [
          "dest_name",
          "dest_type",
          "language",
          "max_distance",
          "max_duration",
          "participants"
        ],
        "type": "object",
        "properties": {
          "date": {
            "type": "array",
            "description": "dates of the trip",
            "items": {
              "type": "string"
            }
          },
          "date_start": {
            "type": "string",
            "description": "The start date of the trip",
            "example": "2023-12-20"
          },
          "date_end": {
            "type": "string",
            "description": "The end date of the trip",
            "example": "2023-12-20"
          },
          "max_duration": {
            "type": "number",
            "description": "The duration of the trip",
            "example": 10800
          },
          "max_distance": {
            "type": "number",
            "description": "Maximum distance reached during the trip",
            "example": 10000
          },
          "dest_name": {
            "type": "string",
            "description": "Destination Name",
            "example": "Berlin"
          },
          "dest_type": {
            "type": "string",
            "description": "Type of the destination",
            "example": "city"
          },
          "participants": {
            "type": "array",
            "description": "Information about the participant",
            "example": "[{\n      \"age\": 25,\n      \"category\": 1\n    }]",
            "items": {
              "$ref": "#/components/schemas/ParticipantDto"
            }
          },
          "language": {
            "type": "number",
            "description": "The Language",
            "example": 29
          }
        }
      }
    }
  }
}