Not sure what this is but it's an article listing some errors in Zoho Books when using the shortcode command to retrieve the details for an item in Zoho Books...
Why?
I have no idea. I cannot for the life of me figure out why this item does not appear. I can see it in the list view using the interface. When i just do the commaind it shows me the record; but if I use zoho.books.getRecordsByID() other than being grammatically incorrect, it does not work... I think it's the product/item record.
How?
I tried various ones including an invokeUrl and then a colleague gave me the following. I hope it helps someone else out there too...
Note that connection zbooks has zohobooks.fullaccess.all and this code is on the EU datacenter:
copyraw
info item;
// yields {the correct record}
info zoho.books.getRecordsByID("item","12345678901","123456000000987654","ab_books");
// yields Exception : Invalid JSON Format String
r_Item = invokeurl
[
url: "https://www.zohoapis.eu/books/v3/items/"+item.get("item_id")+"?organization_id="+organization.get("organization_id")
type: GET
connection: "ab_books"
detailed: true
];
info "This Item: " + r_Item.toString();
// yields This Item:
// "responseCode":500
info zoho.books.getRecordsByID("elephants","12345678901",123456000000987654,"zbooks");
// yields {"code":5,"message":"Invalid URL Passed"}
info zoho.books.getRecordsByID("items","elephants",123456000000987654,"zbooks");
// yields {"code":2,"message":"Invalid value passed for organization_id"}
info zoho.books.getRecordsByID("items","12345678901","elephants","zbooks");
// yields {"code":5,"message":"We couldnt find any resource for the given ID. Please verify the ID and try again."}
info zoho.books.getRecordsByID("items","12345678901","123456000000987654","elephants");
// yields Exception : Connection 'elephants' does not exist
info zoho.books.getRecordsByID("items","12345678901",123456000000987654,"zbooks");
// yields Exception : Invalid JSON Format String
v_ItemIDs = "123456000000987654";
r_ItemsVerbose = invokeurl
[
url :"https://www.zohoapis.eu/books/v3/itemdetails?organization_id=12345678901&item_ids=" + v_ItemIDs
type :GET
connection:"zbooks"
];
info "r_ItemsVerbose: " + r_ItemsVerbose;
// yields record details for item id
- info item;
- // yields {the correct record}
- info zoho.books.getRecordsByID("item","12345678901","123456000000987654","ab_books");
- // yields Exception : Invalid JSON Format String
- r_Item = invokeurl
- [
- url: "https://www.zohoapis.eu/books/v3/items/"+item.get("item_id")+"?organization_id="+organization.get("organization_id")
- type: GET
- connection: "ab_books"
- detailed: true
- ];
- info "This Item: " + r_Item.toString();
- // yields This Item:
- // "responseCode":500
- info zoho.books.getRecordsByID("elephants","12345678901",123456000000987654,"zbooks");
- // yields {"code":5,"message":"Invalid URL Passed"}
- info zoho.books.getRecordsByID("items","elephants",123456000000987654,"zbooks");
- // yields {"code":2,"message":"Invalid value passed for organization_id"}
- info zoho.books.getRecordsByID("items","12345678901","elephants","zbooks");
- // yields {"code":5,"message":"We couldnt find any resource for the given ID. Please verify the ID and try again."}
- info zoho.books.getRecordsByID("items","12345678901","123456000000987654","elephants");
- // yields Exception : Connection 'elephants' does not exist
- info zoho.books.getRecordsByID("items","12345678901",123456000000987654,"zbooks");
- // yields Exception : Invalid JSON Format String
- v_ItemIDs = "123456000000987654";
- r_ItemsVerbose = invokeurl
- [
- url :"https://www.zohoapis.eu/books/v3/itemdetails?organization_id=12345678901&item_ids=" + v_ItemIDs
- type :GET
- connection:"zbooks"
- ];
- info "r_ItemsVerbose: " + r_ItemsVerbose;
- // yields record details for item id
Category: Zoho Books :: Article: 1726


