Hide operations (x-ntx-visibility)

In this example, you will add the x-ntx-visibility Specification Extension A Nintex-specific OpenAPI Specification key that allows special functionality within Nintex Xtensions. to the Google Task Xtension A set of instructions for Nintex Automation Cloud to use third-party API functionality with Nintex workflows. An Xtension may include workflow actions, start events, forms or file control. to hide the getListsoperation A single request to a third-party API. Operations often become actions in the workflow designer. from the Workflow designer. This operation is not useful as a workflow action A task that can be performed or triggered within a workflow, such as moving a file, sending an email, or using third-party API functionality., so we will hide it to avoid cluttering the Workflow designer.

Not all operations, parameters A piece of information passed to a third-party API during a request. or responses The return from a third-party API after a request has been made by the client. represent useful actions or configuration fields when designing a workflow. Some operations may be designed as internal 'helper' operations, such as retrieving values for drop-down lists, while some parameters or responses may not relate to any workflow design. To avoid cluttering the Workflow designer with actions that should not be used in workflows, the x-ntx-visibility Specification Extension allows you to hide operations from the action toolbox, and configuration fields from the action panel.

The complete OpenAPI Specification A standard, language-agnostic description of RESTful APIs that can be read by both humans and machines. Formerly known as Swagger. and icon for this example are available here.

Tip: Want the short version? Check out our OpenAPI Specification quick reference for quick definitions of parameter types, authentication, file handling and Specification Extensions.

Visibility

Nintex Automation Cloud uses the x-ntx-visibility Specification Extension to determine when to hide an action or configuration field. By defining x-ntx-visibility with a value of internal, you can hide:

  • actions
  • configuration fields for parameters
  • configuration fields for responses

Nintex Automation Cloud displays the action and configuration field for any operation, parameter or response that:

  • does not use the x-ntx-visibility specification extension
  • defines x-ntx-visibility with any value other than internal

Nintex Xtensions also supports the Microsoft Flow format of this Specification Extension: x-ms-visibility. Only the internalvalue is supported.

Hide the operation

Step 1: Create the basic OpenAPI Specification

Use the specification you built to create a task in a Google Tasks list, or download the completed Google Tasks Xtension example here.

See Create drop-downs (x-ntx-dynamic-values).

 
{
    "swagger": "2.0",
    "info": {
        "version": "1.0.0",
        "title": "Google Tasks"
    },
    "host": "www.googleapis.com",
    "basePath": "/tasks/v1",
    "schemes": [ "https" ],
    "produces": [ "application/json" ],
    "paths": {
        "/users/@me/lists": {
            "get": {
                "tags": [ "Task List" ],
                "summary": "List Tasklists",
                "description": "List Tasklists",
                "operationId": "getlists",
                "produces": [ "application/json" ],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/lists"
                        }
                    },
                    "default": {
                        "description": "Operation Failed"
                    }
                },
                "security": [
                    {
                        "oauth2": [ "https://www.googleapis.com/auth/tasks" ]
                    }
                ]
            }
        },
        "/lists/{tasklist}/tasks": {
            "post": {
                "tags": [ "Task" ],
                "summary": "Create Task",
                "description": "Create Task",
                "operationId": "createtask",
                "produces": [ "application/json" ],
                "parameters": [
                    {
                        "name": "tasklist",
                        "type": "string",
                        "in": "path",
                        "x-ntx-dynamic-values": {
                            "operationId": "getlists",
                            "value-collection": "items",
                            "value-path": "id",
                            "value-title": "title"
                        }
                    },
                    {
                        "name": "task",
                        "x-ntx-summary": "Task",
                        "description": "Title of task",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/taskSimple"
                        },
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/lists"
                        }
                    },
                    "default": {
                        "description": "Operation Failed"
                    }
                },
                "security": [
                    {
                        "oauth2": [ "https://www.googleapis.com/auth/tasks" ]
                    }
                ]
            }
        }
    },
    "definitions": {
        "list": {
            "type": "object",
            "properties": {
                "kind": {
                    "type": "string"
                },
                "updated": {
                    "type": "string",
                    "format": "datetime"
                },
                "id": {
                    "type": "string"
                },
                "selfLink": {
                    "type": "string"
                },
                "title": {
                    "type": "string"
                }
            }
        },
        "lists": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/list"
                    }
                },
                "kind": {
                    "type": "string"
                },
                "etag": {
                    "type": "string"
                }
            }
        },
        "taskSimple": {
            "type": "object",
            "properties": {
                "title": {
                    "type": "string"
                }
            }
        }
    },
    "securityDefinitions": {
        "oauth2": {
            "type": "oauth2",
            "flow": "accessCode",
            "authorizationUrl": "https://accounts.google.com/o/oauth2/v2/auth",
            "tokenUrl": "https://www.googleapis.com/oauth2/v4/token",
            "scopes": {
                "https://www.googleapis.com/auth/tasks": "access to tasks"
            }
        }
    }
}

Step 2: Add the visibility key to hide the getlists operation

In the HTTP method object of the getlists operation, add the x-ntx-visibility key with a value of internal.

Nintex Automation Cloud hides the getlists operation.

 
"paths": {
    "/users/@me/lists": {
        "get": {
            "tags": [ "Task List" ],
            "summary": "List Tasklists",
            "description": "List Tasklists",
            "operationId": "getlists",
            "x-ntx-visibility": "internal",
            "produces": [ "application/json" ]
        }
    }
}

