{
  "kind": "discovery#restDescription",
  "fullyEncodeReservedExpansion": true,
  "parameters": {
    "access_token": {
      "location": "query",
      "type": "string",
      "description": "OAuth access token."
    },
    "fields": {
      "location": "query",
      "type": "string",
      "description": "Selector specifying which fields to include in a partial response."
    },
    "uploadType": {
      "location": "query",
      "type": "string",
      "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")."
    },
    "oauth_token": {
      "type": "string",
      "description": "OAuth 2.0 token for the current user.",
      "location": "query"
    },
    "upload_protocol": {
      "location": "query",
      "type": "string",
      "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")."
    },
    "alt": {
      "enum": [
        "json",
        "media",
        "proto"
      ],
      "enumDescriptions": [
        "Responses with Content-Type of application/json",
        "Media download with context-dependent Content-Type",
        "Responses with Content-Type of application/x-protobuf"
      ],
      "location": "query",
      "type": "string",
      "description": "Data format for response.",
      "default": "json"
    },
    "callback": {
      "location": "query",
      "type": "string",
      "description": "JSONP"
    },
    "$.xgafv": {
      "enum": [
        "1",
        "2"
      ],
      "enumDescriptions": [
        "v1 error format",
        "v2 error format"
      ],
      "location": "query",
      "type": "string",
      "description": "V1 error format."
    },
    "key": {
      "type": "string",
      "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
      "location": "query"
    },
    "prettyPrint": {
      "default": "true",
      "location": "query",
      "type": "boolean",
      "description": "Returns response with indentations and line breaks."
    },
    "quotaUser": {
      "type": "string",
      "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
      "location": "query"
    }
  },
  "revision": "20260408",
  "canonicalName": "My Business Q&A",
  "servicePath": "",
  "schemas": {
    "ListQuestionsResponse": {
      "description": "Response message for QuestionsAndAnswers.ListQuestions",
      "type": "object",
      "properties": {
        "totalSize": {
          "format": "int32",
          "description": "The total number of questions posted for this location across all pages.",
          "type": "integer"
        },
        "nextPageToken": {
          "description": "If the number of questions exceeds the requested max page size, this field is populated with a token to fetch the next page of questions on a subsequent call. If there are no more questions, this field is not present in the response.",
          "type": "string"
        },
        "questions": {
          "items": {
            "$ref": "Question"
          },
          "description": "The requested questions,",
          "type": "array"
        }
      },
      "id": "ListQuestionsResponse"
    },
    "Author": {
      "description": "Represents the author of a question or answer",
      "type": "object",
      "properties": {
        "displayName": {
          "description": "The display name of the user",
          "type": "string"
        },
        "profilePhotoUri": {
          "description": "The profile photo URI of the user.",
          "type": "string"
        },
        "type": {
          "description": "The type of user the author is.",
          "type": "string",
          "enum": [
            "AUTHOR_TYPE_UNSPECIFIED",
            "REGULAR_USER",
            "LOCAL_GUIDE",
            "MERCHANT"
          ],
          "enumDescriptions": [
            "This should not be used.",
            "A regular user.",
            "A Local Guide",
            "The owner/manager of the location"
          ]
        }
      },
      "id": "Author"
    },
    "Question": {
      "id": "Question",
      "properties": {
        "upvoteCount": {
          "description": "Output only. The number of upvotes for the question.",
          "type": "integer",
          "format": "int32",
          "readOnly": true
        },
        "createTime": {
          "format": "google-datetime",
          "description": "Output only. The timestamp for when the question was written.",
          "type": "string",
          "readOnly": true
        },
        "topAnswers": {
          "readOnly": true,
          "items": {
            "$ref": "Answer"
          },
          "description": "Output only. A list of answers to the question, sorted by upvotes. This may not be a complete list of answers depending on the request parameters (answers_per_question)",
          "type": "array"
        },
        "totalAnswerCount": {
          "format": "int32",
          "description": "Output only. The total number of answers posted for this question.",
          "type": "integer",
          "readOnly": true
        },
        "name": {
          "description": "Immutable. The unique name for the question. locations/*/questions/* This field will be ignored if set during question creation.",
          "type": "string"
        },
        "author": {
          "description": "Output only. The author of the question.",
          "readOnly": true,
          "$ref": "Author"
        },
        "updateTime": {
          "format": "google-datetime",
          "description": "Output only. The timestamp for when the question was last modified.",
          "type": "string",
          "readOnly": true
        },
        "text": {
          "description": "Required. The text of the question. It should contain at least three words and the total length should be greater than or equal to 10 characters. The maximum length is 4096 characters.",
          "type": "string"
        }
      },
      "description": "Represents a single question and some of its answers.",
      "type": "object"
    },
    "Answer": {
      "properties": {
        "name": {
          "description": "Output only. The unique name for the answer locations/*/questions/*/answers/*",
          "type": "string",
          "readOnly": true
        },
        "upvoteCount": {
          "format": "int32",
          "description": "Output only. The number of upvotes for the answer.",
          "type": "integer",
          "readOnly": true
        },
        "createTime": {
          "readOnly": true,
          "description": "Output only. The timestamp for when the answer was written. Only retrieved during ListResponse fetching.",
          "type": "string",
          "format": "google-datetime"
        },
        "text": {
          "description": "Required. The text of the answer. It should contain at least one non-whitespace character. The maximum length is 4096 characters.",
          "type": "string"
        },
        "author": {
          "description": "Output only. The author of the answer. Will only be set during list operations.",
          "readOnly": true,
          "$ref": "Author"
        },
        "updateTime": {
          "format": "google-datetime",
          "description": "Output only. The timestamp for when the answer was last modified.",
          "type": "string",
          "readOnly": true
        }
      },
      "id": "Answer",
      "description": "Represents an answer to a question",
      "type": "object"
    },
    "Empty": {
      "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }",
      "type": "object",
      "properties": {},
      "id": "Empty"
    },
    "UpsertAnswerRequest": {
      "properties": {
        "answer": {
          "$ref": "Answer",
          "description": "Required. The new answer."
        }
      },
      "id": "UpsertAnswerRequest",
      "description": "Request message for QuestionsAndAnswers.UpsertAnswer",
      "type": "object"
    },
    "ListAnswersResponse": {
      "properties": {
        "nextPageToken": {
          "description": "If the number of answers exceeds the requested max page size, this field is populated with a token to fetch the next page of answers on a subsequent call. If there are no more answers, this field is not present in the response.",
          "type": "string"
        },
        "totalSize": {
          "description": "The total number of answers posted for this question across all pages.",
          "type": "integer",
          "format": "int32"
        },
        "answers": {
          "description": "The requested answers.",
          "type": "array",
          "items": {
            "$ref": "Answer"
          }
        }
      },
      "id": "ListAnswersResponse",
      "description": "Response message for QuestionsAndAnswers.ListAnswers",
      "type": "object"
    }
  },
  "resources": {
    "locations": {
      "resources": {
        "questions": {
          "resources": {
            "answers": {
              "methods": {
                "upsert": {
                  "parameterOrder": [
                    "parent"
                  ],
                  "id": "mybusinessqanda.locations.questions.answers.upsert",
                  "parameters": {
                    "parent": {
                      "description": "Required. The name of the question to write an answer for.",
                      "pattern": "^locations/[^/]+/questions/[^/]+$",
                      "type": "string",
                      "required": true,
                      "location": "path"
                    }
                  },
                  "flatPath": "v1/locations/{locationsId}/questions/{questionsId}/answers:upsert",
                  "response": {
                    "$ref": "Answer"
                  },
                  "httpMethod": "POST",
                  "request": {
                    "$ref": "UpsertAnswerRequest"
                  },
                  "path": "v1/{+parent}/answers:upsert",
                  "description": "Creates an answer or updates the existing answer written by the user for the specified question. A user can only create one answer per question."
                },
                "list": {
                  "flatPath": "v1/locations/{locationsId}/questions/{questionsId}/answers",
                  "response": {
                    "$ref": "ListAnswersResponse"
                  },
                  "id": "mybusinessqanda.locations.questions.answers.list",
                  "parameters": {
                    "orderBy": {
                      "description": "Optional. The order to return the answers. Valid options include 'update_time desc' and 'upvote_count desc', which will return the answers sorted descendingly by the requested field. The default sort order is 'update_time desc'.",
                      "type": "string",
                      "location": "query"
                    },
                    "parent": {
                      "description": "Required. The name of the question to fetch answers for.",
                      "pattern": "^locations/[^/]+/questions/[^/]+$",
                      "type": "string",
                      "required": true,
                      "location": "path"
                    },
                    "pageSize": {
                      "location": "query",
                      "format": "int32",
                      "description": "Optional. How many answers to fetch per page. The default and maximum `page_size` values are 10.",
                      "type": "integer"
                    },
                    "pageToken": {
                      "location": "query",
                      "description": "Optional. If specified, the next page of answers is retrieved.",
                      "type": "string"
                    }
                  },
                  "parameterOrder": [
                    "parent"
                  ],
                  "path": "v1/{+parent}/answers",
                  "description": "Returns the paginated list of answers for a specified question.",
                  "httpMethod": "GET"
                },
                "delete": {
                  "path": "v1/{+name}/answers:delete",
                  "description": "Deletes the answer written by the current user to a question.",
                  "parameterOrder": [
                    "name"
                  ],
                  "httpMethod": "DELETE",
                  "response": {
                    "$ref": "Empty"
                  },
                  "flatPath": "v1/locations/{locationsId}/questions/{questionsId}/answers:delete",
                  "id": "mybusinessqanda.locations.questions.answers.delete",
                  "parameters": {
                    "name": {
                      "description": "Required. The name of the question to delete an answer for.",
                      "pattern": "^locations/[^/]+/questions/[^/]+$",
                      "type": "string",
                      "location": "path",
                      "required": true
                    }
                  }
                }
              }
            }
          },
          "methods": {
            "list": {
              "response": {
                "$ref": "ListQuestionsResponse"
              },
              "flatPath": "v1/locations/{locationsId}/questions",
              "id": "mybusinessqanda.locations.questions.list",
              "parameters": {
                "pageSize": {
                  "location": "query",
                  "format": "int32",
                  "description": "Optional. How many questions to fetch per page. The default and maximum `page_size` values are 10.",
                  "type": "integer"
                },
                "filter": {
                  "location": "query",
                  "description": "Optional. A filter constraining the questions to return. The only filter currently supported is \"ignore_answered=true\"",
                  "type": "string"
                },
                "orderBy": {
                  "description": "Optional. The order to return the questions. Valid options include 'update_time desc' and 'upvote_count desc', which will return the questions sorted descendingly by the requested field. The default sort order is 'update_time desc'.",
                  "type": "string",
                  "location": "query"
                },
                "parent": {
                  "required": true,
                  "location": "path",
                  "description": "Required. The name of the location to fetch questions for.",
                  "pattern": "^locations/[^/]+/questions$",
                  "type": "string"
                },
                "pageToken": {
                  "description": "Optional. If specified, the next page of questions is retrieved.",
                  "type": "string",
                  "location": "query"
                },
                "answersPerQuestion": {
                  "location": "query",
                  "format": "int32",
                  "description": "Optional. How many answers to fetch per question. The default and maximum `answers_per_question` values are 10.",
                  "type": "integer"
                }
              },
              "path": "v1/{+parent}",
              "description": "Returns the paginated list of questions and some of its answers for a specified location. This operation is only valid if the specified location is verified.",
              "parameterOrder": [
                "parent"
              ],
              "httpMethod": "GET"
            },
            "create": {
              "path": "v1/{+parent}",
              "description": "Adds a question for the specified location.",
              "request": {
                "$ref": "Question"
              },
              "httpMethod": "POST",
              "parameterOrder": [
                "parent"
              ],
              "response": {
                "$ref": "Question"
              },
              "flatPath": "v1/locations/{locationsId}/questions",
              "id": "mybusinessqanda.locations.questions.create",
              "parameters": {
                "parent": {
                  "description": "Required. The name of the location to write a question for.",
                  "pattern": "^locations/[^/]+/questions$",
                  "type": "string",
                  "required": true,
                  "location": "path"
                }
              }
            },
            "patch": {
              "path": "v1/{+name}",
              "description": "Updates a specific question written by the current user.",
              "request": {
                "$ref": "Question"
              },
              "httpMethod": "PATCH",
              "response": {
                "$ref": "Question"
              },
              "flatPath": "v1/locations/{locationsId}/questions/{questionsId}",
              "id": "mybusinessqanda.locations.questions.patch",
              "parameters": {
                "name": {
                  "required": true,
                  "location": "path",
                  "description": "Immutable. The unique name for the question. locations/*/questions/* This field will be ignored if set during question creation.",
                  "pattern": "^locations/[^/]+/questions/[^/]+$",
                  "type": "string"
                },
                "updateMask": {
                  "format": "google-fieldmask",
                  "description": "Required. The specific fields to update. Only question text can be updated.",
                  "type": "string",
                  "location": "query"
                }
              },
              "parameterOrder": [
                "name"
              ]
            },
            "delete": {
              "flatPath": "v1/locations/{locationsId}/questions/{questionsId}",
              "response": {
                "$ref": "Empty"
              },
              "id": "mybusinessqanda.locations.questions.delete",
              "parameters": {
                "name": {
                  "location": "path",
                  "required": true,
                  "description": "Required. The name of the question to delete.",
                  "pattern": "^locations/[^/]+/questions/[^/]+$",
                  "type": "string"
                }
              },
              "parameterOrder": [
                "name"
              ],
              "path": "v1/{+name}",
              "description": "Deletes a specific question written by the current user.",
              "httpMethod": "DELETE"
            }
          }
        }
      }
    }
  },
  "basePath": "",
  "ownerName": "Google",
  "documentationLink": "https://developers.google.com/my-business/",
  "batchPath": "batch",
  "icons": {
    "x16": "http://www.google.com/images/icons/product/search-16.gif",
    "x32": "http://www.google.com/images/icons/product/search-32.gif"
  },
  "protocol": "rest",
  "version": "v1",
  "description": "The My Business Q&A API allows questions and answers to be posted for specific listings. Note - If you have a quota of 0 after enabling the API, please request for GBP API access.",
  "rootUrl": "https://mybusinessqanda.googleapis.com/",
  "mtlsRootUrl": "https://mybusinessqanda.mtls.googleapis.com/",
  "baseUrl": "https://mybusinessqanda.googleapis.com/",
  "name": "mybusinessqanda",
  "version_module": true,
  "discoveryVersion": "v1",
  "title": "My Business Q&A API",
  "id": "mybusinessqanda:v1",
  "ownerDomain": "google.com"
}
