1

Request Url: https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=CRMAccounts

While fetching all CRMAccounts, I would also like to fetch some fields stored in AccountManager. I have tried to use the 'expand' query parameter for this purpose, but it seems this parameter only works for collections.

Is there any way to retrieve some fields from AccountManager, without doing another call with the GUID? Something like AccountManager.BirthName as 'select' argument would be ideal.

I have already asked this question on their community/support, but haven't received any feedback thus far.

Thanks in advance!

Michel Rummens
  • 459
  • 3
  • 9

3 Answers3

1

The Exact Online APIs sometimes include additional fields from related tables. With $expand some additional information comes available on selected end points, but with a relatively high loss of performance.

I recommend using something like:

select *
from   exactonlinerest..accountsbulk act
join   exactonlinerest..users usr
on     usr.id = act.accountmanager

and then translated into your preferred platform.

Note that users is a subscription-specific API; it returns the same values across all divisions owned by a subscription. On Accountancy there are multiple subscriptions accessible, on entrepreneur only one.

See explanation on datamodel division-specific/subscription-specific/general on https://documentation.invantive.com/2017R2/exact-online-data-model/webhelp/index.html

Note that you can retrieve multiple account managers with one API call as long as you don't exceed the maximum supported URL length (say 1400 characters).

Sometimes you can use $batch but that is deprecated: when there is a problem support won't help.

Guido Leenders
  • 4,232
  • 1
  • 23
  • 43
  • Thanks for your reply! I am not sure if my company is willing to use Invantive's software for accessing the exact online API. Do you know if there is any other way of using the EO rest API to achieve join-like behaviour? – Michel Rummens Jan 06 '21 at 09:15
  • That is not necessary. Run it using a free trial and then check sessionios@data dictionary for the actual used APi calls or activate native call logging. Then rebuild in PHP. – Guido Leenders Jan 07 '21 at 10:32
0

Finally the support of Exact Online responded, but they told me it is not possible to fetch child entities within the same request. The entities will have to be fetched within a separate call using the GUID provided in the initial call.

I'm guessing Guido' Invantive software has developped some kind of wrapper to do this automatically, but that is not feasible for our situation.

Therefore, as it is concluded Exact Online's API doesn't support this kind of behavior, I am accepting my own answer.

Michel Rummens
  • 459
  • 3
  • 9
0

You can use the XML API to retrieve nested entities :)

Alex
  • 447
  • 3
  • 8