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.
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
-
2
-
3
Hard-refresh the swagger page
Press Ctrl+F5 (or Shift+⌘+R) — the swagger.json page refreshes.
-
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.