Das NFON Application Programming Interface (API) für das NFON-Konfigurationsportal ist ein sehr nützliches “hidden Feature” und ermöglicht die automatisierte Abfrage und Konfiguration einer oder mehrerer NFON Cloud-Telefonanlagen. Denkbar sind folgende Anwendungsfälle:
- Bestandserfassung (Anzahl Nebenstellen, Endgeräte, Rufnummern)
- Automatisierte Konfiguration von
- Nebenstellen
- Rufnummernzuordnung
- Endgerätezuordnung
- Zentrales Telefonbuch
- Anmeldung an Queues oder Skills
- Rufumleitung
- u.v.m.
NFON Service Portal Dokumentation:
NFON Service Portal API Usage Manual:
NFON Service Portal API Specification:
Aktuell arbeite ich an einem Web-Service für den einfachen Zugriff auf die NFON Portal-API:
Inhaltsverzeichnis
JSON
Das Datenformat der NFON Portal-API ist die JavaScript Object Notation (JSON).
JSON-Elemente
Die NFON Portal-API enthält folgende JSON-Elemente:
title
detail
described_by
href
offset
total
size
links
links [{rel, href},...]
data [{name, value},...]
items [{href, links[], data[]}]
json2assoc
JSON ist ein baumartiges Textformat, das sich aus meiner Sicht schlecht weiterverarbeiten lässt. Daher habe ich ein paar PHP-Skripte erstellt, um JSON in ein assoziatives Array zu wandeln. Ein assoziatives Array besteht aus Schlüsseln (en: keys) und den zugehörigen Werten (en: values).
Hier ein Beispiel für JSON:
{"href":"/api/customers/KCNU3/targets/phone-extensions/25/callforward-profiles",
"items":[
{"href":"/api/customers/KCNU3/targets/phone-extensions/25/callforward-profiles/0",
"links":[],
"data":[
{"name":"profileNumber","value":0},
{"name":"profileName","value":"default"},
{"name":"active","value":true},
{"name":"immutable","value":true}
]}],
"links":null}
Und hier das daraus erzeugte assoziative Array:
array (
[href] => /api/customers/KCNU3/targets/phone-extensions/25/callforward-profiles
[items.0.href] => /api/customers/KCNU3/targets/phone-extensions/25/callforward-profiles/0
[items.0.data.profileNumber] => 0
[items.0.data.profileName] => default
[items.0.data.active] => 1
[items.0.data.immutable] => 1
[links] =>
)