Skip to content

Latest commit

 

History

History

apiendpoints

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

ApiEndpoints

(apiEndpoints)

Overview

REST APIs for managing ApiEndpoint entities

Available Operations

deleteApiEndpoint

Delete an ApiEndpoint. This will also delete all associated Request Logs (if using a Postgres datastore).

Example Usage

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";

async function run() {
  const sdk = new Speakeasy({
    security: {
      apiKey: "<YOUR_API_KEY_HERE>",
    },
    workspaceID: "string",
  });

  const res = await sdk.apiEndpoints.deleteApiEndpoint({
    apiEndpointID: "string",
    apiID: "string",
    versionID: "string",
  });

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
request operations.DeleteApiEndpointRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.DeleteApiEndpointResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

findApiEndpoint

Find an ApiEndpoint via its displayName (set by operationId from a registered OpenAPI schema). This is useful for finding the ID of an ApiEndpoint to use in the /v1/apis/{apiID}/version/{versionID}/api_endpoints/{apiEndpointID} endpoints.

Example Usage

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";

async function run() {
  const sdk = new Speakeasy({
    security: {
      apiKey: "<YOUR_API_KEY_HERE>",
    },
    workspaceID: "string",
  });

  const res = await sdk.apiEndpoints.findApiEndpoint({
    apiID: "string",
    displayName: "string",
    versionID: "string",
  });

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
request operations.FindApiEndpointRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.FindApiEndpointResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

generateOpenApiSpecForApiEndpoint

This endpoint will generate a new operation in any registered OpenAPI document if the operation does not already exist in the document. Returns the original document and the newly generated document allowing a diff to be performed to see what has changed.

Example Usage

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";

async function run() {
  const sdk = new Speakeasy({
    security: {
      apiKey: "<YOUR_API_KEY_HERE>",
    },
    workspaceID: "string",
  });

  const res = await sdk.apiEndpoints.generateOpenApiSpecForApiEndpoint({
    apiEndpointID: "string",
    apiID: "string",
    versionID: "string",
  });

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GenerateOpenApiSpecForApiEndpointRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GenerateOpenApiSpecForApiEndpointResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

generatePostmanCollectionForApiEndpoint

Generates a postman collection that allows the endpoint to be called from postman variables produced for any path/query/header parameters included in the OpenAPI document.

Example Usage

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";

async function run() {
  const sdk = new Speakeasy({
    security: {
      apiKey: "<YOUR_API_KEY_HERE>",
    },
    workspaceID: "string",
  });

  const res = await sdk.apiEndpoints.generatePostmanCollectionForApiEndpoint({
    apiEndpointID: "string",
    apiID: "string",
    versionID: "string",
  });

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GeneratePostmanCollectionForApiEndpointRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GeneratePostmanCollectionForApiEndpointResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

getAllApiEndpoints

Get all Api endpoints for a particular apiID.

Example Usage

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";

async function run() {
  const sdk = new Speakeasy({
    security: {
      apiKey: "<YOUR_API_KEY_HERE>",
    },
    workspaceID: "string",
  });

  const res = await sdk.apiEndpoints.getAllApiEndpoints({
    apiID: "string",
  });

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetAllApiEndpointsRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetAllApiEndpointsResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

getAllForVersionApiEndpoints

Get all ApiEndpoints for a particular apiID and versionID.

Example Usage

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";

async function run() {
  const sdk = new Speakeasy({
    security: {
      apiKey: "<YOUR_API_KEY_HERE>",
    },
    workspaceID: "string",
  });

  const res = await sdk.apiEndpoints.getAllForVersionApiEndpoints({
    apiID: "string",
    versionID: "string",
  });

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetAllForVersionApiEndpointsRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetAllForVersionApiEndpointsResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

getApiEndpoint

Get an ApiEndpoint.

Example Usage

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";

async function run() {
  const sdk = new Speakeasy({
    security: {
      apiKey: "<YOUR_API_KEY_HERE>",
    },
    workspaceID: "string",
  });

  const res = await sdk.apiEndpoints.getApiEndpoint({
    apiEndpointID: "string",
    apiID: "string",
    versionID: "string",
  });

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetApiEndpointRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetApiEndpointResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

upsertApiEndpoint

Upsert an ApiEndpoint. If the ApiEndpoint does not exist it will be created, otherwise it will be updated.

Example Usage

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";

async function run() {
  const sdk = new Speakeasy({
    security: {
      apiKey: "<YOUR_API_KEY_HERE>",
    },
    workspaceID: "string",
  });

  const res = await sdk.apiEndpoints.upsertApiEndpoint({
    apiEndpoint: {
      apiEndpointId: "string",
      description: "Public-key systematic attitude",
      displayName: "string",
      method: "string",
      path: "/etc/periodic",
      versionId: "string",
    },
    apiEndpointID: "string",
    apiID: "string",
    versionID: "string",
  });

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
request operations.UpsertApiEndpointRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.UpsertApiEndpointResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /