Zoho crm API有时会返回错误

时间:2016-06-09 10:44:01

标签: api crm zoho

我尝试使用Zoho CRM API搜索记录,但有时会出现以下错误:

  

数组([response] =>数组([错误] =>数组([消息] =>无法使用   处理您的请求。请确认您是否输入正确   方法名称,参数和参数值。 [code] => 4600)[uri] =>   / crm / private / json / Contacts / searchRecords))

我的问题是,有时一切正常,有时我会收到此错误

define("TARGETURL", "https://crm.zoho.com/crm/private/json/Contacts/searchRecords");
$parameter = array(
            'scope' => 'crmapi',
            'authtoken' => AUTHTOKEN,
            'selectColumns' => 'All',
            'criteria' => '(Account Name:'.$accountName.')',
            'fromIndex' => $fromIndex,
            'toIndex' => $toIndex
            );
$ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, TARGETURL);
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_TIMEOUT, 30);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $parameter);
            $result = curl_exec($ch);
            curl_close($ch);

1 个答案:

答案 0 :(得分:0)

尝试使用双引号搜索字段,以下是搜索来自潜在客户模块的电子邮件的脚本。

public class MainActivity extends ListActivity implements Callback<HslSubjects> {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
        requestWindowFeature(Window.FEATURE_PROGRESS);
        ArrayAdapter<Subject> arrayAdapter = new ArrayAdapter<Subject>(this, android.R.layout.simple_list_item_1, android.R.id.text1, new ArrayList<Subject>());
        setListAdapter(arrayAdapter);
        setProgressBarIndeterminateVisibility(true);
        setProgressBarVisibility(true);

        Log.i("api", "preparing to make the api call");
        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl("http://10.0.3.2:2403") //10.0.3.2
                .addConverterFactory(GsonConverterFactory.create())
                .build();

        // preparing the call in retrofit
        subjectEndpointApi subjectEndpointApi = retrofit.create(subjectEndpointApi.class);
        Call<HslSubjects> call = subjectEndpointApi.loadSubjects();

        call.enqueue(this);
    }

    @Override
    public void onResponse(Call<HslSubjects> call, Response<HslSubjects> response) {
        setProgressBarIndeterminateVisibility(false);
        HslSubjects hslSubjects = response.body();

        Log.i("subjects", "end of response");


    }

    @Override
    public void onFailure(Call<HslSubjects> call, Throwable t) {
        Toast.makeText(MainActivity.this, t.getLocalizedMessage(), Toast.LENGTH_SHORT).show();

        Log.i("subjects", "Oops error");
    }
}