Error: Invalid valued passed for authtoken on Getrecordsbyid method

Error: Invalid valued passed for authtoken on Getrecordsbyid method

I have written a custom function for Sales Order Module. In the custom function, I need to get zcrm_contact_id of the customer.

I get the customer id from the sales order and use getrecordsbyid method to get the customer details. My code is below.
  1. customerid = salesorder.get("customer_id");
  2. salesorderdate = salesorder.get("date").toDate();
  3. response = zoho.books.getRecordsByID("Contacts","xxxxxxx",customerid);
  4. x = response.get("message");
  5. info x;


I am getting the Invalid value passed for authtoken. The orgid passed in the method is correct. I am not sure where is the authtoken value.

Any help?