Our RestAPI supports authorization via API key. You can find your API key in User Profile page which is available inside menu that appears when you click on username on right top of the screen. If you try to connect to REST API without specifying security credentials or specifying incorrect credentials you will receive an error message like this
{ error: "Access denied", success: false } | An example of authentication of the user with apikey dsagdsew45234etw435
curl -H "X-Auth-Token: dsagdsew45234etw435" "http://sureqrapp.nizamer.com/api/v1.php?table=outward_letters&action=list" | API documentation in this knowledgebase will include a few keywords which are defined below.
Table After you login SureQR, table name is included in the URL of every page. For instance, when you are on list page of Documents. You will can see this URL in the address bar of your browser https://sureqrapp.nizamer.com/outward_letters_list.php | Table name is the word in URL between sureqr.nizamer.com/ and the last _ (underscore) before .php In the example above outward_letters is table name. You can will learn about other tables in this article later.
editid1, editid2, editid3
editid1 represents the first key field name of all table. Instead of using actual name of first key field of a table, SureQR uses editid1 as first key field name for all the tables for view, update and delete. However for API of insert, actual first key field names are used. editid2 is second key field which is always your User ID, whereever appliable, available at User Profile page. Similarly, editid3 is third key field. Following is a table to summarize all tables and their key fields
Table | Number of key fields | First key field | Second key field | Third key field
| outward_letters | 1 | outward_no | | | fixedassets | 2 | fa_code | userid | | employees | 2 | emp_no | userid | | organization | 2 | org_no | userid | | falocation | 1 | locationid | | | facategory | 1 | id | | | doctypes | 2 | doctypeid | userid | | |