User Tools

Site Tools


en:server_api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:server_api [2026/06/03 08:57] – administratoren:server_api [2026/06/03 09:55] (current) – [API URL] administrator
Line 14: Line 14:
  
 ''Although the JSON Schema specification may use attribute $comment to specify a comment, but we find it may be too combersome to read. Instead we will use # to for a comment. Any text after the # are comment and we will preprocess the JSON Schema file by removing our comments before we submit to the validator.'' ''Although the JSON Schema specification may use attribute $comment to specify a comment, but we find it may be too combersome to read. Instead we will use # to for a comment. Any text after the # are comment and we will preprocess the JSON Schema file by removing our comments before we submit to the validator.''
- 
  
 ===== API URL ===== ===== API URL =====
Line 24: Line 23:
 https://api.igarment.net/jdoc/purchase_order/AX-10021 https://api.igarment.net/jdoc/purchase_order/AX-10021
  
 +**Authentication method**
  
 +To use iGarment API, you need to obtain a API KEY from your account manager and put the domain (database name) and the api-key in the Authorization Header of each HTTP request. Note that Authorization Header needs to be encoded in Base64.
  
 +Example, let said you want to send an api request for the domain 'demo'.
 +
 +  keyinfo = base64.b64encode(b'demo.igx-xxxxxxxxxxxxxxxxxxxxxxxxxx')
 +  headers = {'Authorization': keyinfo.decode()}
 +  
  
 (Example in Apifox) (Example in Apifox)
  
- +  var cryptoJs = require("crypto-js"); 
 +   
 +  const igx_key = 'demo.igx-xxxxxxxxxxxxxxxxxxxxxxxxxx' 
 +  const keyArray = cryptoJs.enc.Utf8.parse(igx_key); 
 +  pm.environment.set("igx_key", cryptoJs.enc.Base64.stringify(keyArray)); 
 +  
 ===== Error ===== ===== Error =====
  
Line 53: Line 63:
 ===== API Specification by catagory ===== ===== API Specification by catagory =====
  
-Database Query API (url: ~/db) +  * [[db_api|Database Query API]] 
-Document API (url: ~/jdoc)+ 
 +  * [[doc_api|Document API]]
  
en/server_api.1780477047.txt.gzip · Last modified: by administrator