AppResponse

AppResponse is the response for the HTTP API call from the Assistant to the app. The response to AppRequest must occur within 5 seconds of the app receiving a request.

JSON representation
{
  "conversationToken": string,
  "expectUserResponse": boolean,
  "expectedInputs": [
    {
      object(ExpectedInput)
    }
  ],
  "finalResponse": {
    object(FinalResponse)
  },
  "customPushMessage": {
    object(CustomPushMessage)
  },
  "responseMetadata": {
    object(ResponseMetadata)
  },
  "isInSandbox": boolean,
}
Fields
conversationToken

string

An opaque token that is recirculated to the app every conversation turn.

expectUserResponse

boolean

Indicates whether the app is expecting a user response. This is true when the conversation is ongoing, false when the conversation is done.

expectedInputs[]

object(ExpectedInput)

List of inputs the app expects, each input can be a built-in intent, or an input taking list of possible intents. Only one input is supported for now.

finalResponse

object(FinalResponse)

Final response when the app does not expect user's input.

customPushMessage

object(CustomPushMessage)

Custom Push Message allows developers to send structured data to Google for interactions on the Assistant.

responseMetadata

object(ResponseMetadata)

Metadata passed from bot builder platforms to Google. This metadata can contain error and logging information that bot building platforms want to expose to the app developer.

isInSandbox

boolean

Indicates whether the response should be handled in sandbox mode. This bit is needed to push structured data to Google in sandbox mode.

ExpectedInput

JSON representation
{
  "inputPrompt": {
    object(InputPrompt)
  },
  "possibleIntents": [
    {
      object(ExpectedIntent)
    }
  ],
  "speechBiasingHints": [
    string
  ],
}
Fields
inputPrompt

object(InputPrompt)

The customized prompt used to ask user for input.

possibleIntents[]

object(ExpectedIntent)

List of intents that can be used to fulfill this input. To have the Google Assistant just return the raw user input, the app should ask for the actions.intent.TEXT intent.

speechBiasingHints[]

string

List of phrases the app wants Google to use for speech biasing. Up to 1000 phrases are allowed.

InputPrompt

The input prompt used for assistant to guide user to provide an input for the app's question.

JSON representation
{
  "richInitialPrompt": {
    object(RichResponse)
  },
  "noInputPrompts": [
    {
      object(SimpleResponse)
    }
  ],
}
Fields
richInitialPrompt

object(RichResponse)

Prompt payload.

noInputPrompts[]

object(SimpleResponse)

Prompt used to ask user when there is no input from user.

RichResponse

A rich response that can include audio, text, cards, suggestions and structured data.

JSON representation
{
  "items": [
    {
      object(Item)
    }
  ],
  "suggestions": [
    {
      object(Suggestion)
    }
  ],
  "linkOutSuggestion": {
    object(LinkOutSuggestion)
  },
}
Fields
items[]

object(Item)

