Developers

TIM4biz API support, tutorials & sample code

Build applications that access your PBX call accounting records, settings and other data. Read the response-code reference, copy a working sample in C# or Python, and ship faster.

REST / JSON Rate-limited GET & POST
01

Authorization

Access to the TIM4biz APIs requires a TIM4biz account, an active product licence and a username that has API access enabled.

Need access? Contact us to enable API access on your account and to raise your rate limit above zero.
02

Response codes

TIM4biz API response codes indicate the success or error of each call.

200 Success

The request completed successfully.

400 Bad request

Invalid parameter — for example, a missing datetime range, a period that is too long, or a GET sent where a POST was required.

401 Unauthorized

Authentication is missing or invalid.

403 Forbidden

The account is not licenced for this API.

404 Not found

The supplied value could not be located.

429 Too many requests

The rate limit has been exceeded, or your rate limit is currently zero.

03

Rate-limit response headers

The TIM4biz API has a rate limit based on the accumulated number of calls a company can make per 60 minutes. The default value can be increased on request — please contact us to enable API access and lift the rate limit above zero.

Header Description
TIM4biz-Rate-Limit-Limit Configured number of API calls per 60 minutes.
TIM4biz-Rate-Limit-Remaining Calls remaining before hitting the 60-minute rate limit.
TIM4biz-Rate-Limit-Limit-24-Hours Configured number of API calls per 24 hours.
TIM4biz-Rate-Limit-Remaining-24-Hours Calls remaining before hitting the 24-hour rate limit.
04

Other response headers

Header Description
TIM4biz-API-URL The APIs are moving from tim4biz.com to api.tim4biz.com.
TIM4biz-Authentication Recommendation to migrate from BEARER to BASIC authentication.
05

API example calls

The TIM4biz API definitions are documented on the API homepage. The samples below demonstrate simple calls; you can also use the Swagger Editor to generate a class library.

Simple C# code demonstrating a call to the ExtensionTotal method. The example needs a TIM4biz call accounting licence to succeed.

using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        using var http = new HttpClient();
        http.DefaultRequestHeaders.Authorization =
            new AuthenticationHeaderValue("Basic", "BASE64(username:password)");

        var url = "https://api.tim4biz.com/api/ExtensionTotal" +
                  "?from=2025-01-01T00:00:00&to=2025-01-02T00:00:00";

        var response = await http.GetAsync(url);
        Console.WriteLine((int)response.StatusCode);
        Console.WriteLine(await response.Content.ReadAsStringAsync());
    }
}

Simple Python code demonstrating a call to the ExtensionTotal method. You may need to install the requests package first.

$ python -m pip install requests
import requests
from requests.auth import HTTPBasicAuth

url = "https://api.tim4biz.com/api/ExtensionTotal"
params = {"from": "2025-01-01T00:00:00", "to": "2025-01-02T00:00:00"}

r = requests.get(url, params=params,
                 auth=HTTPBasicAuth("username", "password"))

print(r.status_code)
print(r.text)

Simple C# code demonstrating a call to the SetSMS method. The example needs a TIM4biz messaging licence to succeed.

using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        using var http = new HttpClient();
        http.DefaultRequestHeaders.Authorization =
            new AuthenticationHeaderValue("Basic", "BASE64(username:password)");

        var json = "{\"to\":\"+61400000000\",\"message\":\"Hello from TIM4biz\"}";
        var body = new StringContent(json, Encoding.UTF8, "application/json");

        var response = await http.PostAsync(
            "https://api.tim4biz.com/api/SetSMS", body);

        System.Console.WriteLine((int)response.StatusCode);
    }
}

Simple Python code demonstrating a call to the SetSMS method. You may need to install the requests package first.

$ python -m pip install requests
import requests
from requests.auth import HTTPBasicAuth

url = "https://api.tim4biz.com/api/SetSMS"
payload = {"to": "+61400000000", "message": "Hello from TIM4biz"}

r = requests.post(url, json=payload,
                  auth=HTTPBasicAuth("username", "password"))

print(r.status_code)
print(r.text)
06

API page not showing updates?

After an update to the main API page, you may need to force your browser to fetch the latest version. The usual Ctrl+F5 or Shift+⌘+R may not be enough. Follow these steps:

  1. 1
    Open the API homepage

    https://tim4biz.com/api/

  2. 2
    Click the JSON link at the top of the page

    https://tim4biz.com/api/swagger.json opens.

  3. 3
    Hard-refresh the swagger page

    Press Ctrl+F5 (or Shift+⌘+R) — the swagger.json page refreshes.

  4. 4
    Return to the main API page and hard-refresh

    Go back to https://tim4biz.com/api/ and press Ctrl+F5. The API page is finally refreshed.

07

API GET or POST

Each API heading indicates whether the call should be made via an HTTP GET or HTTP POST.

GET

Read without changing

Use GET to request information from TIM4biz without modifying any data.

POST

Insert, update or delete

Use POST to insert, update or delete remote data.

Heads up Using the incorrect request type will return a 400 Bad request response.

Need a hand?

Our team can enable API access, raise your rate limit and help you get the first sample running.