...
...
General Information
...
Service | API | Method | Data Model | Workflow | Group |
---|---|---|---|---|---|
multitenant | /product | POST |
Data Model: Groups
Products | N/A | Product |
Description
Add product
Input
...
Type: application/json
...
Name | Source | Mandatory | Type | Special Format | Description |
---|---|---|---|---|---|
code | Body | YES | String | The length is between 4 - 5 | Product code |
name | Body | YES | String | N/A | Product name |
description | Body | NO | String | N/A | Product description |
Output
scope | Body | NO | Object | Scope Schema | Product Scope - Check the Example below |
Scope Example
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| {
| |||||||||
"scope": { "acl": { "dashboard": { "multitenant": { "1": { "result "access": truefalse, "dataget": [ { "name/product": { "Fadi2", "access": false }, "codegroup": "FADI2",'Product' } ] }, "2.1" : { "descriptionaccess": "Some"false, "scopeget": [ { "acl/product": {} }, "packagesaccess": [], false }, "_idgroup": "5d6fedabbed68d11b6f54636" 'Product' } ] } } } } } |
...
Output
...
Response
SOAJS has a unified response. Check out this link to understand more the schema of SOAJS response
Valid Response
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
{ "result":false, true, "data": [ { "name": "Fadi2", "code": "FADI2", "description": "Some Description", "scope": { "errors":{ "acl": { "dashboard": { "multitenant": { "1": { "codesaccess":[468], false, "details":[ "get": [ { "code":468, "/product": { "access": false }, "messagegroup":" 'Product already exists"' } ] } } |
...
Code
...
Description
...
468
...
Product already exists
...
469
...
Unable to add the product record
...
474
...
Missing required field: either id or code
...
Request
Code Block | ||||
---|---|---|---|---|
| ||||
> CURL -X GET http://127.0.0.1:4004/product -d {
"code": "silver",
"name": "Silver",
"description": "product description"
} |
,
"2.1" : {
"access": false,
"get": [
{
"/product": {
"access": false
},
"group": 'Product'
}
]
}
}
}
}
},
"packages": [],
"_id": "5d6fedabbed68d11b6f54636"
}
]
} |
Invalid Response
Code Block | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
{ "result":false, "errors": true,{ "codes":[468], "datadetails": [[ { "code":468, "message":"Product already exists" } ] } } |
Code | Description |
---|---|
400 | Business logic required data are missing |
468 | Product already exists |
602 | Model error: + %model_error% |