Я пытаюсь сделать Curl POST для BullHorn REST API. Сначала я получаю объект, а затем снова пытаюсь опубликовать его с некоторыми отредактированными параметрами.
Это отлично работает на моей локальной машине, а на сервере — нет. На сервере я получаю ошибку невозможно преобразовать значение в тип данных для поля dateLastModified с типом IMPROPERLY_STRUCTURED_SCALAR.
На моей машине локали dateLastModified равно 1428589472953
, На постановке это 1.42858947295E+12
, Итак, я прочитал, что это может быть связано с точкой в миллисекундах, поэтому я попытался добавить это:
curl_setopt($curl, CURLOPT_TIMEOUT_MS, 250);
Но это дало тот же результат …
Дополнительно:
Мне также пришлось добавить следующий код, потому что я работаю из незащищенной среды (http) и получаю данные из защищенной среды (https) (только для тестирования).
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
В чем может быть проблема?
ОБНОВИТЬ:
Полный массив, который я получаю локально, выглядит так:
stdClass Object
(
[id] => 8465
[address] => stdClass Object
(
[address1] =>
[address2] =>
[city] =>
[state] => West-Vlaanderen
[zip] =>
[countryID] => 2202
)
[businessSectors] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[candidateSource] =>
[categories] => stdClass Object
(
[total] => 2
[data] => Array
(
)
)
[category] => stdClass Object
(
[id] => 1123135
)
[certificationList] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[certifications] =>
[clientCorporationBlackList] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[clientCorporationWhiteList] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[comments] => Comments
[companyName] =>
[companyURL] =>
[customDate1] =>
[customDate2] =>
[customDate3] =>
[customFloat1] =>
[customFloat2] =>
[customFloat3] =>
[customInt1] =>
[customInt2] =>
[customInt3] =>
[customText1] => 1-3
[customText10] =>
[customText11] =>
[customText12] =>
[customText13] =>
[customText14] =>
[customText15] =>
[customText16] =>
[customText17] =>
[customText18] =>
[customText19] =>
[customText2] =>
[customText20] =>
[customText3] =>
[customText4] =>
[customText5] =>
[customText6] =>
[customText7] =>
[customText8] =>
[customText9] =>
[customTextBlock1] => azezaeaz
[customTextBlock2] =>
[customTextBlock3] =>
[customTextBlock4] =>
[customTextBlock5] =>
[dateAdded] => 1428589472687
[dateAvailable] =>
[dateAvailableEnd] =>
[dateI9Expiration] =>
[dateLastComment] =>
[dateLastModified] => 1428589472953
[dateNextCall] =>
[dateOfBirth] =>
[dayRate] => 0
[dayRateLow] =>
[degreeList] =>
[description] => Resume text.
[desiredLocations] =>
[disability] =>
[educationDegree] =>
[educations] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[email] => [email protected]
[email2] =>
[email3] =>
[employeeType] => Candidate
[employmentPreference] => Array
(
[0] => Permanent
)
[ethnicity] =>
[experience] => 1
[externalID] =>
[fax] =>
[fax2] =>
[fax3] =>
[federalAddtionalWitholdingsAmount] =>
[federalExemptions] =>
[federalFilingStatus] =>
[fileAttachments] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[firstName] => niels14
[gender] =>
[hourlyRate] => 0
[hourlyRateLow] =>
[i9OnFile] =>
[interviews] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[isDayLightSavings] => 1
[isDeleted] =>
[isEditable] => 1
[isLockedOut] =>
[lastName] => vroman14
[linkedPerson] =>
[localAddtionalWitholdingsAmount] =>
[localExemptions] =>
[localFilingStatus] =>
[localTaxCode] =>
[massMailOptOut] =>
[masterUserID] =>
[middleName] =>
[migrateGUID] =>
[mobile] =>
[name] => niels14 vroman14
[namePrefix] =>
[nameSuffix] =>
[nickName] =>
[notes] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[numCategories] => 0
[numOwners] => 0
[occupation] =>
[owner] => stdClass Object
(
[id] => 2270
[firstName] => Webdeveloper
[lastName] => API
)
[pager] =>
[paperWorkOnFile] =>
[password] => abc
[personSubtype] => Candidate
[phone] =>
[phone2] =>
[phone3] =>
[placements] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[preferredContact] => Phone
[primarySkills] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[recentClientList] =>
[references] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[referredBy] =>
[referredByPerson] =>
[salary] => 0
[salaryLow] =>
[secondaryAddress] => stdClass Object
(
[address1] =>
[address2] =>
[city] =>
[state] =>
[zip] =>
[countryID] => 1
)
[secondaryOwners] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[secondarySkills] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[sendouts] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[skillSet] =>
[smsOptIn] =>
[source] =>
[specialties] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[ssn] =>
[stateAddtionalWitholdingsAmount] =>
[stateExemptions] =>
[stateFilingStatus] =>
[status] => Subscribed
[submissions] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[tasks] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[taxID] =>
[taxState] =>
[tearsheets] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[timeZoneOffsetEST] => 0
[travelLimit] => 0
[travelMethod] =>
[type] =>
[userType] => stdClass Object
(
[id] => 35
)
[username] => niels14
[veteran] =>
[webResponses] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[willRelocate] =>
[workAuthorized] => 1
[workHistories] => stdClass Object
(
[total] => 0
[data] => Array
(
)
)
[workPhone] =>
[_score] => 12.096912
)
Как вы можете видеть, есть ключ dateLastModified. Это локально, так как, как сказано на сервере, это шоу отличается (так выше).
Я не думаю, что твоя проблема связана с завитком.
Вы должны иметь массив в вашем коде, используя dateLastModified
в качестве значения индекса.
С этой переменной связана ошибка ввода данных, что приводит к получаемой вами ошибке.
Других решений пока нет …