Versions Compared

Key

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

...

ServiceAPIMethod
multitenant/productsGET


Data Model: Products

Workflow: 

Output

...

Valid Response

Code Block
languagejs
titleValid Response Sample
{
	  "result": true,
	  "data": [
    {
		
      "_id": "5c9e2466ab9d56e06a390b815d7762264305c302f032b24b",
		code
      "code": "TESTPTPROD",
		name: "      "name": "Test Product",
      "description": "this is a description for test product",
		description
      "console": nullfalse,
		scope: {
			acl: {
				manual: {
					endpointservice: {
						"1": {
							access: false
						}
					}
				}
			}
		},
		packages: [
			{
				code: "TESTP_TESTP",
				name: "test package",
				description: null,
				acl: {
					manual: {
						endpointservice: [
							{
								version: "1"
							}
						]
					}
				},
				_TTL: 604800000
			}
		]
	}
      "packages": [
        {
          "code": "TPROD_BASIC",
          "name": "basic package",
          "description": "this is a description for test product basic package",
          "acl": {
            "dashboard": {
              "oauth": [
                {
                  "version": "1",
                  "get": [
                    "Guest"
                  ],
                  "post": [
                    "Guest",
                    "Tokenization"
                  ],
                  "delete": [
                    "Tokenization"
                  ]
                }
              ]
            }
          },
          "_TTL": 86400000
        },
        {
          "code": "TPROD_EXAMPLE03",
          "name": "example03 package",
          "description": "this is a description for test product example03 package",
          "acl": {
            "dashboard": {
              "urac": [
                {
                  "version": "2",
                  "post": [
                    "Guest Password Settings"
                  ],
                  "get": [
                    "Guest Password Settings",
                    "Guest Email Validation"
                  ]
                }
              ]
            }
          },
          "_TTL": 86400000
        }
      ]
    },
    {
      "_id": "5d7762264305c302f032b24c",
      "code": "TEST2",
      "name": "Test 2 Product",
      "description": "this is a description for test 2 product",
      "console": false,
      "packages": [
        {
          "code": "TEST2_NEWS",
          "name": "news package",
          "description": "this is a description for test 2 product news package",
          "acl": {
            "dashboard": {
              "oauth": [
                {
                  "version": "1",
                  "get": [
                    "Guest"
                  ],
                  "post": [
                    "Guest",
                    "Tokenization"
                  ],
                  "delete": [
                    "Tokenization"
                  ]
                }
              ]
            }
          },
          "_TTL": 86400000
        },
        {
          "code": "TEST2_NEW",
          "name": "new package",
          "description": "this is a description for test 2 product new package",
          "acl": {
            "dashboard": {
              "urac": [
                {
                  "version": "2",
                  "post": [
                    "Guest Password Settings"
                  ],
                  "get": [
                    "Guest Password Settings",
                    "Guest Email Validation"
                  ]
                }
              ]
            }
          },
          "_TTL": 86400000
        }
      ]
    }
  ]
}


Invalid Response

Code Block
languagejs
titleError Response Sample
{
    "result":false,
    "errors":{
        "codes":[460602],
        "details":[
            {
                "code":460602,
                "message":"UnableModel toerror: find+ products%model_error%"
            }
        ]
    }
}



Error Codes



Code
Description
460
Unable to find products
602
Model error: + %model_error%


Example (CURL)

...

Request

Code Block
languagebash
titleCalling List Products API
 > CURL -X GET http://127.0.0.1:4004/products

...