Appearance
On submit callback ​
API ReferenceNote: The path is a placeholder. The actual path is determined by the configuration of the app component.
The callback request made to an app server when a form is submitted. The request is subject to a 10-second timeout if no response is received from the app server.
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": {
"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"
}
}
},
"AttachedResourceResponse": {
"description": "The response to a successful lookup request.",
"type": "object",
"required": [
"resource_name",
"resource_url"
],
"properties": {
"resource_name": {
"description": "The name of the attached resource",
"type": "string",
"example": "Build the Thing"
},
"resource_url": {
"description": "The URL of the attached resource",
"type": "string",
"example": "https://example.atlassian.net/browse/CP-1"
},
"error": {
"description": "The error that should be displayed to the user",
"type": "string",
"example": "No resource matched that input"
}
}
},
"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."
}
}
},
"FormMetadataResponse": {
"description": "Contains the metadata that describes how to display and manage a form.",
"type": "object",
"required": [
"metadata",
"template"
],
"properties": {
"template": {
"description": "The interface name and version of a distinct form UI layout. A `template` is directly associated with a particular `metadata` schema.",
"type": "string",
"enum": [
"form_metadata_v0"
],
"example": "form_metadata_v0"
},
"metadata": {
"description": "The metadata (i.e., underlying definition) of a form. `metadata` must exist alongside a `template`, and its schema must be specific to the value of that `template`.",
"type": "object",
"required": [
"fields",
"title"
],
"properties": {
"title": {
"description": "The title of the form, which is displayed at the top of the creation form",
"type": "string",
"example": "Create New Issue"
},
"fields": {
"description": "An array of form field objects that are rendered in the order they are in the array. Limit of 30 fields.\n\nValid object schemas: [FormField-Checkbox](/reference/app-components-forms/modal-forms#formfield-checkbox), [FormField-Date](/reference/app-components-forms/modal-forms#formfield-date), [FormField-Datetime](/reference/app-components-forms/modal-forms#formfield-datetime), [FormField-Dropdown](/reference/app-components-forms/modal-forms#formfield-dropdown), [FormField-MultiLineText](/reference/app-components-forms/modal-forms#formfield-multilinetext), [FormField-RadioButton](/reference/app-components-forms/modal-forms#formfield-radiobutton), [FormField-RichText](/reference/app-components-forms/modal-forms#formfield-richtext), [FormField-SingleLineText](/reference/app-components-forms/modal-forms#formfield-singlelinetext), [FormField-StaticText](/reference/app-components-forms/modal-forms#formfield-statictext), [FormField-Typeahead](/reference/app-components-forms/modal-forms#formfield-typeahead)",
"type": "array"
},
"on_submit_callback": {
"description": "The URL to `POST` the form to when the user clicks the submit button. If this is field is omitted then the submission button will be disabled. This is useful if the user must enter information in a watched field first, such as to show additional fields.",
"type": "string",
"example": "https://www.example.com/on_submit"
},
"on_change_callback": {
"description": "The URL to `POST` the form to whenever watched field values are changed.",
"type": "string",
"example": "https://www.example.com/on_change"
}
}
}
}
},
"FormOnChangeFormSubmissionRequest": {
"description": "Common properties between app component on change and on submit requests.",
"properties": {
"values": {
"type": "object",
"description": "An object that maps each FormField’s GID to its value.\nRefer to the `value` property on the FormField schema: [FormField-Checkbox](/reference/app-components-forms/modal-forms#formfield-checkbox), [FormField-Date](/reference/app-components-forms/modal-forms#formfield-date), [FormField-Datetime](/reference/app-components-forms/modal-forms#formfield-datetime), [FormField-Dropdown](/reference/app-components-forms/modal-forms#formfield-dropdown), [FormField-MultiLineText](/reference/app-components-forms/modal-forms#formfield-multilinetext), [FormField-RadioButton](/reference/app-components-forms/modal-forms#formfield-radiobutton), [FormField-RichText](/reference/app-components-forms/modal-forms#formfield-richtext), [FormField-SingleLineText](/reference/app-components-forms/modal-forms#formfield-singlelinetext), [FormField-StaticText](/reference/app-components-forms/modal-forms#formfield-statictext), [FormField-Typeahead](/reference/app-components-forms/modal-forms#formfield-typeahead)",
"example": {
"checkbox_field_1": [
"opt-in"
],
"date_field_1": "2021-12-31T08:00:00.000Z",
"datetime_field_1": "2023-01-01T00:00:00.000Z",
"dropdown_field_1": "red",
"multi_line_text_field_1": "Multiline Text",
"radio_button_field_1": "blue",
"rich_text_field_1": "<BODY>Rich Text</BODY>",
"single_line_text_field_1": "Single Line Text",
"static_text_field_1": "Static Text",
"typeahead_field_1": {
"icon_url": "https://example.com/icon.png",
"subtitle": "Subtitle",
"title": "Title",
"value": "Typeahead"
}
}
}
}
},
"FormSubmissionRequest": {
"allOf": [
{
"$ref": "#/components/schemas/RootUIComponentRequest"
},
{
"$ref": "#/components/schemas/FormOnChangeFormSubmissionRequest"
},
{
"type": "object",
"description": "The body of a form submission.",
"properties": {
"task": {
"type": "string",
"description": "The task GID this hook is coming from.",
"example": "67890"
}
}
}
]
},
"OnSubmitCallbackRequest": {
"allOf": [
{
"$ref": "#/components/schemas/FormSubmissionRequest"
},
{
"type": "object",
"properties": {
"attachment": {
"type": "string",
"description": "The GID of the attachment created from the form submission.",
"example": "12345"
}
}
}
]
},
"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."
}
}
},
"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": {
"/on_submit_callback_path_placeholder": {
"post": {
"summary": "On submit callback",
"description": "_Note: The path is a placeholder. The actual path is determined by the configuration of the app component._\n\nThe callback request made to an app server when a form is submitted. The request is subject to a 10-second timeout if no response is received from the app server. <br> <br> <a href=\"https://d3ki9tyy5l5ruj.cloudfront.net/obj/a58c2641ab72105505ea9d63cf27098d79e56c71/ac-form-on-submit.png\">\n \n</a>",
"tags": [
"Modal forms"
],
"operationId": "onFormSubmit",
"requestBody": {
"description": "Request to notify of a form submission.",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OnSubmitCallbackRequest"
}
}
}
},
"responses": {
"200": {
"description": "Successfully attached the resource created by the form.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AttachedResourceResponse"
}
}
}
},
"400": {
"description": "Something was wrong with the form data.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FormMetadataResponse"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
}
}
}