{ "parameters": { "productReviewID": { "name": "productReviewID", "in": "query", "description": "Unique ID for the record. Required when viewing, editing or deleting a ProductReview.", "required": true, "type": "integer" }, "productCode": { "name": "productCode", "in": "query", "description": "Unique code for the parent Product of the ProductReview. This or the productID is required when adding a ProductReview.", "required": false, "type": "string" }, "productIDViewEditOrAdd": { "name": "productID", "in": "query", "description": "The parent productID. This or the productCode is required when adding a ProductReview.", "required": false, "type": "integer" }, "productIDList": { "name": "productID", "in": "query", "description": "The parent productID. The resulting list is retricted to ProductReviews assigned to this Product.", "required": false, "type": "integer" } }, "paths": { "/productReview": { "get": { "summary": "ProductReview View", "description": "View the details of a ProductReview record.", "tags": [ "Administrative Operations" ], "parameters": [ { "$ref": "#/parameters/productReviewID" }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "ProductReview object", "schema": { "$ref": "#/definitions/WrappedProductReview" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } }, "delete": { "summary": "ProductReview Delete", "description": "Delete a ProductReview record.", "tags": [ "Administrative Operations" ], "parameters": [ { "$ref": "#/parameters/productReviewID" }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/WrappedProductReview" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } }, "patch": { "summary": "ProductReview Edit", "description": "Edits a ProductReview record.", "tags": [ "Administrative Operations" ], "parameters": [ { "name": "productReview", "in": "body", "description": "The productReview to be edited. The productReviewID must be provided.", "required": true, "schema": { "$ref": "#/definitions/ProductReview" } }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "ProductReview object", "schema": { "$ref": "#/definitions/WrappedProductReview" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } }, "post": { "summary": "ProductReview Add", "description": "Adds a ProductReview record.", "tags": [ "Administrative Operations" ], "parameters": [ { "name": "productReview", "in": "body", "description": "The productReview to be added. The parent productID or productCode must be provided.", "required": true, "schema": { "$ref": "#/definitions/NewProductReview" } }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "ProductReview object", "schema": { "$ref": "#/definitions/WrappedProductReview" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } } }, "/productReview/list": { "get": { "summary": "ProductReview List", "description": "View a list of ProductReviews.", "tags": [ "Administrative Operations" ], "parameters": [ { "$ref": "../swagger-spec.json#/parameters/itemsPerPage" }, { "$ref": "../swagger-spec.json#/parameters/firstRow" }, { "$ref": "../swagger-spec.json#/parameters/sortByString" }, { "$ref": "../swagger-spec.json#/parameters/sortAscOrDesc" }, { "$ref": "../swagger-spec.json#/parameters/searchString" }, { "$ref": "#/parameters/productIDList" }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "ProductReview List", "schema": { "$ref": "#/definitions/WrappedProductReviewList" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } } } }, "definitions": { "BaseProductReview": { "type": "object", "properties": { "status": { "name": "The status of this ProductReview. 0=Not Approved and 1=Approved.", "type": "integer" }, "nickname": { "description": "The nickname of the user submitting this ProductReview.", "type": "string", "maxLength": 255 }, "firstName": { "description": "The first name of the user submitting this ProductReview.", "type": "string", "maxLength": 255 }, "lastName": { "description": "The last name of the user submitting this ProductReview.", "type": "string", "maxLength": 255 }, "email": { "description": "The email of the user submitting this ProductReview.", "type": "string", "maxLength": 255 }, "age": { "description": "The age of the user submitting this ProductReview.", "type": "string", "maxLength": 255 }, "city": { "description": "The city of the user submitting this ProductReview.", "type": "string", "maxLength": 255 }, "state": { "description": "The state of the user submitting this ProductReview.", "type": "string", "maxLength": 255 }, "country": { "description": "The country of the user submitting this ProductReview.", "type": "string", "maxLength": 255 }, "imagePath": { "description": "The path to the image submitted with the ProductReview.", "type": "string", "maxLength": 255 }, "ipAddress": { "description": "The IP address of the user submitting the ProductReview.", "type": "string", "maxLength": 255 }, "review": { "description": "The text of the ProductReview.", "type": "string" }, "rating": { "description": "The user's rating, from 1 to 5.", "type": "integer" }, "created": { "description": "The date the ProductReview was created.", "type": "string", "maxLength": 255 }, "customerID": { "description": "The customerID of the customer submitting the review.", "type": "integer" } } }, "NewProductReview": { "type": "object", "allOf": [ { "properties": { "productCode": { "type": "string", "description": "Unique code for the parent product of the ProductReview. This or the productID is required." }, "productID": { "type": "string", "description": "Unique identifier for the parent product of the ProductReview. This or the productCode is required." } } }, { "$ref": "#/definitions/BaseProductReview" } ] }, "ProductReview": { "type": "object", "allOf": [ { "required": [ "productReviewID" ], "properties": { "productReviewID": { "type": "integer", "description": "Unique identifier representing a specific ProductReview." }, "productID": { "type": "string", "description": "Unique identifier for the parent product of the ProductReview." } } }, { "$ref": "#/definitions/BaseProductReview" } ] }, "WrappedProductReview": { "type": "object", "properties": { "success": { "type": "boolean" }, "errors": { "type": "array", "items": { "type": "string" } }, "messages": { "type": "array", "items": { "type": "string" } }, "jsonResult": { "type": "object", "$ref": "#/definitions/ProductReview" } } }, "WrappedProductReviewList": { "type": "object", "properties": { "success": { "type": "boolean" }, "errors": { "type": "array", "items": { "type": "string" } }, "messages": { "type": "array", "items": { "type": "string" } }, "jsonResult": { "type": "object", "properties": { "itemCollection": { "type": "array", "description": "The list of items being requested that match the criteria, limited to the number of itemsPerPage.", "items": { "$ref": "#/definitions/ProductReview" } }, "itemCount": { "description": "The total number of items matching the criteria. This value may used to compose paging parameters.", "type": "integer" } } } } } } }