Page 1 of 1

API to get all values of Debtor Categories, Contact Position

PostPosted: Mon Apr 22, 2024 8:39 pm
We can see that Jiwa has an ID for each value of Debtor Categories, Debtor Classifications, Debtor Contact Positions. We can get the ID for a Debtor Category value in the response json once we push from salesforce which we can use to associate with a debtor. But not sure about the contact positions such as Primary, Secondary, Tertiary.

https://api.jiwa.com.au/swagger-ui/#/Debtors It seems there is no api to get all the Debtor categories (values) from Jiwa. Could you please help us to get the existing Debtor Categories, Debtor Contact Positions along with the Jiwa ID (through manual/ through api).

Re: API to get all values of Debtor Categories, Contact Posi

PostPosted: Tue Apr 23, 2024 6:55 am
by SBarnes
For debtor categories it does exist try

Code: Select all
GET /Queries/DB_Categories


As for contact positions it can be added with one line of code as shown below, if you search in the rest api plugin for DB_Categories and put the line below a line that similarly adds the DB_Categories routes and save the plugin and then restrart the api that should give you everything you want, whilst usually I wouldn't recommend editting that plugin and would rather suggest you use the plugin I have attached without knowing what version of Jiwa you are on there is a small chance this may not work so try adding the plugin first and see if that works otherwise resort to adding the line to the main rest api plugin.

In both cases you need to restart the api service to make everything recompile.

Code: Select all
AppHost.Routes.Add(typeof(CN_ContactPositionQuery), "/Queries/CN_ContactPosition", "GET", "Gets Contact Positions", "");