API usage overview

This guide provides an overview of using the Dialogflow API and its reference documentation.

REST, gRPC, and client libraries

You can access the API via REST, gRPC, or one of the provided client libraries (built on gRPC).

Client libraries

Google provides client libraries for many popular languages to access this API. If your desired programming language is supported by the client libraries, you should use this option.

Pros Cons
Maintained by Google.
Built-in authentication.
Built-in retries.
Idiomatic for each language.
Efficient protocol buffer HTTP request body.
Not available for all programming languages.

REST

This API supports REST. See the REST reference.

Pros Cons
Simple JSON interface.
Well supported by many Google and third-party tools and libraries.
You must build your own client.
You must implement authentication.
You must implement retries.
Less efficient JSON HTTP request body.
REST streaming is not supported by this API.

gRPC

This API supports gRPC. See the RPC reference, which provides a generic description of the types, methods, and fields generated for a gRPC library.

Pros Cons
Supports many programming languages.
Efficient protocol buffer HTTP request body.
You must generate your own client from Google-supplied protocol buffers.
You must implement authentication.
You must implement retries.

Type, method, and field names

Depending on whether you are using client libraries, REST, or gRPC, the type, method, and field names for the API vary somewhat:

  • REST is arranged by resource hierarchies and their methods.
  • Client libraries and gRPC are arranged by services and their methods.
  • REST field names use camel case, though the API service will accept either camel case or snake case.
  • gRPC field names use snake case.
  • Client library field names use either title case, camel case or snake case, depending on which name is idiomatic for the language.

API versions

The following API versions are available:

  • V2: Stable, generally available.
  • V2Beta1: Used to share the latest, upcoming beta features.