Quantcast
Channel: Topliners: Message List
Viewing all articles
Browse latest Browse all 3431

Trouble fetching all account fields using REST API

$
0
0

I want to fetch all the records with all the fields available in them through REST.

 

When I try fetching records using REST API 1.0, I get these fields (mentioned below)

 

$client = new EloquaRequest($eloqua_site, $eloqua_user, $eloqua_password, 'https://secure.eloqua.com/API/REST/1.0');
$accounts = $client->get('/data/accounts?search=*&count=1000&page=1&depth=complete');

here is what I get when I print $accounts as output:

[1] => stdClass Object  (  [type] => Account  [id] => 365  [createdAt] => 1372683444  [depth] => complete  [description] =>  [name] => Verkeer en Waterstaat  [updatedAt] => 1372683444  [address1] =>  [address2] =>  [address3] =>  [businessPhone] =>  [city] =>  [country] =>  [fieldValues] => Array  (  )  [postalCode] =>  [province] =>  )

 

But when I try REST API 2.0, I get all fields except those which I was able to get using REST 1.0. Details below:

 

$client = new EloquaRequest($eloqua_site, $eloqua_user, $eloqua_password, 'https://secure.eloqua.com/API/REST/2.0');
$accounts = $client->get('/data/accounts?search=*&count=1000&page=1&depth=complete');

here is what I get when I print $accounts :

[366] => stdClass Object                  (                     [type] => Account                      [id] => 367                      [createdAt] => 1416953192                      [createdBy] => 1416955009                      [depth] => complete                      [description] =>                      [name] => FutureFormats                      [updatedAt] => 1416955009                      [address1] => MIG 73                      [address2] => Rishiyanand Nagar                      [address3] => dww                      [businessPhone] => 12345                      [city] => Mandsaur                      [country] => NL                      [fieldValues] => Array                          (                             [0] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100102                                  )                             [1] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100094                                      [value] => MRFCC000000000367                                  )                             [2] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100097                                  )                             [3] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100100                                      [value] => abcdefg                                  )                             [4] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100118                                      [value] => Business Services                                  )                             [5] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100119                                  )                             [6] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100169                                      [value] => 9856000                                  )                             [7] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100170                                  )                             [8] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100181                                      [value] => 5000.0000                                  )                             [9] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100182                                      [value] => www.futureformats.nl                                  )                             [10] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100183                                      [value] => noidea                                  )                             [11] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100218                                  )                             [12] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100219                                      [value] => dontknow                                  )                             [13] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100220                                      [value] => ff                                  )                             [14] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100221                                  )                             [15] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100222                                      [value] => Prospect                                  )                             [16] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100223                                  )                             [17] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100224                                  )                             [18] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100225                                  )                             [19] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100226                                      [value] => nl                                  )                             [20] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100227                                  )                             [21] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100228                                      [value] => codepost                                  )                             [22] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100229                                  )                             [23] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100230                                  )                             [24] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100231                                  )                             [25] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100232                                  )                             [26] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100233                                  )                             [27] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100234                                  )                             [28] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100235                                  )                             [29] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100236                                  )                             [30] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100237                                  )                             [31] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100261                                  )                             [32] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100262                                      [value] => Onbekend                                  )                             [33] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100263                                  )                             [34] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100264                                  )                             [35] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100265                                      [value] => Onbekend                                  )                             [36] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100267                                  )                             [37] => stdClass Object                                  (                                     [type] => FieldValue                                      [id] => 100277                                  )                         )                     [postalCode] => 458001                  )         ) 

 

Please can someone tell me how to get all these fields combine using a single call (REST) which are currently getting fetched when doing two different calls to REST api 1.0 & 2.0


Viewing all articles
Browse latest Browse all 3431

Trending Articles