I'm trying to get a call log with twilio.
In the process, I would like to specify the time range, but I do not know how to obtain it with an inequality sign, so I would like to ask a professor if there are any references.

  • version of twilio: 6.x or later

  • What I tried in acquisition

■ By doing this, the log with startTime after 2020-11-18 03:00:00 can be acquired.
$this->twilio_client_obj->calls->read (["startTime" =>"2020-11-18 03:00:00"], 50);
■ If i do this, you can only get logs with startTime or endTime after 2020-11-18 03:42:00.
$call_log_obj = $this->twilio_client_obj->calls->read (["startTime" =>"2020-11-18 03:00:00", "endTime" =>"2020-11-18 03:42:00" "], 50);
  • I want to know from the above sample
・ How to get the log before startTime is 2020-11-18 03:00:00
・ How should I specify the range where startTime is after 2020-11-18 03:00:00 and endTime is before 2020-11-18 04:00:00?
  • Confirmed site
  • https://jp.twilio.com/docs/voice/tutorials/how-to-retrieve-call-logs-php

I haven't found very powerful information, so it doesn't matter if you look at it, so please let me know.

  • Answer # 1

    I think that it can be realized with the following document.

    https://jp.twilio.com/docs/voice/api/call-resource?code-sample=code-read-multiple-call-resources-and-filter-by-after-start-date&code-language=PHP&code- sdk-version = 6.x

    https://jp.twilio.com/docs/voice/api/call-resource?code-sample=code-read-multiple-call-resources-and-filter-by-a-period-of-time&code-language= PHP&code-sdk-version = 6.x

    You can get various information from the left menu here.


  • Answer # 2

    For your reference, we have released a sample of Node.js.
    Use startTimeBefore and startTimeAfter to specify the range.