### APIMatic Quickstart Wizard - Create Portal Option Source: https://docs.apimatic.io/cli-getting-started/portal-quickstart-dac Example of the interactive prompt when choosing to create an API Documentation Portal during the quickstart wizard. ```bash ● Welcome to the APIMatic quickstart wizard. │ │ This wizard will guide you through creating your first SDK or API Documentation Portal in just four easy steps. │ Let's get started! │ ◆ What would you like to create? │ ● API Documentation Portal (Generate API docs + SDKs) │ ○ SDK ``` -------------------------------- ### APIMatic CLI Quickstart Command Source: https://docs.apimatic.io/apimatic-cli/commands Initiates an interactive guide to set up and visualize your first API portal or generate an SDK. This command requires no flags and sets up a build directory named 'src'. ```bash apimatic quickstart ``` -------------------------------- ### Run APIMatic Quickstart Wizard Source: https://docs.apimatic.io/cli-getting-started/portal-quickstart-dac Initiate the interactive quickstart wizard to create your first API portal or SDK. Select 'API Documentation Portal' to proceed. ```bash apimatic quickstart ``` -------------------------------- ### Verify Operator Installation with kubectl get Source: https://docs.apimatic.io/kubernetes-operator/olm-deployment-of-operator Check for the successful installation of the ClusterServiceVersion (CSV) and the operator deployment in the 'apimatic-system' namespace. ```bash kubectl get csv -n apimatic-system kubectl get deployment -n apimatic-system ``` -------------------------------- ### Custom Header Example Request Source: https://docs.apimatic.io/define-apis/api-authentication Example of an HTTP GET request that would typically include a custom header for authentication. ```http GET http://acme.com/v1/Inventory HTTP/1.1 ``` -------------------------------- ### Custom Query Parameter Example Request Source: https://docs.apimatic.io/define-apis/api-authentication Example of an HTTP GET request including a custom query parameter for authentication. ```http GET http://acme.com/v1/Inventory?CustomQueryParam=4c4112e4a1ef4e0f9396dbc80a160fc8 HTTP/1.1 ``` -------------------------------- ### Publish SDK with C# Example Source: https://docs.apimatic.io/changelog/cli-sdk-publish-and-publishing-profile-list Example demonstrating how to publish an SDK for C# using a specific profile ID and publish type. ```bash apimatic sdk publish --profile-id=a1b2c3d4e5f6a1b2c3d4e5f6 --language=csharp --version=1.0.0 --publish-type=package ``` -------------------------------- ### Install APIMatic Skills Manually Source: https://docs.apimatic.io/skills/overview Manually install an APIMatic skill by cloning the repository and copying the skill folder to your agent's skills directory. This example shows installation for Claude Code. ```bash git clone https://github.com/apimatic/skills cp -r skills/skills/apimatic-portal ~/.claude/skills/ ``` -------------------------------- ### Configure SDK with Basic and API Key Authentication (Go) Source: https://docs.apimatic.io/changelog/introducing-multiple-authentication Initialize an SDK client in Go with Basic Auth and API Key credentials using configuration options. The `CreateConfigurationFromEnvironment` function is used for this setup. ```go config := CreateConfigurationFromEnvironment( WithBasicAuthCredentials( NewBasicAuthCredentials("Username", "Password"), ), WithApiKeyCredentials( NewApiKeyCredentials("Token", "Key"), ), ) client := NewClient(config) ``` -------------------------------- ### Example Usage of Method Tags Annotation Source: https://docs.apimatic.io/specification-extensions/raml-apimatic-annotations Apply the 'x-tags' annotation at the method level to assign tags. This example tags the 'get' method for '/pet/{id}' with 'pets', enabling role-based filtering. ```yaml /pet/{id}: get: (x-tags): - pets displayName: Get pet by id ``` -------------------------------- ### Server Configuration Object Example Source: https://docs.apimatic.io/specification-extensions/swagger-server-configuration-extensions This example demonstrates the structure of the `x-server-configuration` object, including default environment and server, a list of environments with their respective servers, and template parameters. ```json { "x-server-configuration": { "default-environment": "production", "default-server": "default", "environments": [ { "name": "production", "servers": [ { "name": "default", "url": "http://example.com/{templateParam}" } ] } ], "parameters": [ { "name": "templateParam", "description": "It is a template parameter", "schema": { "type": "string", "enum": [ "abc", "def", "ghi" ], "default": "abc" } } ] } } ``` -------------------------------- ### Get In-Depth CLI Help Source: https://docs.apimatic.io/apimatic-cli/commands Access detailed usage, options, and examples for any CLI command. Use the `--nested-commands` flag to include all nested commands in the output. ```bash apimatic help portal generate --nested-commands ``` -------------------------------- ### Golang Client Initialization with Imports Source: https://docs.apimatic.io/changelog/adding-client-initialization-imports Provides a Golang example for initializing a new client with configuration for the SANDBOX environment, including the import statement. ```go package main import ( "fintechsdk" ) func main() { client := fintechsdk.NewClient( fintechsdk.CreateConfiguration( fintechsdk.WithEnvironment(fintechsdk.SANDBOX), ), ) } ``` -------------------------------- ### Sample .env File for Client Initialization Source: https://docs.apimatic.io/changelog/introducing-client-initialization-from-config-typescript This sample `.env` file demonstrates how to configure the client using environment variables for basic, retry, and proxy settings. ```dotenv # Basic Configuration TIMEOUT=30000 ENVIRONMENT=production # Retry Configuration MAX_NUMBER_OF_RETRIES=3 # Proxy Settings PROXY_ADDRESS=https://my.proxy.address PROXY_PORT=8080 ``` -------------------------------- ### Serve API Documentation Portal Locally Source: https://docs.apimatic.io/cli-getting-started/advanced-portal-setup Run this command to start a local development server for your API documentation portal. This allows you to preview your API recipes and other documentation before deploying. ```bash apimatic portal serve ``` -------------------------------- ### RAML Schema Example Source: https://docs.apimatic.io/changelog/swagger2.0-examples-support-added Example of a schema with an embedded example in RAML 1.0 format. This demonstrates how to define an example for a data structure. ```yaml Email: type: object properties: subject: string body: string example: subject: My Email 1 body: This is the text for email 1. ``` -------------------------------- ### Example Directory Structure Source: https://docs.apimatic.io/generate-sdks/add-custom-files Illustrates a typical directory structure for an SDK project. ```text src/ ├── MyApi.Standard ├── MyApi.Tests ├── MyApi.sln ├── LICENSE ├── doc └── README.md ``` -------------------------------- ### Verify APIMatic CLI Installation Source: https://docs.apimatic.io/apimatic-cli/intro-and-install Run this command after installation to confirm that the APIMatic CLI is installed correctly. It will display the installed version of the CLI. ```bash apimatic --version ``` -------------------------------- ### Install APIMatic CLI Source: https://docs.apimatic.io/cli-getting-started/portal-quickstart-dac Install the APIMatic CLI globally using npm. Ensure Node.js (>= v20) and npm are installed beforehand. ```bash npm install -g @apimatic/cli ``` -------------------------------- ### Bootstrap a New API Portal Project Source: https://docs.apimatic.io/changelog/cli-new-commands-quickstart-serve-recipe-new-toc-new Use this command to quickly set up a new API Portal project with the standard APIMatic directory structure. Ideal for first-time users or rapid prototyping. ```bash apimatic portal:quickstart ``` -------------------------------- ### Sample SDK Configuration File (config.json) Source: https://docs.apimatic.io/changelog/introducing-client-initialization-from-config-csharp Example structure for config.json to configure the SDK client, including nested HTTP client and proxy settings. ```json { "SdkConfig": { "Environment": "testing", "Port": "port", "HttpClientConfig": { "Timeout": "00:01:00", "NumberOfRetries": 3, "BackoffFactor": 2, "RetryInterval": 1, "MaximumRetryWaitTime": "00:02:00", "StatusCodesToRetry": [408, 413], "RequestMethodsToRetry": ["GET", "PUT", "DELETE"], "ProxyConfiguration": { "Address": "http://localhost:3000", "Port": 8080, "Tunnel": false, "User": "username", "Pass": "password" } } } } ``` -------------------------------- ### RAML v1.0 Type Declaration with Multiple Examples Source: https://docs.apimatic.io/changelog/added-multiple-examples-support-in-transformer Defines multiple examples for a type declaration in RAML v1.0. Supports 'value' and 'displayName' for examples. ```yaml MyTypeDeclaration: examples: example1: value: id: dummy id 1 name: dummy name 1 example2: displayName: Example2 description: This is 2nd example value: id: dummy id 2 name: dummy name 2 displayName: MyTypeDeclaration type: object properties: id: type: string name: type: string ``` -------------------------------- ### Navigate to Content Directory Source: https://docs.apimatic.io/cli-getting-started/advanced-portal-setup Change the current directory to the 'content/guides' folder in your project. ```bash cd content/guides ``` -------------------------------- ### OpenAPI v3.0 Parameter Object with Multiple Examples Source: https://docs.apimatic.io/changelog/added-multiple-examples-support-in-transformer Demonstrates how to define multiple examples for a parameter in OpenAPI v3.0. Supports 'value' and 'externalValue' for examples. ```yaml parameters: - name: name in: query schema: type: string examples: example1: summary: Example 1 description: This is the 1st example value: dummy name 1 example2: summary: Example 2 description: This is the 2nd example value: dummy name 2 example3: summary: Example 3 description: This is the 3rd example externalValue: >- https://example.com#example ``` -------------------------------- ### Initialize and Use Immutable Client in PHP Source: https://docs.apimatic.io/changelog/php-v3-update Demonstrates how to initialize an immutable client, retrieve its configurations, and create a new client instance with modified configurations. ```php // Initialize the immutable client $client = new MyClient([ 'environment' => 'production', 'timeout' => 10, 'port' => '80', ]); // Get a copy of client's configurations $configurations = $client->getConfiguration(); // Clone a client by overriding some of its configuration $newClient = $client->withConfiguration([ 'timeout' => 20, ]); ``` -------------------------------- ### Install APIMatic Skill using Skills CLI Source: https://docs.apimatic.io/skills/overview Install a specific APIMatic skill, such as 'apimatic-portal', using the skills CLI. This is the recommended installation method. ```bash # Install a specific skill npx skills add apimatic/skills --skill apimatic-portal ``` -------------------------------- ### Environment Variable Configuration Examples Source: https://docs.apimatic.io/changelog/introducing-client-initialization-from-config-csharp Examples of setting individual SDK configuration settings using environment variables. Nested settings are represented using double underscores. ```bash # Set the environment SdkConfig__Environment=production # Set number of retries SdkConfig__HttpClientConfig__NumberOfRetries=5 # Configure proxy settings SdkConfig__HttpClientConfig__ProxyConfiguration__Port=8080 ``` -------------------------------- ### Swagger 2.0 Exported Schema with Example Source: https://docs.apimatic.io/changelog/swagger2.0-examples-support-added The equivalent representation of the RAML schema example in Swagger 2.0 format. This shows how the example is included within the schema definition. ```json "Email": { "title": "Email", "example": { "subject": "My Email 1", "body": "This is the text for email 1." }, "type": "object", "properties": { "subject": { "description": "", "type": "string" }, "body": { "description": "", "type": "string" } }, "required": [ "subject", "body" ] } ``` -------------------------------- ### OpenAPI v3 Missing Parameter Example Source: https://docs.apimatic.io/changelog/adding-support-for-swagger2-openapi3-validation-linting Shows a parameter definition lacking an 'example' or 'examples' property, which is crucial for generating test cases and demonstrating intended payloads. ```yaml "parameters": [ { "name": "language", "in": "query", "required": false, "type": "string" } ] ``` -------------------------------- ### Java Client Initialization with Imports Source: https://docs.apimatic.io/changelog/adding-client-initialization-imports Demonstrates initializing the PaymentClient in Java with the SANDBOX environment, including necessary import statements. ```java import com.fintech.sdk.Environment; import com.fintech.sdk.PaymentClient; PaymentClient client = new PaymentClient.Builder() .environment(Environment.SANDBOX) .build(); ``` -------------------------------- ### OpenAPI Specification with Examples Source: https://docs.apimatic.io/changelog/adding-auto-unit-test-generation-in-ts This OpenAPI specification includes examples for request parameters and response bodies for the `/pet/findByStatus` path. APIMatic uses these examples to generate unit tests. ```yaml paths: /pet/findByStatus: get: operationId: findPetsByStatus parameters: - name: status in: query description: Status values that need to be considered for filter required: false explode: true schema: $ref: '#/components/schemas/Status' examples: example-1: summary: A sold status value: sold responses: '200': description: successful operation content: application/json: schema: type: array items: $ref: '#/components/schemas/Pet' examples: example-1: summary: An example of a pet list response value: - photoUrls: - "https://example.com/dog/side-pose" - "https://example.com/dog/sitting" name: "Dog" - photoUrls: - "https://example.com/cat/side-pose" - "https://example.com/cat/sitting" name: "Cat" '400': description: Invalid status value ``` -------------------------------- ### Initialize Client with Multiple Authentication (Go) Source: https://docs.apimatic.io/generate-sdks/sdk-features/multiple-authentication Initialize an SDK client in Go using configuration options, including basic authentication and API key credentials. ```go config := CreateConfigurationFromEnvironment( WithBasicAuthCredentials( NewBasicAuthCredentials("Username", "Password"), ), WithApiKeyCredentials( NewApiKeyCredentials("Token", "Key"), ), ) client := NewClient(config) ``` -------------------------------- ### OpenAPI v3.0 Response Body with Multiple Examples Source: https://docs.apimatic.io/changelog/added-multiple-examples-support-in-transformer Illustrates defining multiple examples for a response content type in OpenAPI v3.0. Supports 'value' and 'externalValue' for examples. ```yaml responses: '200': content: application/json: schema: properties: id: type: string name: type: string type: object examples: example1: value: id: dummy id 1 name: dummy name 1 example2: value: id: dummy id 2 name: dummy name 2 example3: externalValue: 'https://example.com#example' ``` -------------------------------- ### PHP SDK Client Initialization (Configured Namespace) Source: https://docs.apimatic.io/generate-sdks/customize-sdks/codegen-settings/sdk-interface-customization Example of how a PHP client is built when a custom namespace is configured. ```php $client = Apimatic\TesterClientBuilder::init() ->environment('testing') ->build(); ``` -------------------------------- ### Install Package Command (Latest Version) Source: https://docs.apimatic.io/generate-sdks/customize-sdks/codegen-settings/docs-settings When `IsLatestVersion` is set to `true`, the package installation command in the README will use a generic version reference, such as `npm install container`. ```bash npm install container ``` -------------------------------- ### Configure SDK with Basic and API Key Authentication (C#) Source: https://docs.apimatic.io/changelog/introducing-multiple-authentication Instantiate an SDK client using both Basic Authentication and API Key credentials. Ensure you have the necessary credential models built. ```csharp SdkClient client = new SdkClient.Builder() .BasicAuthCredentials( new BasicAuthModel.Builder( "Username", "Password" ) .Build()) .ApiKeyCredentials( new ApiKeyModel.Builder( "Token" ) .Build()) .Build(); ``` -------------------------------- ### Set and Get Basic Authorization Credentials in PHP Source: https://docs.apimatic.io/changelog/php-v3-update Shows how to initialize a client with basic authentication, retrieve username and password from configuration, and compare credentials. ```php // Initialize the immutable client with basic authorization $client = new MyClient([ 'environment' => 'production', 'username' => 'api-key', 'password' => 'Qaws2W233WedeRe4T56G6Vref2', ]); // Get username and password from configuration $username = $client->getBasicAuthCredentials()->getUserName(); $password = $client->getBasicAuthCredentials()->getPassword(); // Check if client’s username and password match with the new ones $areEqual = $client->getBasicAuthCredentials()->equals($newUser, $newPass); ``` -------------------------------- ### Install Test Requirements Source: https://docs.apimatic.io/generate-sdks/consume-sdk-through-project-reference Installs necessary packages for testing the SDK. ```bash pip install -r test-requirements.txt ``` -------------------------------- ### APIMatic Quickstart - Successful Portal Generation Source: https://docs.apimatic.io/cli-getting-started/portal-quickstart-dac Expected output after successfully generating the API portal. It indicates the location of artifacts and the running server address. ```bash ◇ Portal generated successfully. │ ● Portal artifacts can be found at 'C:\portal'. │ │ The portal is running at http://localhost:3000 │ │ Press CTRL+C to stop the server. │ ◇ Next steps ─────────────────────────────────────────────────────────╮ │ │ │ Use the API Playground or an SDK to call your API. │ │ Customize the Portal theme, add API recipes and enable AI features │ │ https://docs.apimatic.io/cli-getting-started/advanced-portal-setup │ │ │ ├──────────────────────────────────────────────────────────────────────╯ ``` -------------------------------- ### Install Package Command (Specific Version) Source: https://docs.apimatic.io/generate-sdks/customize-sdks/codegen-settings/docs-settings When `IsLatestVersion` is set to `false` (the default), the package installation command in the README will specify the exact version, such as `npm install container@2.0.1`. ```bash npm install container@2.0.1 ``` -------------------------------- ### Install Project Dependencies Source: https://docs.apimatic.io/changelog/adopting-airbnb-js-style-guide-es6-primitives Installs all project dependencies required for linting and testing. ```bash npm install ``` -------------------------------- ### Initialize Node Project Source: https://docs.apimatic.io/generate-sdks/consume-sdk-through-project-reference Initializes a new Node.js project with default settings. ```bash npm init --y ```