fbpx

Get cdr’s by profile_id

This function allows resellers and users to retrieve CDRs for given customer number. The function checks the reseller’s / user’s username and password and whether the customer number is really linked to that reseller / user account. On success, the function will return a JSON encoded array.

URL

/cdrs/getcalls/$PROFILE_ID/$START_DATE[/$END_DATE]?username=$USERNAME&password=$PASSWORD

  • PROFILE_ID: reseller’s client’s / user’s profile ID (customer number)
  • START_DATE: starting date which you want to retrieve data from (must be smaller than END_DATE)
  • END_DATE: date until when you want to retrieve data (optional, if not set, current date is selected)
  • USERNAME: reseller’s / user’s username
  • PASSWORD: reseller’s / user’s password

Failures

The function will fail if any of these checks are invalid:

  • reseller’s / user’s username and password must match
  • the user defined by PROFILE_ID must be linked to the reseller / user account
  • START_DATE must be smaller than END_DATE
  • interval between START_DATE and END_DATE cannot exceed 3 months

Return value

This function returns a multi-dimensional JSON encoded array

  array(
        [INDEX] => array(
              ['type'] => TYPE,
              ['data'] => DATA
        )
  )

INDEX = numerical index [0, 1, …]

TYPE = any of the following values:

  • CALLIN
  • CALLOUT
  • DEV
  • FAX
  • HARDWARE
  • PAY
  • SERVICE
  • SETUP
  • SMS
  • TRAVEL

DATA = array with these indexes:

  • source = who made the call if type=CALL, else the username
  • destination = which number was dialed if type=CALL, else the product name
  • destination_name = which country was dialed if type=CALL, else a product description
  • call_start = start of the call if type=CALL, else the date of billing
  • call_end = end of the call if type=CALL, else the date of billing
  • quantity = quantity billed
  • price = price in euro cents per quantity
  • invoice = invoice/report number