Category Archives: Modules

Creating PINs

Before you’re able to use this process please contact sales@42com.com to generate a complete pin creation account for usage of the api!
You’ll get a username/password combination to use this process.

For all processes you need the cli paramter which is always named „Telefon“ during the processes.

Creating cards

Parameter: m „mycard-v2“
Parameter: act „insert“
Parameter: Telefon [country code e.g. +49 for Germany & mobile number e.g. 49179900000]
Parameter: Kunde name of the customer [could be the same like Telefon]
Parameter: Amount amount in EUR
Parameter: sendSmsInfo should the customer receive a sms?
Parameter: smsinfo_message text 4 the sms [if empty we’ll send a default template]

Request:

  'm' => string 'mycard-v2' (length=9)
  'v' => string 'json' (length=4)
  'act' => string 'insert' (length=11)
  'Kunde' => string '' (length=0)
  'Telefon' => string '4917990000000' (length=12)
  'Amount' => string '0.10' (length=1)
  'sendSmsInfo' => string '1' (length=1)

Response Body:

{
    "error": false,
    "codes": [
        {
            "code": 200,
            "description": "OK"
        }
    ],
    "body": {
        "Kunde": "4917990000000",
        "CLI": "4917990000000",
        "Amount": "0,10 EUR",
        "AmountAll": "0,10 EUR",
        "fldSerial": "12871384",
        "fldPIN": "321582778",
        "active": 1
	}
    }
}

Getting status of a cards

Parameter: m „mycard-v2“
Parameter: act „show“
Parameter: Telefon

Request:

  'm' => string 'mycard-v2' (length=9)
  'v' => string 'json' (length=4)
  'act' => string 'show' (length=11)
  'Telefon' => string '4917990000000' (length=12)

Response Body:

{
    "error": false,
    "codes": [
        {
            "code": 200,
            "description": "OK"
        }
    ],
    "body": {
        "Kunde": "4917990000000",
        "CLI": "4917990000000",
        "Amount": "0,10 EUR",
        "AmountAll": "0,10 EUR",
        "fldSerial": "12871384",
        "fldPIN": "321582778",
        "active": 1
	}
    }
}

If „active“ is empty, the card is blocked!

Blocking cards

Parameter: m „mycard-v2“
Parameter: act „blockcard“
Parameter: Telefon

Request:

  'm' => string 'mycard-v2' (length=9)
  'v' => string 'json' (length=4)
  'act' => string 'blockcard' (length=11)
  'Telefon' => string '4917990000000' (length=12)

Response Body:

{
    "error": false,
    "codes": [
        {
            "code": 200,
            "description": "OK"
        }
    ],
    "body": {
        "Kunde": "4917990000000",
        "CLI": "4917990000000",
        "Amount": "0,10 EUR",
        "AmountAll": "0,10 EUR",
        "fldSerial": "12871384",
        "fldPIN": "321582778",
        "active": ''
	}
    }
}

Un-Blocking cards

Parameter: m „mycard-v2“
Parameter: act „unblockcard“
Parameter: Telefon

Request:

  'm' => string 'mycard-v2' (length=9)
  'v' => string 'json' (length=4)
  'act' => string 'unblockcard' (length=11)
  'Telefon' => string '4917990000000' (length=12)

Response Body:

{
    "error": false,
    "codes": [
        {
            "code": 200,
            "description": "OK"
        }
    ],
    "body": {
        "Kunde": "4917990000000",
        "CLI": "4917990000000",
        "Amount": "0,10 EUR",
        "AmountAll": "0,10 EUR",
        "fldSerial": "12871384",
        "fldPIN": "321582778",
        "active": 1
	}
    }
}

Disable Cards

Parameter: m „mycard-v2“
Parameter: act „disableCliByNumber“
Parameter: realm
Parameter: cli Telefon

Request:

  'm' => string 'mycard-v2' (length=9)
  'v' => string 'json' (length=4)
  'act' => string 'disableCliByNumber' (length=11)
  'realm' => string 'testRealm' (length=50)
  'cli' => string '4917990000000' (length=12)

Response Body:

