All posts by webdev

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.

SMS

How to send the actual message?

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

POST data:

{
   "act": "sendSms",
   "phonenumbers": "0123456789",
   "message": "my sms text"
}

Request Headers:

Connection: keep-alive
x-date: 2014-02-20 19:38:49.000000 GMT+0000
x-authorization: demo:SOGyuh3sE7beTnvei3RJibGudCI=
Content-Type: application/x-www-form-urlencoded
Content-Length: 82
Host: login.42call.com

Response Body:

{
    "error": false,
    "codes": [
        {
            "code": 200,
            "description": "OK"
        }
    ],
    "body": {
        "smsbilledId": "6D800504-D9DC-446B-B03B-468E17582A89",
        "customernumber": "1234",
        "accountnumber": "1234",
        "username": "demo",
        "customercurrency": "eur",
        "customeraccountstate": "16,94"
    }
}

The modul also works for BULK SMS or named mass sms. Just transmit the receiver separated with | like 0123|2314|4567 as show here at Mashape.

Or have a look at the complete jQuery mobile and Phonegap (for Android) Example on github.

Online callthrough

This module displays the clients dial-in number of the service calling card (callback). The following function call provides the dial-in number according to the user profile in the e164 format.

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

Request Headers:

Connection: keep-alive
x-date: 2014-02-20 18:03:32.000000 GMT+0000
x-authorization: demo:AyYOFMBwgVb/xe/Dutz4YkuXNaM=
Host: login.42call.com

Response body:

{
    "error": false,
    "codes": [
        {
            "code": 200,
            "description": "OK"
        }
    ],
    "body": {
        "dialinnumberGeo": {
            "be": "3228084223",
            "br": "557137175960",
            "de": "493034649495",
            "gb": "442035140171",
            "us": "13025979000"
        },
        "dialinnumberFree": {
            "de": "498005888868",
            "gb": "448000148915"
        },
        "callbacknumberGeo": {
            "de": "493020167207",
            "be": "493020167207",
            "br": "493020167207",
            "gb": "493020167207",
            "us": "493020167207"
        },
        "callbacknumberFree": [],
        "dialinnumber": "493034649495",
        "anumber": null,
        "bnumber": null,
        "customernumber": "1234",
        "accountnumber": "1234",
        "username": "demo",
        "customercurrency": "eur",
        "customeraccountstate": "18,40"
    }
}

You’ll receive any type of dial-in numbers for your account. There are two for callthrough and two for callback services. All separated in the different country codes. The free number is a 0800er dial-in number for both services. If the tags are empty like in the callbacknumberFree example, there are no configured numbers for that account available. The dialinnumber field is a specific dial-in number for personal usage. For more information ask our sales team. That feature is a specific branding option configured by the sales office of 42com, if you’re interested in such options please contact sales[at]42com.com.

The requested number could be displayed for instances of mobile devices or any other platform you’re developing for. Because of most the mobile OSs recognizes phone numbers, it is possible to tap on the number and make a call.

Transmitting the target number

The service calling card needs a target number for connecting the two subscriber with each other. This number could be transferred with the module ‚onlinecallthrough‘ as well.

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

POST data:

{
	"act": "store",
	"anumber":"0123456789",
	"bnumber":"0123456789"
}

Request Headers:

Connection: keep-alive
x-date: 2014-02-20 18:07:57.000000 GMT+0000
x-authorization: demo:fhoNcgDVK6pux0Xp9+DYbLz64Mg=
Content-Type: application/x-www-form-urlencoded
Content-Length: 75
Host: login.42call.com

Response Body:

{
    "error": false,
    "codes": [
        {
            "code": 200,
            "description": "OK"
        }
    ],
    "body": {
        "dialinnumberGeo": {
            "be": "3228084223",
            "br": "557137175960",
            "de": "493034649495",
            "gb": "442035140171",
            "us": "13025979000"
        },
        "dialinnumberFree": {
            "de": "498005888868",
            "gb": "448000148915"
        },
        "callbacknumberGeo": {
            "de": "493020167207",
            "be": "493020167207",
            "br": "493020167207",
            "gb": "493020167207",
            "us": "493020167207"
        },
        "callbacknumberFree": [],
        "dialinnumber": "493034649495",
        "anumber": null,
        "bnumber": null,
        "customernumber": "1234",
        "accountnumber": "1234",
        "username": "demo",
        "customercurrency": "eur",
        "customeraccountstate": "18,40"
    }
}

When calling the dial-in number, the platform 42one automatically connects subscriber A with the target number (subscriber B).