How to consume market API

Market API will be receiving request through VA URL by POST operation having Request content within request body and API is integrated within VA URL. 

 

Feature Released With Version 

Market 3.0.1.0, module is released on Framework 5.x. 

Service Url:  

VA link +” API/Market_ModuleAPI” 

List of Facilities in Service 

  1. Get list of modules  

2. Install Modules 

3. Get installation status of ongoing request   

 

Facility 1: Modules List 

Request JSON 

              "Token": "sampleToken", 

              "UserName": "username", 

              "Password": "password", 

              "RequestType": "ML",       

              "ModuleNames": [“Beta Manufacturing”] 

Here System would expect either token or Username and password. To create token, WSerive is required which will receive username and password and provide a token valid for some time. 

This request will send the name of modules in "ModuleNames" and requester will receive list respectively.  If requester supplies empty list of "ModuleNames" then system will provide  list of all modules subscribed to license registered to Application URL.  

 

To Get Vendor specific modules user can add “VendorKey” parameter in request JSON.

This parameter supported in market version (3.0.5.0)

Example:

              "Token": "sampleToken", 

              "UserName": "username", 

              "Password": "password", 

              "RequestType": "ML",       

              "ModuleNames": [“Beta Manufacturing”],

               "VendorKey": "XXXXXXX-XXXXX-XXXXX-XXXXX"

 

 

In Put Parameter Detail 

"RequestType": "ML"  

Module list 

"ModuleNames": []  

Can be empty if require all modules subscribed to license registered to Application URL 

 

Output JSON: 

             

Failure Response 

{              

             "IsSuccess": false, 

             "Message": "Error Description", 

"ListModule": null 

              

Success Response 

             "IsSuccess": true, 

             "Message": "", 

             "ListModule": [ 

                           { 

                                          "Name": "Beta Manufacturing", 

                                          "Prefix": "VAMFG_", 

                                          "LatestAvailableVersion": "2.0.0.1", 

                                          "Installedversion": "1.0.80.1", 

                                          "AvailableVersions": [ 

                                                        "2.0.0.1", 

                                                        "1.0.86.1", 

                                                        "1.0.85.1", 

                                                        "1.0.80.1" 

                                          ] 

                           } 

             ]              

  

Facility 2: Modules Download 

Request JSON 

             "Token": "sampleToken", 

             "UserName": "Username", 

             "Password": "Password", 

             "RequestType": "MD", 

             "IsModuleSeqRestrict":true,  

             "LogKey":"DateTimeStamp", 

             "VendorKey": "XXXXXXX-XXXXX-XXXXX-XXXXX", 

             "ModuleList": [ 

                           { 

                                          "Name": "Inventory Provision", 

                                          "Version": "1.0.9.0", 

                                          "TenantSearchKeys": [ 

                                                        "Vienna", 

                                                        "SYSTEM" 

                                          ], 

                                          "InstallOnlyAppFiles": false, 

                                          "RunSyncTerminology": false 

                           }, 

                           { 

                                          "Name": "Manufacturing", 

                                          "Version": "1.0.59.0", 

                                          "TenantSearchKeys": [ 

                                                        "Vienna", 

                                                        "SYSTEM" 

                                          ], 

                                          "InstallOnlyAppFiles": false, 

                                          "RunSyncTerminology": false 

                           }, 

                           { 

                                          "Name": "UOM Pricing", 

                                          "Version": "1.0.19.0", 

                                          "TenantSearchKeys": [ 

                                                        "Vienna", 

                                                        "SYSTEM" 

                                          ], 

                                          "InstallOnlyAppFiles": false, 

                                          "RunSyncTerminology": false 

                           } 

                           ] 

  

In Put Parameter Detail 

Here System would expect either token or Username and password.  

 

"RequestType": "MD"   

Module Download or Module Install 

 

"IsModuleSeqRestrict": true  

If true system will install module as sequence define in module list and will not allow next module to download/Install in case any error occur while installing current module. 

If false System will continue with next module even current module installed with errors. 

  

"InstallOnlyAppFiles": false  

If false, system will update both database files and application files , as market runs through UI form 

If true, system will update only application files. 

  

"RunSyncTerminology": true 

After Module installation system will Sync Terminology process if true 

 

 "LogKey":"DateTimeStamp” 

If User need get the status of installation of ongoing request then have to supply unique LogKey value at the time of start request then with same logkey value user can fetch the installation status latter on.

 

"VendorKey": Vendor License Key

To Download Vendor specific modules user can add “VendorKey” parameter in request JSON. This parameter supported in market version (3.0.5.0). It’s optional parameter only required to install vendor modules.

 

 

Output JSON: 

a. [{"IsSuccess”: false,"Message":"Error Description","Name":null}] 

b. [ 

           { 

           "IsSuccess": true, 

           "Message": "OK", 

           "Name": " Inventory Provision" 

           }, 

           "IsSuccess": true, 

           "Message": "OK", 

           "Name": " Manufacturing " 

}, 

           "IsSuccess": true, 

           "Message": "OK", 

           "Name": " UOM Pricing" 

           } 

   ] 

 

Facility 3: Get Log 

Request JSON 

             "RequestType": "GL",  

             "LogKey":"DateTimeStamp"         

 

 In Put Parameter Detail 

 

"RequestType": "GL"   

Get log 

 

"LogKey":"DateTimeStamp” 

  Supply the same value that supplied with in install Module request 

 

Output JSON: 

a. [{"IsSuccess”: false,"Message":"Error Description","Name":null}] 

b. [ 

           { 

           "IsSuccess": true, 

           "Message": "OK", 

           "Name": " Inventory Provision" 

           }, 

           "IsSuccess": true, 

           "Message": "OK", 

           "Name": " Manufacturing " 

}, 

           "IsSuccess": true, 

           "Message": "OK", 

           "Name": " UOM Pricing" 

           } 

   ] 

  

Generate Auth Token 

WService is required to generate auth token in VA system. There exist a service method to generate token against supplied user credentials, it will be valid for mentioned time.   

This service will return a token , it will be used in market api json request. 

Please refer to WService document for detail. 

 

Module installation Log: 

System will maintain log for all the module installed from API in Window: Module Installation Log

As shown in the below image logs of modules installed by user through API.  

When user hit an API for module installation, system will create a Log with a unique number with the information of installed module (Failed, In Progress and Completed) in module installation log window.  

List of installed modules in details will display in Module Log Line Tab  from there user can get the message status of a particular module under Error Message field. 

 

When module installation is Failed: 

When status field is Failed, means there is some error while installing module and the error message will store under Error message field. 

  

When module installation InProgress: 

When status field  is InProgress , means module installation is in progress and once it is done InProgress status will change with completed. 

  

When module installation Completed: 

When status field is Completed, means module gets installed successfully into system. 

 

Note: On install module by using Market API, System will auto stop the running service in VServer, and system will auto run the services after module installation if configured as Auto Run = True.

No manual intervention required to stop VServer services for module installation by consuming Market API.