Step 3: Add the visibility key to hide the response configuration fields

The response configuration fields are not useful to our workflow design. Add the x-ntx-visibility key with a value of internal to each of the response properties.

Nintex Automation Cloud hides the response configuration fields.

 
"lists": {
    "type": "object",
    "properties": {
        "items": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/list",
                "x-ntx-visibility": "internal"
            }
        },
        "kind": {
            "type": "string",
            "x-ntx-visibility": "internal"
        },
        "etag": {
            "type": "string",
            "x-ntx-visibility": "internal"
        }
    }
}

The OpenAPI Specification

 
{
    "swagger": "2.0",
    "info": {
        "version": "1.0.0",
        "title": "Google Tasks"
    },
    "host": "www.googleapis.com",
    "basePath": "/tasks/v1",
    "schemes": [ "https" ],
    "produces": [ "application/json" ],
    "paths": {
        "/users/@me/lists": {
            "get": {
                "tags": [ "Task List" ],
                "summary": "List Tasklists",
                "description": "List Tasklists",
                "operationId": "getlists",
                "x-ntx-visibility": "internal",
                "produces": [ "application/json" ],
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/lists"
                        }
                    },
                    "default": {
                        "description": "Operation Failed"
                    }
                },
                "security": [
                    {
                        "oauth2": [ "https://www.googleapis.com/auth/tasks" ]
                    }
                ]
            }
        },
        "/lists/{tasklist}/tasks": {
            "post": {
                "tags": [ "Task" ],
                "summary": "Create Task",
                "description": "Create Task",
                "operationId": "createtask",
                "produces": [ "application/json" ],
                "parameters": [
                    {
                        "name": "tasklist",
                        "type": "string",
                        "in": "path",
                        "x-ntx-dynamic-values": {
                            "operationId": "getlists",
                            "value-collection": "items",
                            "value-path": "id",
                            "value-title": "title"
                        }
                    },
                    {
                        "name": "task",
                        "x-ntx-summary": "Task",
                        "description": "Title of task",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/taskSimple"
                        },
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/lists"
                        }
                    },
                    "default": {
                        "description": "Operation Failed"
                    }
                },
                "security": [
                    {
                        "oauth2": [ "https://www.googleapis.com/auth/tasks" ]
                    }
                ]
            }
        }
    },
    "definitions": {
        "list": {
            "type": "object",
            "properties": {
                "kind": {
                    "type": "string"
                },
                "updated": {
                    "type": "string",
                    "format": "datetime"
                },
                "id": {
                    "type": "string"
                },
                "selfLink": {
                    "type": "string"
                },
                "title": {
                    "type": "string"
                }
            }
        },
        "lists": {
            "type": "object",
            "properties": {
                "items": {
                    "x-ntx-visibility": "internal",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/list"
                    }
                },
                "kind": {
                    "type": "string",
                    "x-ntx-visibility": "internal"
                },
                "etag": {
                    "type": "string",
                    "x-ntx-visibility": "internal"
                }
            }
        },
        "taskSimple": {
            "type": "object",
            "properties": {
                "title": {
                    "type": "string"
                }
            }
        }
    },
    "securityDefinitions": {
        "oauth2": {
            "type": "oauth2",
            "flow": "accessCode",
            "authorizationUrl": "https://accounts.google.com/o/oauth2/v2/auth",
            "tokenUrl": "https://www.googleapis.com/oauth2/v4/token",
            "scopes": {
                "https://www.googleapis.com/auth/tasks": "access to tasks"
            }
        }
    }
}

Test the result

Step 1: Add your Xtension

Import the OpenAPI Specification you created into Nintex Automation Cloud:

  1. Open your Nintex Automation Cloud tenancy.
  2. Click Xtensions in the dashboard to open the Xtensions page.
  3. Click  in the Private connector list.
  4. Click Choose a file. Navigate to the OpenAPI Specification on your computer.
  5. Wait for Nintex Automation Cloud to validate the file.
  6. Click Next.
  1. Nintex Automation Cloud detects the OAuth 2.0 security template.
  2. Type the Client ID in the Client ID field.
  3. Type the shared secret in the Client Secret field.
  4. Click Next.
  1. Edit the Name of the Xtension, which becomes the name of the action group in the Workflow designer.
  2. Edit the Description of the Xtension. This appears in the Private connector list in the Xtensions page.
  3. Select or upload an icon for the Xtension. This is displayed for each action or event in the Workflow designer.
  4. Click Publish.

Step 2: Authorize the redirect URL

The API will only accept requests that redirect to URLs that have already been authorised for the OAuth2 credentials. To authorise the redirect URL:

  1. Open the Credentials section of the Google Developer Console.
  2. Edit the OAuth2 credentials you created earlier.
  3. Paste the Redirect URL you copied into the Authorized redirect URIs field.
  4. Click Save.

Step 3: View the custom action group

  1. Click Create workflow in your Nintex Automation Cloud tenancy.
  2. Scroll down the action toolbox to the Google Tasks action group.
  3. Only the Create Task action is displayed.
    Drag the Create Task action to the canvas and open the configuration.
  4. The response configuration fields are hidden.