{"info":{"_postman_id":"42bea646-3ba1-4256-8dc5-bfaf7b1d401e","name":"APPGINI API","description":"<html><head></head><body><h3 id=\"appgini-api-built-on-top-of-appginilte\">Appgini API Built on top of <strong>AppginiLTE</strong></h3>\n<p>This API has been developed to enable <strong>Appgini</strong> application developers to easily interact with their apps using APi. This can enable you communicate easily with external apps or integrate to other applications easily.</p>\n<p>You can access or call the APIs using any language of choice, you can see sample code implementations from the <strong>LANGUAGE</strong> menu.</p>\n<p>We have several <strong>APIs</strong> to perform several functions including:</p>\n<ul>\n<li>Authenticating users for login requests via API</li>\n<li>Registering new members</li>\n<li>Send forgot password requests</li>\n<li>Change password</li>\n<li>Update profile</li>\n<li>Get table data</li>\n<li>Create table record</li>\n<li>Update table record</li>\n<li>Delete table record</li>\n<li>Generate access token for API auth</li>\n<li>Get list of user groups</li>\n</ul>\n<h5 id=\"your-api-end-points\">YOUR API END POINTS</h5>\n<p>Your API endpoints will be <a href=\"https://yourapp/appginilte/api/%7BAPI\"><strong>https://yourapp/appginilte/api/ {API</strong></a> <strong>ENDPOINT}</strong></p>\n<p><strong>replace</strong> <a href=\"https://yourapp/\"><strong>https://yourapp/</strong></a> With your actual <strong>app URL</strong> or <strong>path</strong> <a href=\"https://google.com/\">eg. <strong>https://google.com/</strong></a> <em><strong>appginilte/api/</strong></em> <strong>auth</strong></p>\n<p>A detailed explanation of each API is provided below.</p>\n<p>Also note: You must be using the <strong>AppginiLTE</strong> plugin or related themes for this API to work:</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"8153370","collectionId":"42bea646-3ba1-4256-8dc5-bfaf7b1d401e","publishedId":"VUxRQ6i2","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2022-09-02T15:24:06.000Z"},"item":[{"name":"AUTH LOGIN","id":"15fe53b2-c6e5-493b-96af-12f300f79344","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\":\"admin\",\r\n    \"password\":\"admin12345\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost/nwapp/appginilte/api/auth","description":"<p>Use this API to authenticate users on your application. Simply provide the username and password.</p>\n<p>The API will authenticate user and return User Data upon successful authentication for your consumption in subsequent queries.</p>\n<p>In the response body you will have an <strong>Error</strong> parameter which is either valued 1 for error or 0 for no error.</p>\n<p>There is also <strong>Message</strong> parameter that explains the state of the api request for Error 1 refer to Message value to know what happened.</p>\n<h3 id=\"access-token\">Access Token</h3>\n<p>Upon successful authentication, the response body from the API will contain <strong>Access_Token</strong> parameter.</p>\n<p>You will use this access token for making any other subsequent API calls where it is required.</p>\n","urlObject":{"protocol":"http","path":["nwapp","appginilte","api","auth"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"15fe53b2-c6e5-493b-96af-12f300f79344"},{"name":"MEMBER REGISTER","id":"c0220ad5-e1c5-4263-8605-ec02304bac8f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\":\"testapi\",\r\n    \"password\":\"1234567890\",\r\n    \"email\":\"test@gmail.com\",\r\n    \"custom1\":\"custom1\",\r\n    \"custom2\":\"custom2\",\r\n    \"custom3\":\"custom3\",\r\n    \"custom4\":\"custom4\",\r\n    \"groupID\":\"19\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost/nwapp/appginilte/api/register","description":"<p>Use this API to register new members to your application. For <strong>groupID</strong> use the GET membership groups API to get list of groups to use.</p>\n","urlObject":{"protocol":"http","path":["nwapp","appginilte","api","register"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"c0220ad5-e1c5-4263-8605-ec02304bac8f"},{"name":"GET TABLE DATA","id":"490b9ca0-b3aa-4397-b97f-a6cc8bbb346c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\":\"admin\",\r\n    \"table_name\":\"products\",\r\n    \"select_fields\":[\"ProductID\",\"ProductName\",\"CompanyName\",\"CategoryName\",\"QuantityPerUnit\",\"UnitPrice\",\"Discontinued\"],\r\n    \"custom_where\":\"ProductName='Ikura'\",\r\n    \"page_number\":\"1\",\r\n    \"results_per_page\":\"10\",\r\n    \"access_token\":\"l4Urr732KWLzSvh/iGvWiDq78AcJfqrYRvCKMHx9U3g/DQDAxPIjGCQkhOaRiTQNb9o47szqjM9zQP3E\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost/nwapp/appginilte/api/get_table_data","description":"<p>Use this API to get the data of any table you want . You can supply an optional where using <strong>custom_where</strong> parameter to drill down the results you want. Do not start with WHERE, Just write your SQL condition</p>\n<p>You can also provide <strong>select_fields</strong> which is optional, could be blank if you want to get all fields. If you want specific fields provide an object with the specific field names</p>\n<p>For pagination purposes you are required to specify the <strong>results_per_page</strong> and the <strong>page_number</strong></p>\n<p>Table permissions for viewing records are also applied when pulling data for any given user.</p>\n","urlObject":{"protocol":"http","path":["nwapp","appginilte","api","get_table_data"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"490b9ca0-b3aa-4397-b97f-a6cc8bbb346c"},{"name":"FORGOT PASSWORD","id":"6b473118-921e-4a4a-aff4-c91f3c1ee6e6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\":\"staff\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost/nwapp/appginilte/api/forgot_password","description":"<p>Use this API to request for password reset. Provide username and the API will send an email to the user.</p>\n<p>For email to be sent you need to have enabled SMTP.</p>\n","urlObject":{"protocol":"http","path":["nwapp","appginilte","api","forgot_password"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"6b473118-921e-4a4a-aff4-c91f3c1ee6e6"},{"name":"CREATE TABLE RECORD","id":"70b31d85-05f6-4703-bad3-abd99797a360","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\":\"new_staff\",\r\n    \"table_name\":\"test_enc\",\r\n    \"data\":{\r\n        \"card_number\":\"99008877\",\r\n        \"card_holder\":\"BENJAMIN WAITHAKA\",\r\n        \"expiry_date\":\"2023-08-19\"\r\n    },\r\n    \"access_token\":\"l4Urr732KTXJLf1MuivU6wO8uTMAes7cDMnwOUYuQ3pIQyiD3Yk0JCYvvMajqQQIUcEA8dXDstxkceTi\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost/nwapp/appginilte/api/create_record","description":"<p>Use this API to insert a new record to any table, here you will specify <strong>table_name</strong>, and the data to be inserted.</p>\n<p>The <strong>data</strong> will be an object that has the <strong>column_name</strong> and the value for it eg:</p>\n<p><code>{</code></p>\n<p><code>\"full_name\":\"john doe\",</code></p>\n<p><code>\"email\":\"johndoe@gmail.com\"</code></p>\n<p><code>}</code></p>\n<p><strong>Also note</strong> this API automagically consumes your logic in the table hook functions before and after insert.</p>\n<p>Membership permissions are also considered for creating records.</p>\n","urlObject":{"protocol":"http","path":["nwapp","appginilte","api","create_record"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"70b31d85-05f6-4703-bad3-abd99797a360"},{"name":"EDIT TABLE RECORD","id":"b9c90974-e576-4219-96b8-508a5c839cde","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\":\"admin\",\r\n    \"table_name\":\"categories\",\r\n    \"selected_id\":\"16\",\r\n    \"data\":{\r\n       \"CategoryName\":\"Picture Perfect\",\r\n        \"Description\":\"Test API record update hooks 2\" \r\n    },\r\n    \"access_token\":\"l4Urr732KWLzSvh/iGvWiDq78AcJfqrYRvCKMHx9U3g/DQDAxPIjGCQkhOaRiTQNb9o47szqjM9zQP3E\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost/nwapp/appginilte/api/edit_record","description":"<p>Use this API to edit the content of any table:</p>\n<p>provide the <strong>table_name</strong>, <strong>selected_id</strong> and the <strong>data</strong> to be updated.</p>\n<p><strong>Also note</strong> this API automagically consumes your logic in the table hook functions before and after update.</p>\n<p>Membership permissions are also considered for editing records.</p>\n","urlObject":{"protocol":"http","path":["nwapp","appginilte","api","edit_record"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"b9c90974-e576-4219-96b8-508a5c839cde"},{"name":"DELETE TABLE RECORD","id":"1702907f-2d7a-4905-99cb-4e3b44887de5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\":\"admin\",\r\n    \"table_name\":\"categories\",\r\n    \"selected_id\":\"16\",\r\n    \"access_token\":\"l4Urr732KWLzSvh/iGvWiDq78AcJfqrYRvCKMHx9U3g/DQDAxPIjGCQkhOaRiTQNb9o47szqjM9zQP3E\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost/nwapp/appginilte/api/delete_record","description":"<p>Use this API to delete any table record, provide the <strong>table_name</strong> and the <strong>record_id</strong></p>\n<p><strong>Also note</strong> this API automagically consumes your logic in the table hook functions before and after delete.</p>\n<p>Membership permissions are also considered for deleting records.</p>\n","urlObject":{"protocol":"http","path":["nwapp","appginilte","api","delete_record"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"1702907f-2d7a-4905-99cb-4e3b44887de5"},{"name":"CHANGE PASSWORD","id":"c1c303b3-bb8f-4d45-95c0-7ca268a436e5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\":\"testapi\",\r\n    \"oldPassword\":\"1234567890\",\r\n    \"newPassword\":\"Phk#2023\",\r\n    \"access_token\":\"l4Urr732KSnSJMZo+BONrR/qwBEjK+naGtqHQVYlcXhALlL0mep0GS8zjJW4wTUAe8Yk3svLissFZtz6\"\r\n\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost/nwapp/appginilte/api/change_password","description":"<p>Use this API to initiate password change. provide username,oldpassword and newpassword</p>\n","urlObject":{"protocol":"http","path":["nwapp","appginilte","api","change_password"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"c1c303b3-bb8f-4d45-95c0-7ca268a436e5"},{"name":"UPDATE PROFILE","id":"460a1c6b-1612-411e-8ca7-7332d5bcca91","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\":\"admin\",\r\n    \"access_token\":\"l4Urr732KWLzSvh/iGvWiDq78AcJfqrYRvCKMHx9U3g/DQDAxPIjGCQkhOaRiTQNb9o47szqjM9zQP3E\",\r\n    \"email\":\"ronniengoda@gmail.com\",\r\n    \"custom1\":\"ronald ngoda\",\r\n    \"custom2\":\"kenya\",\r\n    \"custom3\":\"0708344101\",\r\n    \"custom4\":\"anything\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost/nwapp/appginilte/api/update_profile","description":"<p>Use this API to update user details.</p>\n","urlObject":{"protocol":"http","path":["nwapp","appginilte","api","update_profile"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"460a1c6b-1612-411e-8ca7-7332d5bcca91"},{"name":"GET MEMBERSHIP GROUPS","id":"642be74a-beae-4c4c-ae86-9535c4c1261e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost/nwapp/appginilte/api/get_groups","description":"<p>Use this API to fetch available user groups</p>\n","urlObject":{"protocol":"http","path":["nwapp","appginilte","api","get_groups"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"642be74a-beae-4c4c-ae86-9535c4c1261e"},{"name":"SEARCH","id":"9aaa62d2-65ae-495f-a4c9-5612942bb572","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\":\"admin\",\r\n    \"table_name\":\"order_details\",\r\n    \"search_term\":\"Gustaf's Knäckebröd\",\r\n    \"page_number\":1,\r\n    \"results_per_page\":10,\r\n    \"access_token\":\"l4Urr732KW/0SuNjvjGx7kK32El1Off2XujlKB0fYi1FOyGAqr95fjAXuN/aizBUE9sRqa+ApO9lU/aD\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost/nwapp/appginilte/api/search","description":"<p>Use this API to do a search on any of your application table via API. If results are found you will have them listed.</p>\n<p>You will provide:</p>\n<p>username</p>\n<p>table_name</p>\n<p>search_term</p>\n<p>page_number: for pagination purposes</p>\n<p>results_per_page: for pagination purposes</p>\n<p>access_token</p>\n","urlObject":{"protocol":"http","path":["nwapp","appginilte","api","search"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"9aaa62d2-65ae-495f-a4c9-5612942bb572"},{"name":"API FUNCTIONS","id":"59424fb3-4200-4004-a4f6-0c26c96cb6aa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\":\"admin\",\r\n    \"access_token\":\"l4Urr732KW/0SuNjvjGx7kK32El1Off2XujlKB0fYi1FOyGAqr95fjAXuN/aizBUE9sRqa+ApO9lU/aD\",\r\n    \"function_name\":\"test_function\",\r\n    \"parameters\":[\"john doe\",55]\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost/nwapp/appginilte/api/api_functions","description":"<p>You can use this API to call your custom API functions. You can define your API functions in <strong>appginilte/api/custom_functions.php</strong></p>\n<p>Your functions need to return a result or value that can be returned in your API call response.</p>\n<p>Provide the following params:</p>\n<p>* <strong>username</strong><br />* <strong>access_token</strong><br />* <strong>function_name</strong>: the name of the function you have defined in : <em>appginilte/api/custom_functions.php</em><br />* <strong>parameters</strong>: the parameter values to be passed to the function, as an indexed array, if none required provide a blank object.</p>\n","urlObject":{"protocol":"http","path":["nwapp","appginilte","api","api_functions"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"59424fb3-4200-4004-a4f6-0c26c96cb6aa"},{"name":"RECORD COUNT","id":"f2b3c5a6-2318-45c2-89c4-d8be03b7f1b8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\":\"admin\",\r\n    \"access_token\":\"l4Urr732KW/0SuNjvjGx7kK32El1Off2XujlKB0fYi1FOyGAqr95fjAXuN/aizBUE9sRqa+ApO9lU/aD\",\r\n    \"table_name\":\"orders\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost/nwapp/appginilte/api/record_count","description":"<p>Use this API to get the record count from any table for a given user.</p>\n<p>Lets say you want to know how many orders are there for admin. simply provide username,access_token and table_name</p>\n<p>The API will respond with the total RecordCount for that table.</p>\n","urlObject":{"protocol":"http","path":["nwapp","appginilte","api","record_count"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"f2b3c5a6-2318-45c2-89c4-d8be03b7f1b8"}]}