是否有API调用来获取Opportunity status / stagename enum的所有可能值?
答案 0 :(得分:4)
这是通过REST实现的代码,它也应该直接转换为SOAP。
$parameters = array(
'session' => $sessionId,
'module_name' => 'Opportunities',
);
$json = json_encode($parameters);
$postArgs = array(
'method' => 'get_module_fields',
'input_type' => 'JSON',
'response_type' => 'JSON',
'rest_data' => $json
);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
// Make the REST call, returning the result
$response = curl_exec($curl);
if (!$response) {
die("Connection Failure.\n");
}
// Convert the result from JSON format to a PHP array
$result = json_decode($response);
if ( !is_object($result) ) {
die("Error handling result.\n");
}
if ( !isset($result->module_name) ) {
die("Error: {$result->name} - {$result->description}\n.");
}
var_dump($result->module_fields->sales_stage->options);
exit;