Generate API Secret Key
This guide will walk through generating API Secret Key, which allow the user to access SQL Account API Services.
Step to Generate API Secret Key
-
Navigate to User Detail:
Go to
Tools>Maintain User...>Detail -
Select API Secret Key Option:
Click on
More>API Secret Key -
Generate Secret Key:
Click on
Generate API Secret KeyImportant NoteOnce an
API Secret Keyis generated for a user, that user will no longer be able to login on SQL Account directly. The user only be able to accessSQL Account API Servicewith the secret key generated. -
Copy and Save Secret Key
The API
Access KeyandSecret Keywill displayed. Make sure to copy and save it immediately in a secure location.TipAPI Secret Key can only be retrieved at the time of generated. If you lose it, you can
revokeandgeneratea new API Secret Key.
Test AWSv4 Signature with API Secret Key
SQL Account API Service uses AWS Signature Version 4 for authenticating requests. You can click on Test Connection to test on the request with AWSv4 authorization header.
For a sample cURL request with AWSv4 authorization header, click on Copy.
Download and Import SQL Account API Postman Collection
-
Download Postman Collection:
Click on
Download Postman Collectionto savepostman_collection.jsonfile. -
Import the API specification into your Postman application:
Click on
Import, then selectpostman_collection.jsonfile you downloaded to import.
-
Update Access Key and Secret Key:
After postman collection imported, navigate to
Variablestab. Then, replace theyour_access_keyandyour_secret Keywith the Access Key and Secret Key generated earlier.
-
Test on API Endpoint
Select on
Agentendpoint. Then, click onSendto try retrieve agent data fromSQL Account API Serviceand theAgentjson data list will show on response body.
FAQ
When I try to update(PUT) for Data Entry (eg Sales Invoice) it prompt error "Record has been changed by other users."
- Make sure at you update the field updatecount by +1 after you get the original updatecount from sqlacc
- Below example original is 2
.....
"updatecount": 3,
"sdsdocdetail": [
{
"dtlkey": 99,
.....
How to update(PUT) detail information for Data Entry (eg Sales Invoice)?
- Make sure at sdsdocdetail For Update => Insert field dtlkey with the original dtlkey from sqlacc For Insert New record => Remove the dtlkey field or Set it as -1
- Below example is to Update Detail Row 1 & Insert 2 new row
.....
"sdsdocdetail": [
{
"dtlkey": 99,
"seq": 1,
"itemcode": "ISCT",
"description": "Industrial Style Round Coffee Table - Edited",
.....
},
{
"seq": 2,
"itemcode": "MISC",
"description": "MISC - New Insert",
.....
},
{
"dtlkey": -1,
"seq": 3,
"itemcode": "RM-04",
"description": "Arm Rest - New Insert",
....
If provided dtlkey is invalid system will treat is as Insert New Record
What is the max limit for GET?
- Currently max is 50 records per request
How many ways for GET Method available?
- Now it supported 3 ways on GET method.
| Example Get Method | Description |
|---|---|
/purchaseinvoice/?docno=PI-00001 | Return list (master data only), can filter by all master table fields. |
/purchaseinvoice/*?docno=PI-00001&code=400-A0001 | Return single record (master + detail data), can filter by indexed table fields. Fields available: code, docdate, docno, postdate, eiv_utc |
/purchaseinvoice/{dockey} | Return single record (master + detail data), by path parameter dockey only. |