@@ -8,14 +8,16 @@ A php package for easy integration of the **Domainrobot API** powered by [InterN
882 . [ Install and Use] ( #install-and-use )
99 * [ Installation] ( #installation )
1010 * [ Basic Use] ( #basic-use )
11- 3 . [ Usage] ( #usage )
11+ 3 . [ Example Implementations] ( #example-implementations )
12+ 4 . [ Usage] ( #usage )
13+ * [ Logging Requests and Responses] ( #logging-requests-and-responses )
1214 * [ Asynchronous vs Synchronous Requests] ( #asynchronous-vs-synchronous-requests )
1315 * [ Models] ( #models )
1416 * [ Supported API calls] ( #supported-api-calls )
1517 * [ Exception handling] ( #exception-handling )
1618 * [ (Custom) Headers] ( #custom-headers )
17- 4 . [ Changelog] ( #changelog )
18- 5 . [ Copyright and license] ( #copyright-and-license )
19+ 5 . [ Changelog] ( #changelog )
20+ 6 . [ Copyright and license] ( #copyright-and-license )
1921
2022## Preamble
2123
@@ -37,6 +39,11 @@ composer require internetx/php-domainrobot-sdk
3739use Domainrobot\Domainrobot;
3840```
3941
42+ ## Example Implementations
43+
44+ You can find some example implemnation in the * example* Folder in the source code.
45+ We will add examples for all or at least most tasks in the next versions of this SDK.
46+
4047## Usage
4148
4249Before you can interact with the API you need to specify your authentication credentials, the baseurl and the context.
@@ -46,6 +53,7 @@ Before you can interact with the API you need to specify your authentication cre
4653
4754``` php
4855use Domainrobot\Domainrobot;
56+ use Domainrobot\Lib\DomainrobotAuth;
4957
5058$domainrobot = new Domainrobot([
5159 "url" => "https://api.autodns.com/v1",
@@ -57,6 +65,22 @@ $domainrobot = new Domainrobot([
5765]);
5866```
5967
68+ ### Logging Requests and Responses
69+
70+ There may be certain circumstances where you may want to log your requests and responses.
71+ For this cases we provide you with two integrated callback methods you can use for this purpose.
72+ Find an example on how to use them below.
73+
74+ ``` php
75+ $domainrobot->domain->logRequest(function($method, $url, $options) use ($user){
76+ // execute your code here
77+ print_r($method);
78+ })->logResponse(function($url, $response, $statusCode, $exectime) use ($user){
79+ // execute your code here
80+ print_r($user);
81+ })->info("example.com");
82+ ```
83+
6084### Asynchronous vs Synchronous Requests
6185
6286This library is mainly meant to be used with synchronous request but also provides the possibility to be used with asynchronous requests.
@@ -265,6 +289,13 @@ function answer($domain, $answer);
265289function list(Query $body = null);
266290```
267291
292+ #### User tasks
293+
294+ ``` php
295+ function info($user, $context);
296+ function list(Query $body = null);
297+ ```
298+
268299### Exception handling
269300
270301If there is any error response from the API, the services will throw a DomainrobotException, which contains information about the error.
0 commit comments