{
    "error": false,
    "codes": [
        {
            "code": 200,
            "description": "OK"
        }
    ],
    "body": {
        "Kunde": "4917990000000",
        "CLI": "4917990000000",
        "Amount": "0,10 EUR",
        "AmountAll": "0,10 EUR",
        "fldSerial": "12871384",
        "fldPIN": "321582778",
        "active": ' '
	}
    }
}

Change CLI

Parameter: m „mycard-v2“
Parameter: act „changeCliByNumber“
Parameter: realm
Parameter: cli Current telefon
Parameter: newCli New telefon

Request:

  'm' => string 'mycard-v2' (length=9)
  'v' => string 'json' (length=4)
  'act' => string 'changeCliByNumber' (length=11)
  'realm' => string 'testRealm' (length=50)
  'cli' => string '4917990000000' (length=12)
  'newCli' => string '4917990000001' (length=12)

Response Body:

{
    "error": false,
    "codes": [
        {
            "code": 200,
            "description": "OK"
        }
    ],
    "body": {
        "Kunde": "4917990000000",
        "CLI": "4917990000001",
        "Amount": "0,10 EUR",
        "AmountAll": "0,10 EUR",
        "fldSerial": "12871384",
        "fldPIN": "321582778",
        "active": 1
	}
    }
}

Activate Cards

Parameter: m „mycard-v2“
Parameter: act „activateMyCard“
Parameter: realm
Parameter: cli Telefon
Parameter: PIN „321582778“

Request:

  'm' => string 'mycard-v2' (length=9)
  'v' => string 'json' (length=4)
  'act' => string 'activateMyCard' (length=11)
  'realm' => string 'testRealm' (length=50)
  'cli' => string '4917990000000' (length=12)
  'PIN' => string '321582778' (length=12)

Response Body:

{
    "error": false,
    "codes": [
        {
            "code": 200,
            "description": "OK"
        }
    ],
    "body": {
        "Kunde": "4917990000000",
        "CLI": "4917990000000",
        "Amount": "0,10 EUR",
        "AmountAll": "0,10 EUR",
        "fldSerial": "12871384",
        "fldPIN": "321582778",
        "active": 1
	}
    }
}

Number Check

To verify a complete number use this api process.

Parameter: prefix [country code e.g. +49 for Germany]
Parameter: number

GET https://login.42call.com/api/rest/v3/number-check?prefix=49&number=123456798

Request Headers:

Connection: keep-alive
x-date: 2014-02-20 18:23:38.000000 GMT+0000
x-authorization: demo:2ZigDbwB0bX32zmjGgKB+vB/Q74=
Host: login.42call.com

Response Body:

{
    "error": false,
    "codes": [
        {
            "code": 200,
            "description": "OK"
        }
    ],
    "body": {
		"completenumber": "49179123456789",
		"prefix": "49179",
		"number": "123456789",
		"name": "Germany Mobile O2"
	}
    }
}

Try the example on /42com/number-check/

Account

Details of the current user could be fetched with the resource account.

GET http://login.42call.com/api/rest/v2/?account

Request Headers:

Connection: keep-alive
x-date: 2014-02-20 18:23:38.000000 GMT+0000
x-authorization: demo:2ZigDbwB0bX32zmjGgKB+vB/Q74=
Host: login.42call.com

Response Body:

{
    "error": false,
    "codes": [
        {
            "code": 200,
            "description": "OK"
        }
    ],
    "body": {
        "accounts": [
            {
                "customername": "Demo Kunde",
                "customernumber": "00216559",
                "accountnumber": "7346165",
                "amount": "15,4426",
                "accountname": "Account, Demo"
            }
        ]
    }
}

Call detail records (for callshops)

How to get the latest call detail records of an callshop account. The module is named cdr-callshop and it will work like that.

Parameter: from (date)
Parameter: to (date)

GET http://login.42call.com/api/rest/v2/?cdr-callshop&from=2014-02-01&to=2014-02-20&show=2

Request Headers:

