#salesforce
Вопрос:
Я получаю следующую ошибку.
Запрос:
curl --location --request PATCH 'https://staging.connectwisedev.com/v4_6_release/apis/3.0/company/companies/4'
--header 'clientId: efa027e7-6703-464e-8534-026db23fb035'
--header 'Authorization: Basic dGhlc2FpbG9yZ3JvdXBfZitlMEpONncyc2szZ28xdFpvOnFRaUF5bXdpY0FLbmp5ajc='
--header 'Content-Type: application/json'
--data-raw '{
"website": "replace",
"path": "website",
"value": {
"website": "www.abcd.com"
}
}'
Ответ:
{
"code": "ConnectWiseApi",
"message": "Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.IEnumerable`1[JsonPatch.Model.PatchOperation]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.rnTo fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.rnPath 'website', line 2, position 14."
}
Комментарии:
1. Какое это имеет отношение к Salesforce? И, вероятно, это плохая идея публиковать свой идентификатор клиента и ключи API? Вы пробовали делать то, что написано в ошибке, и отправлять массив, так что, возможно
[{ "website": "replace", "path": "website", "value": { "website": "www.abcd.com" } }]
(я ничего не знаю об этом соединении)