A list of UI elements which compose the response The items must meet the following requirements: 1. The first item must be a google.actions.v2.SimpleResponse 2. At most two google.actions.v2.SimpleResponse 3. At most one card (e.g. google.actions.v2.ui_elements.BasicCard or google.actions.v2.StructuredResponse or google.actions.v2.MediaResponse 4. Cards may not be used if an actions.intent.OPTION intent is used ie google.actions.v2.ui_elements.ListSelect or google.actions.v2.ui_elements.CarouselSelect

suggestions[]

object(Suggestion)

A list of suggested replies. These will always appear at the end of the response. If used in a FinalResponse, they will be ignored.

Item

Items of the response.

JSON representation
{

  // Union field item can be only one of the following:
  "simpleResponse": {
    object(SimpleResponse)
  },
  "basicCard": {
    object(BasicCard)
  },
  "structuredResponse": {
    object(StructuredResponse)
  },
  // End of list of possible types for union field item.
}
Fields
Union field item. Type of item. item can be only one of the following:
simpleResponse

object(SimpleResponse)

Voice and text-only response.

basicCard

object(BasicCard)

A basic card.

structuredResponse

object(StructuredResponse)

Structured payload to be processed by Google.

SimpleResponse

A simple response containing speech or text to show the user.

JSON representation
{
  "textToSpeech": string,
  "ssml": string,
  "displayText": string,
}
Fields
textToSpeech

string

Plain text of the speech output, e.g., "where do you want to go?" Mutually exclusive with ssml.

ssml

string

Structured spoken response to the user in the SSML format, e.g. <speak> Say animal name after the sound. <audio src = 'https://www.pullstring.com/moo.mps' />, what’s the animal? </speak>. Mutually exclusive with textToSpeech.

displayText

string

Optional text to display in the chat bubble. If not given, a display rendering of the textToSpeech or ssml above will be used. Limited to 640 chars.

BasicCard

A basic card for displaying some information, e.g. an image and/or text.

JSON representation
{
  "title": string,
  "subtitle": string,
  "formattedText": string,
  "image": {
    object(Image)
  },
  "buttons": [
    {
      object(Button)
    }
  ],
}
Fields
title

string

Overall title of the card. Optional.

subtitle

string

Optional.

formattedText

string

Body text of the card. Supports a limited set of markdown syntax for formatting. Required, unless image is present.

image

object(Image)

A hero image for the card. The height is fixed to 192dp. Optional.

buttons[]

object(Button)

Buttons. Currently at most 1 button is supported. Optional.

Button

A button object that usually appears at the bottom of a card.

JSON representation
{
  "title": string,
  "openUrlAction": {
    object(OpenUrlAction)
  },
}
Fields
title

string

Title of the button. Required.

openUrlAction

object(OpenUrlAction)

Action to take when a user taps on the button. Required.

OpenUrlAction

Opens the given url.

JSON representation
{
  "url": string,
}
Fields
url

string

http or https scheme url. Required.

StructuredResponse

The response defined for app to respond with structured data.

JSON representation
{
  "orderUpdate": {
    object(OrderUpdate)
  },
}
Fields
orderUpdate

object(OrderUpdate)

App provides an order update (e.g. Receipt) after receiving the order.

OrderUpdate

Update to an order.

JSON representation
{
  "googleOrderId": string,
  "actionOrderId": string,
  "orderState": {
    object(OrderState)
  },
  "orderManagementActions": [
    {
      object(Action)
    }
  ],
  "receipt": {
    object(Receipt)
  },
  "updateTime": string,
  "totalPrice": {
    object(Price)
  },
  "lineItemUpdates": {
    string: {
      object(LineItemUpdate)
    },
    ...
  },
  "userNotification": {
    object(UserNotification)
  },
  "infoExtension": {
    "@type": string,
    field1: ...,
    ...
  },

  // Union field info can be only one of the following:
  "rejectionInfo": {
    object(RejectionInfo)
  },
  "cancellationInfo": {
    object(CancellationInfo)
  },
  "inTransitInfo": {
    object(InTransitInfo)
  },
  "fulfillmentInfo": {
    object(FulfillmentInfo)
  },
  "returnInfo": {
    object(ReturnInfo)
  },
  // End of list of possible types for union field info.
}
Fields
googleOrderId

string

Id of the order is the Google-issued id.

actionOrderId

string

Required. The canonical order id referencing this order. If integrators don't generate the canonical order id in their system, they can simply copy over googleOrderId included in order.

orderState

object(OrderState)

The new state of the order.

orderManagementActions[]

object(Action)

Updated applicable management actions for the order, e.g. manage, modify, contact support.

receipt

object(Receipt)

Receipt for order.

updateTime

string (Timestamp format)

When the order was updated from the app's perspective.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

totalPrice

object(Price)

New total price of the order

lineItemUpdates

map (key: string, value: object(LineItemUpdate))

Map of line item-level changes, keyed by item id. Optional.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

userNotification

object(UserNotification)

If specified, displays a notification to the user with the specified title and text. Specifying a notification is a suggestion to notify and is not guaranteed to result in a notification.

infoExtension

object

Extra data based on a custom order state or in addition to info of a standard state.

An object containing fields of an arbitrary type. An additional field "@type" contains a URI identifying the type. Example: { "id": 1234, "@type": "types.example.com/standard/id" }.

Union field info. Extra information associated with the state of the order. info can be only one of the following:
rejectionInfo

object(RejectionInfo)

Information about rejection state.

cancellationInfo

object(CancellationInfo)

Information about cancellation state.

inTransitInfo

object(InTransitInfo)

Information about in transit state.

fulfillmentInfo

object(FulfillmentInfo)

Information about fulfillment state.

returnInfo

object(ReturnInfo)

Information about returned state.

Action

A follow-up action associated with the order update.

JSON representation
{
  "type": enum(ActionType),
  "button": {
    object(Button)
  },
}
Fields
type

enum(ActionType)

Type of action.

button

object(Button)

Button label and link.

Receipt

Receipt when state is CONFIRMED or any other state (e.g. IN_TRANSIT, FULFILLED) inclusive of CONFIRMED state.

JSON representation
{
  "confirmedActionOrderId": string,
  "userVisibleOrderId": string,
}
Fields
confirmedActionOrderId

string

Required. Confirmed order id when order has been received by the integrator. This is the canonical order id used in integrator's system referencing the order and may subsequently be used to identify the order as actionOrderId.

userVisibleOrderId

string

Optional. The user facing id referencing to current order, which will show up in the receipt card if present. This should be the id that usually appears on a printed receipt or receipt sent to user's email. User should be able to use this id referencing her order for customer service provided by integrators. Note that this field must be populated if integrator does generate user facing id for an order with a printed receipt / email receipt.

RejectionInfo

The rejection info when state is REJECTED. This message can be populated in the initial order update in conversation or through subsequent async order update.

JSON representation
{
  "type": enum(ReasonType),
  "reason": string,
}
Fields
type

enum(ReasonType)

Rejection type.

reason

string

Reason for the error.

CancellationInfo

The cancellation info when state is CANCELLED.

JSON representation
{
  "reason": string,
}
Fields
reason

string

Reason for cancellation.

InTransitInfo

The in-transit info when state is IN_TRANSIT.

JSON representation
{
  "updatedTime": string,
}
Fields
updatedTime

string (Timestamp format)

Last updated time for in transit.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

FulfillmentInfo

The fulfillment info when state is FULFILLED.

JSON representation
{
  "deliveryTime": string,
}
Fields
deliveryTime

string (Timestamp format)

When the order will be fulfilled.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

ReturnInfo

The return info when state is REJECTED.

JSON representation
{
  "reason": string,
}
Fields
reason

string

Reason for return.

UserNotification

Optional user notification to display as part of the Order update.

JSON representation
{
  "title": string,
  "text": string,
}
Fields
title

string

The title for the user notification.

text

string

The contents of the notification.

Suggestion

A suggestion chip that the user can tap to quickly post a reply to the conversation.

JSON representation
{
  "title": string,
}
Fields
title

string

The text shown the in the suggestion chip. When tapped, this text will be posted back to the conversation verbatim as if the user had typed it. Each title must be unique among the set of suggestion chips. Max 25 chars Required

LinkOutSuggestion

Creates a suggestion chip that allows the user to jump out to the App or Website associated with this agent.

JSON representation
{
  "destinationName": string,
  "url": string,
}
Fields
destinationName

string

The name of the app or site this chip is linking to. The chip will be rendered with the title "Open ". Max 20 chars. Required.

url

string

The URL of the App or Site to open when the user taps the suggestion chip. Ownership of this URL must be validated in the Actions on Google developer console, or the suggestion will not be shown to the user.

ExpectedIntent

The expected intent the app is asking the assistant to provide.

JSON representation
{
  "intent": string,
  "inputValueData": {
    "@type": string,
    field1: ...,
    ...
  },
  "parameterName": string,
  "trigger": {
    object(Trigger)
  },
}
Fields
intent

string

The built-in intent name, e.g. actions.intent.TEXT, or intents defined in the action package. If the intent specified is not a built-in intent, it is only used for speech biasing and the input provided by the Google Assistant will be the actions.intent.TEXT intent.

inputValueData

object

Additional configuration data required by a built-in intent. Possible values for the built-in intents: actions.intent.OPTION -> google.actions.v2.OptionValueSpec, actions.intent.CONFIRMATION -> google.actions.v2.ConfirmationValueSpec, actions.intent.TRANSACTION_REQUIREMENTS_CHECK -> google.actions.v2.TransactionRequirementsCheckSpec, actions.intent.DELIVERY_ADDRESS -> google.actions.v2.DeliveryAddressValueSpec, actions.intent.TRANSACTION_DECISION -> google.actions.v2.TransactionDecisionValueSpec

An object containing fields of an arbitrary type. An additional field "@type" contains a URI identifying the type. Example: { "id": 1234, "@type": "types.example.com/standard/id" }.

parameterName

string

Optionally, a parameter of the intent that is being requested. Only valid for requested intents. Used for speech biasing.

trigger

object(Trigger)

Optionally, associate a dynamic set of triggers with this expected intent. Used for speech biasing.

Trigger

Specification for a trigger.

JSON representation
{
  "queryPatterns": [
    string
  ],
}
Fields
queryPatterns[]

string

List of patterns used to identify the specified intent. Query patterns must only refer to parameters declared in the parameters field.

FinalResponse

The final response when the user input is not expected.

JSON representation
{
  "richResponse": {
    object(RichResponse)
  },
}
Fields
richResponse

object(RichResponse)

Rich response when user is not required to provide an input.

CustomPushMessage

A custom push message that holds structured data to push for the Actions Fulfillment API.

JSON representation
{
  "orderUpdate": {
    object(OrderUpdate)
  },
}
Fields
orderUpdate

object(OrderUpdate)

An order update updating orders placed through transaction APIs.

ResponseMetadata

ResponseMetadata is a container to pass any information from the agent cloud execution to the Assistant. User query handler related metadata.

JSON representation
{
  "status": {
    object(Status)
  },
}
Fields
status

object(Status)

Status of bot builder 3P invocation.

Status

The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. The error model is designed to be:

  • Simple to use and understand for most users
  • Flexible enough to meet unexpected needs

Overview

The Status message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers understand and resolve the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package google.rpc that can be used for common error conditions.

Language mapping

The Status message is the logical representation of the error model, but it is not necessarily the actual wire format. When the Status message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C.

Other uses

The error model and the Status message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments.

Example uses of this error model include:

  • Partial errors. If a service needs to return partial errors to the client, it may embed the Status in the normal response to indicate the partial errors.

  • Workflow errors. A typical workflow has multiple steps. Each step may have a Status message for error reporting.

  • Batch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response.

  • Asynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message.

  • Logging. If some API errors are stored in logs, the message Status could be used directly after any stripping needed for security/privacy reasons.

JSON representation
{
  "code": number,
  "message": string,
  "details": [
    {
      "@type": string,
      field1: ...,
      ...
    }
  ],
}
Fields
code

number

The status code, which should be an enum value of google.rpc.Code.

message

string

A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.

details[]

object

A list of messages that carry the error details. There is a common set of message types for APIs to use.

An object containing fields of an arbitrary type. An additional field "@type" contains a URI identifying the type. Example: { "id": 1234, "@type": "types.example.com/standard/id" }.