How to get authtoken for Books function to get List of PO ?

How to get authtoken for Books function to get List of PO ?

Hello,

I'm trying a small test function in Books Automation for module Purchase Order to get the list of billed PO. This test should run standalone for now. Later I plan to attach the function to a button or link for admin to run it.

Surprisingly, it requires at least one known PO to get the list of the others. Arguments are mandatory, I don't need them.
  1. void test_getpostatus( map purchaseorder , map organization , map user ) {
  2. organizationID = <hidden>;
  3. poSearch = {"status":"billed"};
  4. poList = zoho.books.getRecords("Purchaseorders",organizationID, poSearch);
  5. info poList;
  6. }

When I execute the function, it fails...
{"code":14,"message":"Invalid value passed for authtoken."}

How do I get a valid Books authtoken, so this Books function can run inside Books ?

PS:
I copied this script inside CRM standalone function:

  1. String getPOStatus() {
  2. organizationID = <hidden>;
    poSearch = {"status":"billed"};
    poList = zoho.books.getRecords("Purchaseorders",organizationID,
    poSearch);
    info poList;
    return "";
  3. }
and this works ! How funny :)

Regards