Connection: keep-alive
x-date: 2014-02-20 18:23:38.000000 GMT+0000
x-authorization: demo:2ZigDbwB0bX32zmjGgKB+vB/Q74=
Host: login.42call.com

Response Body:

{
    "error": false,
    "codes": [
        {
            "code": 200,
            "description": "OK"
        }
    ],
    "body": {
        "cdrs": [
            {
                "data": "2014-02-20 21:51:56.000",
                "caller": "00493019991390875",
                "callee": "0049179123456",
                "duration": "4",
                "billingduration": "4",
                "comment": "Germany Mobile O2",
                "amount": "0,0012",
                "amounttax": "0,0012"
            },
            {
                "data": "2014-02-20 21:51:56.000",
                "caller": "00493019991390875",
                "callee": "0049179123456",
                "duration": "4",
                "billingduration": "4",
                "comment": "Germany Mobile O2",
                "amount": "0,0053",
                "amounttax": "0,0053"
            },
            {
                "data": "2014-02-20 21:51:56.000",
                "caller": "00493019991390875",
                "callee": "0049179123456",
                "duration": "4",
                "billingduration": "4",
                "comment": "Germany Mobile O2",
                "amount": "0,0012",
                "amounttax": "0,0012"
            }
        ]
    }
}

If there is no record available right now, the body tree is an empty array.
Example page.

Topup

top up single account

Using personal identification numbers (PIN) to charge or load up an account can be used for cashcards and/or callingcards. In both cases we’re checking every single PIN on validity and affiliation. You just need to request the given PIN and the api will response with the success state.

Request POST http://login.42call.com/api/rest/v2/?topup

POST data:

{
 "pin": "123456"
}

Request Headers:

Connection: keep-alive
x-date: 2014-02-20 17:34:00.000000 GMT+0000
x-authorization: demo:wjZGsoP5yejpksp/ofqlwEOjom8=
Content-Type: application/x-www-form-urlencoded
Content-Length: 25
Host: login.42call.com

Response body:

{
    "error": true,
    "codes": [
        {
            "code": 1200,
            "description": "Personal Identification Number Not Valid"
        }
    ],
    "body": []
}

error codes

http://login.42call.com/api/rest/v2/

Voip account

To get the list of existing voip lines to an active account you might call the voiplist module.
The response will consist of all valid accounts connected to the active user session.
For security reasons the password will be base64 coded in the response.

Request GET http://login.42call.com/api/rest/v2/?voiplist

Request Headers:

m: "voiplist">Connection: keep-alive
x-date: 2014-02-20 17:43:52.000000 GMT+0000
x-authorization: demo:q4ybUBzn+kTHgACWPgiqGAy+Sk0=
Host: login.42call.com

Response body:

{
    "error": false,
    "codes": [
        {
            "code": 200,
            "description": "OK"
        }
    ],
    "body": {
        "voiplist": {
            "sip_1": {
                "type": "SIP",
                "username": "demo",
                "password": "demo",
                "ip": "111.222.333.444:50123",
                "domain": "",
                "stun_server": "",
                "proxy": "",
                "prefix": "",
                "transport_tls": "false",
                "transport_tcp": "true",
                "transport_udp": "false",
                "transport_use_standard_ports": "true",
                "forbid_self_call": "true",
                "echo_cancellation": "false",
                "escape_plus": "false",
                "enable_outbound_proxy": "false",
                "wifi_only": "false",
                "unknown_incoming_call_name": "Unbekannt",
                "codec_speex16": "true",
                "codec_speex8": "true",
                "codec_ilbc": "true"
            }
        },
        "customernumber": "1234",
        "accountnumber": "1234",
        "username": "demo",
        "customercurrency": "eur",
        "customeraccountstate": "18,40"
    }
}

Rates

single number

To get the customers rate for a destination we’re providing the rates module. It’s really easy to use. You just need to bring the dialled destination and the back end engine will split it into the prefix and the destination name. The request will respond with the name, the price, the prefix and the user currency for the given number.

GET http://login.42call.com/api/rest/v2/?rates&numbers=0177123456|030123456

Request Headers:

