Appearance
Get modal form typeahead results ​
API ReferenceNote: The path is a placeholder. The actual path is determined by the configuration of the app component.
If a modal form field is of type typehead, this operation gets typeahead results to render as a dropdown list.
When the user types into a modal form form field, Asana will send a request containing the entered string to the application's typeahead_url. The list of TypeaheadItems in the response will then be rendered in a dropdown list.
OpenAPI definition ​
json
{
"openapi": "3.0.0",
"info": {
"description": "This is the interface for handling requests for app components. This reference is generated from an [OpenAPI spec] (https://raw.githubusercontent.com/Asana/openapi/master/defs/app_components_oas.yaml).",
"title": "App Components",
"termsOfService": "https://asana.com/terms",
"contact": {
"name": "Asana Support",
"url": "https://asana.com/support"
},
"license": {
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0"
},
"version": "0.1",
"x-docs-schema-whitelist": [
"AttachedResourceResponse",
"FormField-Checkbox",
"FormField-Date",
"FormField-Datetime",
"FormField-Dropdown",
"FormField-MultiLineText",
"FormField-RadioButton",
"FormField-RichText",
"FormField-SingleLineText",
"FormField-StaticText",
"FormField-Typeahead",
"FormMetadataResponse",
"RanActionResponse",
"WidgetFooter-CustomText",
"WidgetFooter-Created",
"WidgetFooter-Updated",
"WidgetMetadataResponse",
"WidgetField-DatetimeWithIcon",
"WidgetField-Pill",
"WidgetField-TextWithIcon",
"TypeaheadListResponse",
"TypeaheadItem",
"FormValues",
"BadRequestResponse",
"UnauthorizedResponse",
"ForbiddenResponse",
"NotFoundResponse",
"InternalServerErrorResponse"
]
},
"x-readme": {
"explorer-enabled": false
},
"servers": [
{
"url": "{siteUrl}",
"description": "Main endpoint."
}
],
"tags": [
{
"name": "Modal forms",
"description": "The modal form is displayed when the user starts the flow to create a resource. Asana will make a signed request to the specified `form_metadata_url` in the configuration, and expect a response with the metadata needed to create the form. This process is also used for forms within rule actions."
}
],
"components": {
"responses": {
"BadRequest": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BadRequestResponse"
}
}
}
},
"Unauthorized": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedResponse"
}
}
}
},
"Forbidden": {
"description": "Forbidden",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ForbiddenResponse"
}
}
}
},
"NotFound": {
"description": "Not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotFoundResponse"
}
}
}
},
"InternalServerError": {
"description": "Server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InternalServerErrorResponse"
}
}
}
}
},
"schemas": {
"RootUIComponentRequest": {
"description": "The building block of all app component requests.",
"type": "object",
"properties": {
"expires_at": {
"type": "string",
"description": "The time (in ISO 8601 date format) when the request should expire.",
"example": "2019-04-15T01:01:46.055Z"
},
"user": {
"type": "string",
"description": "The user GID this hook is coming from.",
"example": "54321"
},
"workspace": {
"type": "string",
"description": "The workspace GID this hook is coming from.",
"example": "12345"
}
}
},
"BadRequestResponse": {
"description": "An error response object indicating a bad request (i.e., a status code of `400`).",
"type": "object",
"properties": {
"error": {
"description": "The error to display.",
"type": "string",
"example": "Illegal or malformed request."
}
}
},
"ForbiddenResponse": {
"description": "An error response object indicating a forbidden request (i.e., a status code of `403`).",
"type": "object",
"properties": {
"error": {
"description": "The error to display.",
"type": "string",
"example": "Access forbidden."
}
}
},
"InternalServerErrorResponse": {
"description": "An error response object indicating a request that could not be found (i.e., a status code of `500`).",
"type": "object",
"properties": {
"error": {
"description": "The error to display.",
"type": "string",
"example": "Internal server error."
}
}
},
"NotFoundResponse": {
"description": "An error response object indicating a request that could not be found (i.e., a status code of `404`).",
"type": "object",
"properties": {
"error": {
"description": "The error to display.",
"type": "string",
"example": "Not found."
}
}
},
"TypeaheadItem": {
"description": "An object describing a typeahead result.",
"type": "object",
"required": [
"title",
"value"
],
"properties": {
"title": {
"description": "The title of the typeahead item.",
"type": "string",
"example": "OTP Team PF"
},
"subtitle": {
"description": "The subtitle of the typeahead item.",
"type": "string",
"example": "OTP"
},
"value": {
"description": "The value of the typeahead item.",
"type": "string",
"example": "OTP"
},
"icon_url": {
"description": "The URL of the icon to display next to the title.",
"type": "string",
"example": "https://example-icon.png"
}
}
},
"TypeaheadListRequest": {
"allOf": [
{
"$ref": "#/components/schemas/RootUIComponentRequest"
},
{
"type": "object",
"description": "The body of a typeahead request.",
"properties": {
"workspace": {
"type": "string",
"description": "The workspace GID this hook is coming from.",
"example": "12345"
},
"query": {
"type": "string",
"description": "The user's input in the typeahead text input.",
"example": "Messages"
},
"task": {
"type": "string",
"description": "*Conditional*. The task GID this hook is coming from. `task` is only present in the [modal form](/docs/modal-form) (as there is a \"context task\"), but not in the [rule action](/docs/rule-action) (as rules are associated with a _project_).",
"example": "67890"
},
"user": {
"type": "string",
"description": "The user GID this hook is coming from.",
"example": "54321"
},
"expires_at": {
"type": "string",
"description": "The time (in ISO 8601 format) when the request should expire.",
"example": "2019-04-15T01:01:46.055Z"
}
}
}
]
},
"TypeaheadListResponse": {
"description": "The response to a successful typeahead request.",
"type": "object",
"required": [
"items"
],
"properties": {
"header": {
"description": "*Optional*. Header text to display above the list of typeahead results. If no `header` is passed in or the value is an empty string, only the typeahead results with be rendered.",
"type": "string",
"example": "List of messages"
},
"items": {
"description": "Array of [TypeaheadItem](/reference/app-components/lookups#typeaheaditem) objects that indicate typeahead results.",
"type": "array",
"items": {
"$ref": "#/components/schemas/TypeaheadItem"
}
}
}
},
"UnauthorizedResponse": {
"description": "An error response object indicating a unauthorized request (i.e., a status code of `401`).",
"type": "object",
"properties": {
"error": {
"description": "The error to display.",
"type": "string",
"example": "Authorization required."
}
}
}
}
},
"paths": {
"/modal_form_typeahead_url_path_placeholder": {
"get": {
"summary": "Get modal form typeahead results",
"description": "_Note: The path is a placeholder. The actual path is determined by the configuration of the app component._\n\nIf a modal form field is of type `typehead`, this operation gets typeahead results to render as a dropdown list.\n\nWhen the user types into a modal form form field, Asana will send a request containing the entered string to the application's `typeahead_url`. The list of [TypeaheadItem](/reference/app-components/lookups#typeaheaditem)s in the response will then be rendered in a dropdown list. <br> <br> <a href=\"https://d3ki9tyy5l5ruj.cloudfront.net/obj/9ddc32f45cb458d111912b8fe8353bf8f682d6b9/ac-form-typeahead.png\">\n \n</a>",
"tags": [
"Modal forms"
],
"operationId": "getModalFormTypeaheadResults",
"requestBody": {
"description": "Request to retrieve typeahead results in a modal form typeahead form field.",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TypeaheadListRequest"
}
}
}
},
"responses": {
"200": {
"description": "Successfully retrieved typeahead results.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TypeaheadListResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
}
}
}