Metoda zwraca wszystkie pola niestandardowe danego subskrybenta
Wywołanie
1 2 3 4 5 6 7 8 |
POST https://getall.pl/api/ Array ( [key] => {klucz api} [method] => ResponderGetSubscriberFields [id] => {ID subskrybenta} // Zobacz metodę ResponderGetEmail ) |
Zwracane dane w formacie JSON
1 2 3 4 5 6 7 8 9 10 11 12 |
Array ( [0] => Array ( [name] => {Nazwa pola} [value] => {Wartość} ) ... [status] => {Status odpowiedzi: 'ok' lub 'bad'} [error] => {Przyczyna błędu, jeśli wystąpił} ) |
Przykład wywołania metody
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
<?php /** * Getall.pl Test API method * * @author Getall.pl * @copyright Getall.pl * @version 1.0 * @since 2015-09-15 */ include('getall.api.class.php'); // Klucz API $api_key = 'WSTAW SWÓJ KLUCZ API'; $getall = new GetAll($api_key); $request = array( "id" => 'ID SUBSKRYBENTA' ); $subscriber_fields = $getall -> ResponderGetSubscriberFields($request); if($subscriber_fields -> status == 'ok') { for($i=0;$i<count($subscriber_fields -> data);$i++) { echo $subscriber_fields -> data[$i] -> name.':'; echo $subscriber_fields -> data[$i] -> value.'<BR>'; } } else echo $subscriber_fields -> error; ?> |
Pobierz klasę PHP do API Opisy błędów Uzyskaj klucz do API