New SectionURL NameBayReviews-API-A-Detailed-RundownTitleBayReviews API - A Detailed RundownOwnerDanielleArticle DetailsContentHelp Content Application Programming Interface (API) is a collection of procedures enabling developers to create applications and software components that communicate and transfer data, resulting in powerful and secure user applications. Types of API: Private: Private APIs connect different software components within a single organization. Public: Public APIs provide access to third-party developers. Partner: Partner APIs enable collaboration between two or more companies for data and functionality sharing. How to generate a Public API in BayReviews 1. Log into TargetBay’s app by entering the correct credentials. (To access TargetBay’s app store https://app.targetbay.com/) 2. Once you're on the TargetBay dashboard, Click on the "Settings" icon located in the top right corner of the screen. 3. In the "Settings" menu, Navigate to the “Tools” sections. Click on "API Keys" to access API key settings. 4. Under the "Public API" section, select both the "read" and "write" options, then click the "Update" button to generate the API token. (Note: Once the API token is generated copy the token) Here is the basic information on BayReviews APIs Retrieve all product reviews from BayReviews Product reviews will be retrieved from the BayReviews based on the filters 1. Get all Product Review Endpoint: GET https://api.targetbay.com/v1/review/product-review Place the generated token under Authorization > Bearer Token > API Token HEADER PARAMETERS Public key(required) String: example tuO6nQVILz26Rl9a9a32dxxxxxxxx REQUEST BODY SCHEMA: application/JSON Offset integer (optional) Limit integer (optional) Note: max 50 and default 10 Sort string (optional) Example: { "offset": 0, "limit": 1 "sort": { "score": " desc" } Responses 200 Successful operation 400 Error 2. Get all Product Review for a specified product Endpoint: GET https://api.targetbay.com/v1/}review/product-review/product/231 Place the generated token under Authorization > Bearer Token > API Token HEADER PARAMETERS Public key(required) String: example tuO6nQVILz26Rl9a9a32dxxxxxxxx REQUEST BODY SCHEMA: application/JSON Offset integer (optional) Limit integer (optional) Note: max 50 and default 10 Sort string (optional) Score string (asc or desc) Example: { "offset": 0, "limit": 10 , "sort": { "score": "desc" } } Responses 200 Successful operation 400 Error 3. Fetch average star ratings and total review count for the product specified. Endpoint: POST https://api.targetbay.com/v1/review/product-review/aggregation Place the generated token under Authorization > Bearer Token > API Token HEADER PARAMETERS Public key(required) String: example tuO6nQVILz26Rl9a9a32dxxxxxxxx REQUEST BODY SCHEMA: application/JSON product_id integer (mandatory) Example: { "product_ids" : [ 294, 298, 263, 282, 252, 258, 276, 209 ] } Responses 200 Successful operation 400 Error HEADER PARAMETERS Public key(required) String: example tuO6nQVILz26Rl9a9a32dxxxxxxxx REQUEST BODY SCHEMA: application/JSON Product_id integer (mandatory) user_id integer (Optional) user_name string (mandatory) user_email string (mandatory) review_rating integer (mandatory) review_title String (optional based review setting) review string (mandatory) ip_address string (optional) Example: { "product_id": 456, "user_id": 123412345, "user_name": "abc", "user_email": "xyz@domain.com", "review_rating": 4, "review_title": "title", "review": "title", "ip_address": "123.45.6.XXX" } Responses 200 Successful operation 400 Error HEADER PARAMETERS Public key(required) String: example tuO6nQVILz26Rl9a9a32dxxxxxxxx REQUEST BODY SCHEMA: application/JSON user_id integer (mandatory) “vote” string (mandatory) Example: { "user_id": 9876543210, "vote": "up" } Responses 200 Successful operation 400 Error Retrieve all Q&A from BayReviews Q&A will be retrieved from the BayReviews based on the filters. Get all Q&A Endpoint: GET https://api.targetbay.com/v1/review/qa Place the generated token under Authorization > Bearer Token > API Token HEADER PARAMETERS Public key(required) String: example tuO6nQVILz26Rl9a9a32dxxxxxxxx REQUEST BODY SCHEMA: application/JSON Offset integer (optional) Limit integer (optional) Note: max 50 and default 10 Sort string (optional) Example: { "offset": 0, "limit": 1 "sort": { "score": " desc" } Responses 200 Successful operation 400 Error 2. Get all Q&A for specified products Endpoint: GET https://api.targetbay.com/v1/review/qa/product/(product id) Place the generated token under Authorization > Bearer Token > API Token HEADER PARAMETERS Public key(required) String: example tuO6nQVILz26Rl9a9a32dxxxxxxxx REQUEST BODY SCHEMA: application/JSON Offset integer (optional) Limit integer (optional) Note: max 50 and default 10 Sort string (optional) Score string (asc or desc) Example: { "offset": 0, "limit": 1 "sort": { "score": " desc" } Responses 200 Successful operation 400 Error HEADER PARAMETERS Public key(required) String: example tuO6nQVILz26Rl9a9a32dxxxxxxxx REQUEST BODY SCHEMA: application/JSON product_id integer (mandatory) user_id integer (Optional) user_name string (mandatory) user_email string (mandatory) questions string (mandatory) Example: { "product_id": 231, "user_id": 123412345, "user_name": "abc", "user_email": "xyz@domain.com", "questions": "quality" } Responses 200 Successful operation 400 Error HEADER PARAMETERS Public key(required) String: example tuO6nQVILz26Rl9a9a32dxxxxxxxx REQUEST BODY SCHEMA: application/JSON answer integer (mandatory) Example: { "answer": "nice" } Responses 200 Successful operation 400 Error HEADER PARAMETERS Public key(required) String: example tuO6nQVILz26Rl9a9a32dxxxxxxxx REQUEST BODY SCHEMA: application/JSON user_id integer (mandatory) answer_index integer (mandatory) vote string (mandatory) Note: only up, down Example: { "user_id": 12341234, "answer_index": 0, "vote": "up" } Responses 200 Successful operation 400 Error