Download the PHP package art-pub/nfon-api-client-php without Composer
On this page you can find all versions of the php package art-pub/nfon-api-client-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download art-pub/nfon-api-client-php
More information about art-pub/nfon-api-client-php
Files in art-pub/nfon-api-client-php
Package nfon-api-client-php
Short Description NFON administration portal REST API PHP client
License MIT
Informations about the package nfon-api-client-php
NFON administration portal REST API PHP-client
This is a small PHP package to send requests against the NFON administration portal REST API.
Requirements
You need to have
- the main URL to the API (i.e.
https://api09.nfon.com) - your API public and (i.e.
NFON-ABCDEF-123456) - your API secret and (i.e.
gAp3bTxxUev5JkxOcBdeC5Absm7J84jp6mEhJZd3XiLdjzoGSF) - your account name (i.e.
K1234)
[!NOTE] If you do not have this information, please contact your NFON partner for assistance.
[!WARNING] Never share your
API secret!
Usage
Install the package
The easiest way for installation is to use composer to use this package:
Create a request
The result is JSON-like, but difficult to read or process. The $response will therefore have a key dataMap having the result in a more useful structure, holding the original data still in $response['data'] (for single results) or $response['items'] (for multiple results).
Original data:
DataMap:
Good to know
Datasets and Pagination
Endpoints that return more than one record will return a maximum of 100 records on the first request. The result contains the following information:
Href: Path of the current request
Total: Amount of all datasets (not pages!)
Offset: Offset starting with 0
Size: Amount of maximum results in the response. You can set the amount in the request with the parameter pageSize=XXX with XXX being max. 100.
Links: Array of links including the first, the next and the last URL to retrieve all data. See LinksMap["first"], LinksMap["last"] and LinksMap["next"] in the example above.
[!IMPORTANT] Please note: You have to iterate through all those links to retrieve all data. Just repeat with the
nextgivenHrefuntil your currentHref(path of the current request) matches thelastentry.[!IMPORTANT] If the
lastentry is empty, you already have all data in the current response.