Connection: keep-alive
x-date: 2014-02-20 17:51:47.000000 GMT+0000
x-authorization: demo:VpxszNu25G+Kca3oHni3mkfRQm8=
Host: login.42call.com

Response Body:

{
    "error": false,
    "codes": [
        {
            "code": 200,
            "description": "OK"
        }
    ],
    "body": {
        "currency": "EUR",
        "rates": [
            [
                {
                    "number": "0177123456",
                    "destinationname": "Germany Mobile EPlus",
                    "price": "0,10",
                    "prefix": "0049177"
                },
                {
                    "number": "030123456",
                    "destinationname": "Germany",
                    "price": "0,04",
                    "prefix": "0049"
                }
            ]
        ]
    }
}

Test the endpint with Mashape.

Call detail records

How to get the latest call detail records of an account. The module is named cdrs and it will work like that.

Parameter: from (date)
Parameter: to (date)
Parameter: show (how many results)

GET http://login.42call.com/api/rest/v2/?cdrs&from=14.02.2014&to=19.02.2014&show=2

Request Headers:

Connection: keep-alive
x-date: 2014-02-20 18:23:38.000000 GMT+0000
x-authorization: demo:2ZigDbwB0bX32zmjGgKB+vB/Q74=
Host: login.42call.com

Response Body:

{
    "error": false,
    "codes": [
        {
            "code": 200,
            "description": "OK"
        }
    ],
    "body": {
        "table": {
            "caption": "Call detail records",
            "thead": {
                "datestart": "datestart",
                "dateend": "dateend",
                "time": "time",
                "customername": "customername",
                "number": "number",
                "destination": "destination",
                "amount": "amount",
                "amounttax": "amounttax",
                "type": "type"
            },
            "tbody": {
                "tr": {
                    "td": [
                        {
                            "datestart": "2014-02-14 15:40:00",
                            "dateend": "2014-02-14 15:40:10",
                            "time": "00:00:10",
                            "customername": "Doe, Jon",
                            "number": "ONNET214806",
                            "destination": "Free CALL",
                            "amount": "0.00",
                            "amounttax": "0.00",
                            "type": "VOIP"
                        },
                        {
                            "datestart": "2014-02-19 16:50:48",
                            "dateend": "2014-02-19 16:50:49",
                            "time": "00:10:01",
                            "customername": "Doe, Jon",
                            "number": "0049123465798",
                            "destination": "Germany Mobile O2",
                            "amount": "0.01",
                            "amounttax": "0.02",
                            "type": "CALLTHROUGH"
                        }
                    ]
                }
            },
            "tfoot": ""
        },
        "customernumber": "1234",
        "accountnumber": "1234",
        "username": "demo",
        "customercurrency": "eur",
        "customeraccountstate": "18,40"
    }
}

You’ll receive the latest two calls formatted as a table record set.
If there is no record available right now, the whole body tree is missing in the result.

Web callback

The module ‚webcallback‘ connects two callees via web callback. Therefore the phone numbers of subscriber A and B have to be transferred to the module. The function call is really simple, the parameters are shown below.

POST /api/rest/v2/?webcallback

POST data:

{
"act": "trycallback",	
"aNumber": "0302434299",
"bNumber": "0302434299"
}

Request Headers:

Connection: keep-alive
x-date: 2014-02-20 18:56:08.000000 GMT+0000
x-authorization: demo:wZdTynO6NdgwCnkMMOp73Lac4n4=
Content-Type: application/x-www-form-urlencoded
Content-Length: 86
Host: login.42call.com

Response Body:

{
    "error": false,
    "codes": [
        {
            "code": 200,
            "description": "OK"
        }
    ],
    "body": {
        "callId": "4AF46744-C346-44FF-80E3-33D89FBE963B",
        "firstownnumber": null,
        "destinationnumber": null,
        "customernumber": "1234",
        "accountnumber": "1234",
        "username": "demo",
        "customercurrency": "eur",
        "customeraccountstate": "18,40"
    }
}

The parameter ‚act‘ describes the current command. In this example the callback is initiated.
An active call could be cutted at any time by passing over stopcallback. For identifying a specific call you need to transmit the callerId in your request.