Por­tal-API

Das NFON Ap­pli­ca­ti­on Pro­gramming In­ter­face (API) für das NFON-Kon­fi­gu­ra­ti­ons­por­tal ist ein sehr nütz­li­ches “hid­den Fea­ture” und er­mög­licht die au­to­ma­ti­sier­te Ab­fra­ge und Kon­fi­gu­ra­ti­on ei­ner oder meh­re­rer NFON Cloud-Te­le­fon­an­la­gen. Denk­bar sind fol­gen­de An­wen­dungs­fäl­le:

NFON Ser­vice Por­tal Do­ku­men­ta­ti­on:

NFON Ser­vice Por­tal API Usa­ge Ma­nu­al:

NFON Ser­vice Por­tal API Spe­ci­fi­ca­ti­on:

Ak­tu­ell ar­bei­te ich an ei­nem Web-Ser­vice für den ein­fa­chen Zu­griff auf die NFON Por­tal-API:

In­halts­ver­zeich­nis

JSON

Das Da­ten­for­mat der NFON Por­tal-API ist die Ja­va­Script Ob­ject No­ta­ti­on (JSON).

JSON-Ele­men­te

Die NFON Por­tal-API ent­hält fol­gen­de JSON-Ele­men­te:

title
detail
described_by
href
offset
total
size
links
links [{rel, href},...]
data  [{name, value},...]
items [{href, links[], data[]}]

json2assoc

Bei­spiel aus der NFON Por­tal-API-Do­ku­men­ta­ti­on

JSON ist ein baum­ar­ti­ges Text­for­mat, das sich aus mei­ner Sicht schlecht wei­ter­ver­ar­bei­ten lässt. Da­her ha­be ich ein paar PHP-Skrip­te er­stellt, um JSON in ein as­so­zia­ti­ves Ar­ray zu wan­deln. Ein as­so­zia­ti­ves Ar­ray be­steht aus Schlüs­seln (en: keys) und den zu­ge­hö­ri­gen Wer­ten (en: va­lues).

Hier ein Bei­spiel 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 dar­aus er­zeug­te as­so­zia­ti­ve Ar­ray:

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] =>
)

Schreibe einen Kommentar