Как создать местоположение в Google my business account?
Я хочу создать несколько местоположений в списках местоположений моей бизнес-учетной записи. Сначала я хотел попробовать это в почтальоне. Я достал жетон доступа и воспользовался им. Я ввел параметры, как описано на веб-сайте :https://developers.google.com/my-business/reference/rest/v4/accounts.locations#Location если мне это удастся, я попробую это сделать в своем проекте .net с использованием языка C#. Однако я получил ошибку в postman, которая указана ниже. Не могли бы вы помочь мне сделать этот шаг, пожалуйста? Можете ли вы дать мне душевное решение этой проблемы?
Что я уже пробовал:
Я хочу создать несколько местоположений в списках местоположений моей бизнес-учетной записи. Сначала я хотел попробовать это в почтальоне. Я достал жетон доступа и воспользовался им. Я ввел параметры, как описано на веб-сайте :https://developers.google.com/my-business/reference/rest/v4/accounts.locations#Location если мне это удастся, я попробую это сделать в своем проекте .net с использованием языка C#. Однако я получил ошибку в postman, которая указана ниже. Не могли бы вы помочь мне достичь этого шага, пожалуйста? Можете ли вы дать мне душевное решение этой проблемы?
{ "error": { "code": 400, "message": "Invalid JSON payload received. Unknown name "relationshipData": Cannot bind query parameter. Field 'relationshipData' could not be found in request message.\nInvalid JSON payload received. Unknown name "name": Cannot bind query parameter. Field 'name' could not be found in request message.\nInvalid JSON payload received. Unknown name "store_code": Cannot bind query parameter. Field 'store_code' could not be found in request message.\nInvalid JSON payload received. Unknown name "regularHours": Cannot bind query parameter. Field 'regularHours' could not be found in request message.\nInvalid JSON payload received. Unknown name "language_code": Cannot bind query parameter. Field 'language_code' could not be found in request message.\nInvalid JSON payload received. Unknown name "primaryPhone": Cannot bind query parameter. Field 'primaryPhone' could not be found in request message.\nInvalid JSON payload received. Unknown name "address": Cannot bind query parameter. Field 'address' could not be found in request message.\nInvalid JSON payload received. Unknown name "labels": Cannot bind query parameter. Field 'labels' could not be found in request message.\nInvalid JSON payload received. Unknown name "adWordsLocationExtensions": Cannot bind query parameter. Field 'adWordsLocationExtensions' could not be found in request message.\nInvalid JSON payload received. Unknown name "locationState": Cannot bind query parameter. Field 'locationState' could not be found in request message.\nInvalid JSON payload received. Unknown name "primaryCategory": Cannot bind query parameter. Field 'primaryCategory' could not be found in request message.\nInvalid JSON payload received. Unknown name "attributes": Cannot bind query parameter. Field 'attributes' could not be found in request message.\nInvalid JSON payload received. Unknown name "profile": Cannot bind query parameter. Field 'profile' could not be found in request message.\nInvalid JSON payload received. Unknown name "openInfo": Cannot bind query parameter. Field 'openInfo' could not be found in request message.\nInvalid JSON payload received. Unknown name "additionalPhones": Cannot bind query parameter. Field 'additionalPhones' could not be found in request message.\nInvalid JSON payload received. Unknown name "specialHours": Cannot bind query parameter. Field 'specialHours' could not be found in request message.\nInvalid JSON payload received. Unknown name "location_name": Cannot bind query parameter. Field 'location_name' could not be found in request message.\nInvalid JSON payload received. Unknown name "metadata": Cannot bind query parameter. Field 'metadata' could not be found in request message.\nInvalid JSON payload received. Unknown name "priceLists": Cannot bind query parameter. Field 'priceLists' could not be found in request message.\nInvalid JSON payload received. Unknown name "latlng": Cannot bind query parameter. Field 'latlng' could not be found in request message.\nInvalid JSON payload received. Unknown name "locationKey": Cannot bind query parameter. Field 'locationKey' could not be found in request message.\nInvalid JSON payload received. Unknown name "websiteUrl": Cannot bind query parameter. Field 'websiteUrl' could not be found in request message.\nInvalid JSON payload received. Unknown name "serviceArea": Cannot bind query parameter. Field 'serviceArea' could not be found in request message.", "status": "INVALID_ARGUMENT", "details": [ { "@type": "type.googleapis.com/google.rpc.BadRequest", "fieldViolations": [ { "description": "Invalid JSON payload received. Unknown name "relationshipData": Cannot bind query parameter. Field 'relationshipData' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name "name": Cannot bind query parameter. Field 'name' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name "store_code": Cannot bind query parameter. Field 'store_code' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name "regularHours": Cannot bind query parameter. Field 'regularHours' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name "language_code": Cannot bind query parameter. Field 'language_code' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name "primaryPhone": Cannot bind query parameter. Field 'primaryPhone' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name "address": Cannot bind query parameter. Field 'address' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name "labels": Cannot bind query parameter. Field 'labels' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name "adWordsLocationExtensions": Cannot bind query parameter. Field 'adWordsLocationExtensions' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name "locationState": Cannot bind query parameter. Field 'locationState' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name "primaryCategory": Cannot bind query parameter. Field 'primaryCategory' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name "attributes": Cannot bind query parameter. Field 'attributes' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name "profile": Cannot bind query parameter. Field 'profile' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name "openInfo": Cannot bind query parameter. Field 'openInfo' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name "additionalPhones": Cannot bind query parameter. Field 'additionalPhones' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name "specialHours": Cannot bind query parameter. Field 'specialHours' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name "location_name": Cannot bind query parameter. Field 'location_name' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name " metadata \ ": Cannot bind query parameter. Field 'metadata' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name " priceLists \ ": Cannot bind query parameter. Field 'priceLists' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name " latlng \ ": Cannot bind query parameter. Field 'latlng' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name " locationKey \ ": Cannot bind query parameter. Field 'locationKey' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name " websiteUrl \ ": Cannot bind query parameter. Field 'websiteUrl' could not be found in request message." }, { "description": "Invalid JSON payload received. Unknown name " serviceArea \ ": Cannot bind query parameter. Field 'serviceArea' could not be found in request message." } ] } ] }
Richard MacCutchan
{ "ошибка": { "код": 400, "сообщение": "получена недопустимая полезная нагрузка JSON. Неизвестное имя "relationshipData"
В данных, которые вы отправляете в Google, определенно есть что-то неправильное.
muharrem altun
Привет Ричард,
Я попробовал использовать два параметра данных, и это дает тот же результат. Я не давал код местоположения, почтальон дает мне:
{
"ошибка": {
"код": 400,
"сообщение": "запрос содержит недопустимый аргумент.",
"статус": "INVALID_ARGUMENT",
"подробная информация": [
{
"@type": "type.googleapis.com/google.mybusiness.v4.ValidationError",
"errorDetails": [
{
"код": 2,
"поле": "language_code",
"message": "language_code требуется"
}
]
}
]
}
}
Если я дам код языка, например tr-TR, он даст мне:
{
"ошибка": {
"код": 400,
"сообщение": "получена недопустимая полезная нагрузка JSON. Неизвестное имя \"language_code\": невозможно привязать параметр запроса. Поле "language_code" не удалось найти в сообщении запроса.",
"статус": "INVALID_ARGUMENT",
"подробная информация": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"полевые насилия": [
{
"описание": "получена недопустимая полезная нагрузка JSON. Неизвестное имя \"language_code\": невозможно привязать параметр запроса. Поле "language_code" не удалось найти в сообщении запроса."
}
]
}
]
}
}
Тип контента, который я написал, - application/json.
Когда вы измените тип контента на application/gRPC
postmane gices me nothing but the status is 200.
Однако ничего не создается.
Richard MacCutchan
Вам нужно отправить свой вопрос на форум справки Google. Это люди, которые знают, какие данные им от вас нужны.