x-ntx-basePath

Use the x-ntx-basePath Specification Extension to override your basePath definition for a specific operation A single request to a third-party API. Operations often become actions in the workflow designer..

Tip: You may also want to use x-ntx-host or x-ntx-connection-properties.

How to use x-ntx-basePath

Add the key x-ntx-basePath with the value of the new base path you want to use in the HTTP method The HTTP action to perform on the endpoint, such as GET, POST, DELETE, PUT. In defined inside the operation's path object in the OpenAPI specification. you want to override the basePath of.

Tip: This specification extension supports placeholders.

Where to use x-ntx-basePath

Use x-ntx-basePath inside the HTTP method object of an operation, where it overrides the document's basePath declaration for all operations on that path.

Note: Nintex Automation Cloud only supports one basePath extension per path object.

 

"/examplepath": {
  "post": {
    "summary": "Post request",
    "description": "Request to httpbin",
    "operationId": "get-httpbin",
    "x-ntx-basePath": "/alternate/api",
    "produces": [ "application/json" ],
    "parameters": [],
    "responses": {
      "200": {
         "description": "OK",
      }
    }
  }
}		
		

Using placeholders

Sometimes you need to use a different basePath for different connections. For example, your third-party service may use different domains based on the geographic location of the account.

To avoid hard-coding multiple OpenAPI Specifications with each possible basePath, you can use the x-ntx-connection-properties specification extension to store inputs that can be used within the basePath for each connection.Nintex Automation Cloud stores this information with their connection details.

In the OpenAPI Specification, use the connection-properties placeholder in {{double braces}} for the basePath value to tell Nintex Automation Cloud to use the connection-specific basePath input.

For more information on using the connection-properties specification extension, see x-ntx-connection-properties.

{
  "host": "login.example.com",
  "basePath": "/",
  "x-ntx-basePath": "/{{accountId}}",
  "securityDefinitions": {
    "basicAuth": {
      "type": "basic",
      "x-ntx-connection-properties": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "title": "Account ID"
          }
        },
        "required": ["accountId"]
      }
    }
  }
} 

Limitations

The x-ntx-basePath extension added inside an HTTP method object, not the parent path The part of the URL after the hostname that directs the request to a specific resources within the host. For example, the section after "example.com" in http://example.com/this/is/a/path. object, however any x-ntx-basePath extension added is applied to all HTTP methods for that path.

Example: You have "basePath" : "/api" in your OpenAPI specification, and a path object that has GET, POST and PUT operations. If you override the POST operation's basePath with "x-ntx-basePath" : "/otherAPI", the GET and PUT operations for that path will also use /otherAPI.