Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

General Information

...

Service

API

Method

Data Model

Workflow

Group

multitenant

/product

GET

...

...

N/A

Product

Description

Get product

Input

...

Code Block
Type: application/json


Name

Source

Mandatory

Type

Special Format

Description

id

Query

YES

NO

String

N/A

The product id

code

Body

Query

YES

NO

String

The Length is 4 - 5

The product code


Output

...

Response

...

SOAJS has a unified response. Check out this link to understand more the schema of SOAJS response 

Valid Response

{
Expand
titleValid Response Sample
Code Block
languagejs
{
 
"result":
 
true,
  "
data
code" : 
{
"TPROD",
    "
_id
name" : "
5d776ce4e8c4bb0424e3bc7d
Test Product",
    "
locked
description" : 
true,
"this is a description for 
"code": "DSBRD
test product",
    "
name
console": 
"Console UI Product"
false,
    "
description
scope": 
"This
{
is
 
the
 
main
 
Console
 
UI
 
Product.",
   
"
console
acl": 
true,
{
   
"scope":
 
{
       "
acl
dashboard": {
          
"dashboard":
 
{
    "multitenant": {
     
"urac":
 
{
             "
2
1": {
              
"access":
 
true,
        "access": false,
     
"apisPermission": "restricted",
                  "get": [
                
{
           {
       
"group": "Administration",
                        "apis": {
                    
"/admin/all": {
               
"access
"/product": 
true
{
                  
},
                     "
/admin/listUsers
access": 
{
false
                      
"access":
 
true
            }
        
},
                     
"/admin/changeUserStatus":
 
{
 
},
                    
"access":
 
true
          "group": "Product"
         
},
                  }
  
"/admin/group/list":
 
{
                    ]
  
"access":
 
true
                },
    
}
               "1x2": {
  
}
                 
},
    "access": true,
         
],
              "
post
get": [
                  
{
         {
           
"group":
 
"Administration",
                   "apis": {
                       
"/admin/addUser":
 
{
           "/tenant": {
          
"access":
 
true
                     
},
       "access": false
            
"/admin/editUser":
 
{
                      }
"access":
 
true
                     
},
         },
           
"/admin/group/add":
 
{
                   
"group": "
access
Tenant"
:

true
                     
},
      }
              
"/admin/group/edit": {
         ],
                
"access":
 
true
      "post": [
             
}
              {
    
}
                 
}
          "apis": {
   
],
               
"delete":
 
[
                "/tenant": {
                   
"group":
 
"Administration",
                   "
apis
access": true
   
{
                     
"/admin/group/delete":
 
{
          }
            
"access":
 
true
                  },
  
}
                   
}
          "group": "Tenant"
      
}
               
]
      }
      
}
           
},
      ]
    
"multitenant":
 
{
             
"1":
 
{
}
              
"access":
 
false
},
               "
get
urac": 
[
{
                
{
   "1": {
              
"group":
 
"Product"
        "access": true,
       
},
                
{
"apisPermission": "restricted",
                       "
group
get": 
"Tenant"
[
                
}
           {
   
],
               
"post":
 
[
            "apis": {
   
{
                   
"group":
 
"Product"
            "/user": {
   
},
                 
{
                   "
group
access": 
"Tenant"
false
                
}
               
],
    }
            
"put":
 
[
                 
{
 },
                 
"group":
 
"Product"
             "group": "Administrator"
  
},
                 
{
        }
          
"group":
 
"Tenant"
            ]
    
}
               
]
},
              
"delete":
 
[
    "2x5": {
           
{
            "access": true,
     
"group":
 
"Product"
                 
}
"apisPermission": "restricted",
                
{
       "post": [
            
"group": "Tenant"
               {
   
}
               
]
             
}
"apis": {
         
}
         
}
       
}
     
},
     "
packages
/account/changeEmail": {
[
       
{
         
"code":
 
"DSBRD_OWNER",
         
"name":
 
"Owner",
            "
description
access": 
"This package is used to provide owner level access. This means the user who has this package will have access to everything.",
true
                                  
"locked":
 
true
},
          
"acl":
 
{
           
"dashboard":
             "
urac
/account/changePassword": {
 
[
               
{
                 
"version":
      "
2
access"
,
: true
               
"get":
 
[
                   
"Administration"
},
                  
],
                 "
post
/account/editProfile": 
[
{
                  
"Administration",
                 
],
    "access": true
           
"delete":
 
[
                   
"Administration"
    
}
           
]
               
}
     },
       
],
             
"multitenant":
 
[
          "group": "My Account"
  
{
                 
"version":
 
"1",
       }
         
"get":
 
[
             
],
    
"Product",
                   "
Tenant
get": [
                
],
           {
          
"post":
  
[
                   "
Product
apis"
,
: {
                 
"Tenant"
                 
],
 "/account/getUser": {
              
"delete": [
                         "
Product
access"
,
: true
                  
"Tenant"
                 
],
}
                
"put":
 
[
              },
    
"Product",
                   
"Tenant"
        "group": "My Account"
      
]
               
}
      }
      
]
           
}
      ]
  
},
         
"_TTL":
 
604800000
       }
,

       
"_TTL":
 
21600000
       }
    
]
      
}
 }

Invalid Response

Code Block
languagejs
titleError Response Sample
{

    
"result":false,
    }
"errors":{
    },
    "
codes
packages" : [
460],

        
"details":[
{
            
{
"code" : "TPROD_BASIC",
            "name" : 
"code":460,
"basic package",
            "description" : "this is a description for test product basic package",
            "
message
acl"
:"Unable to find products"
 : {
                "dashboard": 
}
{
        
]
     
} }

...

Code

...

Description

...

460

...

474

...

Missing required field: either id or code

...

602

...

Model error: + %model_error%

Example (CURL)

Request

Code Block
languagebash
titleCalling List Products API
 > CURL -X GET http://127.0.0.1:4004/product?id=%product_id%

Response

Code Block
languagejs
titleList Products API response
{ "result": true, "data": [ {
       "multitenant": [
                        {
                            "version": "1",
                            "get": [
                                "Product"
                            ]
                        },
                        {
                            "version": "1.2",
                            "get": [
                                "Tenant"
                            ]
                        }
                    ],
                    "urac": [
                        {
                            "version": "1",
                            "get": [
                                "Administrator",
                            ]
                        },
                        {
                            "version": "3",
                            "get": [
                                "Administrator",
                                "My Account",
                            ]
                        }
                    ]
                }
            },
            "_TTL" : 86400000 // 24 hours
        },
        {
            "code" : "TPROD_EXAMPLE03",
            "name" : "example03 package",
            "description" : "this is a description for test product example03 package",
            "acl" : {
                "dashboard": {
                    "urac": [
                        {
                            "version": "2.5",
                            "get": [
                                "My Account",
                            ],
                            "put": [
                                "My Account",
                            ],
                            "delete": [
                                "My Account",
                            ],
                            "post": [
                                "My Account",
                            ]
                        }
                    ]
                }
            },
            "_TTL" : 86400000 // 24 hours
        }
    ]
}

Invalid Response

Expand
titleError Response Sample
Code Block
languagejs
{
    "result":false,
    "errors":{
        "codes":[460],
        "details":[
            {
                "code":460,
                "message":"Unable to find products"
            }
        ]
}
    
] }
}
}

Response schema

Follow this link to check out the response JSON Schema

SOAJS Error Codes

...

Code

Description

400

Business logic required data are missing

460

Unable to find products

602

Model error: + %model_error%