我正在尝试向BullHorn REST API发送一个Curl POST。首先,我得到一个实体,然后我尝试再次发布一些已编辑的参数。
这在我的本地计算机上完美运行,但在服务器上却没有。在服务器上,我收到错误无法将值转换为字段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] => niels14@vroman14.com
[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 。这是本地的,所以在服务器上说这个显示不同(如上所述)。
答案 0 :(得分:0)
我不认为你的问题与卷曲有关。
您的代码中必须使用dateLastModified
作为索引值。
此变量存在数据输入问题,导致您收到错误。