question

yanmei avatar image
yanmei asked ·

Call-log no record returned in SandBox

Http request is based on dateFrom and dateTo. but no record, I checked , there are call logs in sandbox from 10/11/2016 to 10/13/2016
https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/call-log?dateFrom=2014-03-10&dateTo=2016-10-17

I can get call log record for type, phonenumber, only datefrom and dateto didn't work, returnStatus = 200 which is correct, but no record returned.
topic-default
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

benjamin-dean avatar image
benjamin-dean answered ·
Are you obtaining a RingCentral API access_token which is scoped as the same user's records you are viewing in the Online Account Portal ( https://service[.devtest].ringcentral.com)?
1 comment Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

I do get access_token, and same httpRest works in API Expolorer. it worked for other parameters such as phone, view, type. 

when I put dateFrom and dateTo, it returned response code = 200, and record count is -1. and nothing returned.

0 Likes 0 · ·
Tyler Liu avatar image
Tyler Liu answered ·
Could you please try a different date format, such as 2016-03-10T18:07:52.534Z ?

Here is a screenshot from the documentation:



Here is the link to the doc:  https://developer.ringcentral.com/api-docs/latest/index.html#!#RefExtensionCallLog.html

Let me know wether it works for you.
7 comments Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

I did both ways(dateFrom=2016-10-03T00:00:00.000Z  and 2016-10-03, still didn't work.
0 Likes 0 · ·
dateto = 2016-10-19T00:00:00.000Z and datefrom = 2016-10-03T00:00:00.000Z ,
dateto = 2016-10-19 and datefrom = 2016-10-03 work in your API Explore test.

but in my webHttpRequest, still didn't work, no record return, but statusCode returned is 200,  Response.ContentLength = -1, Response.statusCode = 200,OK.
0 Likes 0 · ·
Are you URI encoding the dateTo and dateFrom values?

Example:

/restapi/v1.0/account/~/extension/~/call-log?dateFrom=2016-01-01T00%3A00%3A00.800Z&dateTo=2016-05-01T00%3A00%3A00.800Z
0 Likes 0 · ·
no, just simple request like this:
Dim URL As New Uri(" https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/call-log?&dateFrom=2...)        'Dim URL As New Uri(" https://platform.devtest.ringcentral.com/restapi/v1.0/account/134091004/extension/134091004/call-log... = Voice&phoneNumber = 16503514555")

        Dim response As HttpWebResponse = Nothing
        Dim API_request As HttpWebRequest = DirectCast(WebRequest.Create(URL), HttpWebRequest)
        Dim str_return As String
        Dim acc_token As String = TB_Response.Lines(0)

        API_request.Method = "GET"
        API_request.Headers("Authorization") = "Bearer " & acc_token
        API_request.Accept = "application/json"

        Try
            response = DirectCast(API_request.GetResponse(), HttpWebResponse)
0 Likes 0 · ·
Could you try URIEncoding the query param values for 'dateTo' and 'dateFrom' prior to executing the HTTP Request to /call-log (if the libs you're implementing to format and execute the HTTP request do not already do this for you)? Please report the result.
1 Like 1 · ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.