### Get Top Rated Product (PHP) Source: https://github.com/sitejabber/business-api-docs/blob/main/source/includes/endpoints/_get-top-rated-product.md Retrieves the top-rated product using PHP with cURL. This example demonstrates setting up the request headers, URL with query parameters, and handling the response. It requires user and client tokens. ```php ``` -------------------------------- ### GET /v1/businesses/{domain}/products Source: https://github.com/sitejabber/business-api-docs/blob/main/source/includes/endpoints/_get-products.md Retrieves a list of products for a given business domain. Supports filtering by various product attributes. ```APIDOC ## GET /v1/businesses/{domain}/products ### Description Retrieves all products associated with a specific business domain. This endpoint supports various query parameters to filter and paginate the results. ### Method GET ### Endpoint `https://api.sitejabber.com/v1/businesses/yourdomain.com/products` ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name of the business. #### Query Parameters - **user_token** (string) - Required - Authentication token for the user. - **client_token** (string) - Required - API key for client authentication. - **start** (integer) - Optional - The starting offset for pagination. Defaults to 0. - **count** (integer) - Optional - The number of products to retrieve per page. Defaults to 10, maximum is 100. - **q** (string) - Optional - Keyword to filter products by title or description. - **sku** (string) - Optional - Filter products by Stock Keeping Unit (SKU). - **gtin** (string) - Optional - Filter products by Global Trade Item Number (GTIN). - **mpn** (string) - Optional - Filter products by Manufacturer Part Number (MPN). - **brand** (string) - Optional - Filter products by brand name. - **categories** (string) - Optional - Filter products by category. (e.g., "Gaming,Electronics") - **price_range** (string) - Optional - Filter products by price range. Format: `[min],[max]` (e.g., "10,50"). - **reviews_range** (string) - Optional - Filter products by the number of reviews. Format: `[min],[max]` (e.g., "50,100"). - **product_id** (integer) - Optional - Filter products by their unique product ID. ### Request Example ```shell curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" \ https://api.sitejabber.com/v1/businesses/yourdomain.com/products?client_token=myapikey&count=20&brand=Nintendo ``` ### Response #### Success Response (200) - **products** (array) - An array of Product Objects. - **count** (integer) - The total number of products returned in this request. - **start** (integer) - The starting offset of the returned products. - **query** (string|null) - The query parameters used for the request. - **status** (string) - The status of the response, e.g., "OK". - **success** (boolean) - Indicates if the request was successful. ##### Product Object Structure - **id** (integer) - Unique identifier for the product. - **sku** (string) - Stock Keeping Unit. - **item_group** (string) - Identifier for product grouping. - **gtin** (string|null) - Global Trade Item Number. - **mpn** (string|null) - Manufacturer Part Number. - **brand** (string) - Brand name of the product. - **title** (string) - Title or name of the product. - **description** (string|null) - Description of the product. - **categories** (array) - An array of category objects. - **category_name** (string) - Name of the category. - **price** (number) - Current price of the product. - **retail_price** (number|null) - Retail price of the product. - **currency** (string) - Currency of the price (e.g., "USD"). - **product_link** (string) - URL to the product page. - **images** (array) - An array of image objects. - **url** (string) - URL of the product image. - **attributes** (array) - An array of product attributes. - **num_reviews** (integer) - Number of reviews for the product. - **average_rating** (number) - Average rating of the product. - **created** (string) - Date and time the product was created (YYYY/MM/DD HH:MM:SS). - **createdRFC** (string) - Date and time the product was created in RFC format. #### Response Example ```json { "products": [ { "id": 26, "sku": "4770", "item_group": "4770_group", "gtin": null, "mpn": null, "brand": "Nintendo", "title": "Nintendo Switch Super Mario Bundle", "description": null, "categories": [ { "category_name": "Gaming" } ], "price": 529, "retail_price": null, "currency": "USD", "product_link": "https://xyz.xyz/ProductDetail/4770", "images": [ { "url": "https://xyz.xyz/img/4770.jpg" } ], "attributes": [], "num_reviews": 26, "average_rating": 4.54, "created": "2018/07/13 01:18:35", "createdRFC": "2018/07/13T01:18:35-07:00" } ], "count": 10, "start": 0, "query": null, "status": "OK", "success": true } ``` ``` -------------------------------- ### Get Products Source: https://github.com/sitejabber/business-api-docs/blob/main/source/index.html.md Retrieves a list of products associated with a business. ```APIDOC ## GET /businesses/{business_id}/products ### Description Fetches a list of products listed by a specific business. ### Method GET ### Endpoint /businesses/{business_id}/products ### Parameters #### Path Parameters - **business_id** (string) - Required - The unique identifier for the business. ### Response #### Success Response (200) - An array of product objects, each containing product_id, name, description, and price. #### Response Example ```json [ { "product_id": "prod_111", "name": "Premium Widget", "description": "A high-quality widget for all your needs.", "price": 49.99 }, { "product_id": "prod_222", "name": "Basic Gadget", "description": "An affordable gadget for everyday use.", "price": 19.99 } ] ``` ``` -------------------------------- ### Get Product Reviews using Shell Source: https://github.com/sitejabber/business-api-docs/blob/main/source/includes/endpoints/_get-product-reviews.md This snippet demonstrates how to fetch product reviews from the Sitejabber API using a cURL command in a shell environment. It includes the necessary headers for authentication and the API endpoint URL. ```shell curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" https://api.sitejabber.com/v1/businesses/yourdomain.com/product/reviews?client_token=myapikey ``` -------------------------------- ### Get Product Reviews using PHP Source: https://github.com/sitejabber/business-api-docs/blob/main/build/index.html This PHP script shows how to fetch product reviews from the Sitejabber API. It utilizes cURL to make the HTTP GET request, including the necessary user token in the headers and the client token as a query parameter. The response is returned as a string. ```php ``` -------------------------------- ### POST /v1/businesses/{yourdomain.com}/products/add Source: https://github.com/sitejabber/business-api-docs/blob/main/build/index.html Adds a new product to the business's catalog. Requires product details such as SKU, brand, title, categories, and price. ```APIDOC ## POST /v1/businesses/{yourdomain.com}/products/add ### Description Adds a new product to the business's catalog. Requires product details such as SKU, brand, title, categories, and price. ### Method POST ### Endpoint `https://api.sitejabber.com/v1/businesses/yourdomain.com/products/add` ### Parameters #### Query Parameters - **client_token** (string) - Required - Your API client token. #### Request Body - **sku** (string) - Required - The product's Stock Keeping Unit. - **brand** (string) - Required - The brand of the product. - **title** (string) - Required - The title of the product. - **categories** (string) - Required - A comma-separated list of categories for the product. - **price** (float) - Required - The price of the product. - **attributes** (string) - Optional - Product attributes in a key:value|key:value format (e.g., "pros:usability,automatic|cons:slow,big"). ### Request Example ``` curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" \ -d "sku=4476&brand=sony&title=playstation&categories=games,ps3&price=129&attributes=pros:usability,automatic,control|cons:slow,big|user experience:novice,expert" \ https://api.sitejabber.com/v1/businesses/yourdomain.com/products/add?client_token=myapikey ``` ### Response #### Success Response (200) Typically returns a success message or the added product details. The exact structure may vary. #### Response Example ```json { "status": "OK", "success": true, "message": "Product added successfully." } ``` ``` -------------------------------- ### Get Messages (PHP) Source: https://github.com/sitejabber/business-api-docs/blob/main/source/includes/endpoints/_get-messages.md PHP code example using cURL to fetch messages from the Sitejabber API. This demonstrates setting headers and making the GET request. ```php ``` -------------------------------- ### Get Messages (Shell) Source: https://github.com/sitejabber/business-api-docs/blob/main/source/includes/endpoints/_get-messages.md Example of how to retrieve messages for a business using a cURL command. Requires user_token, business domain, client_token, and username. ```shell curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" "https://api.sitejabber.com/v1/businesses/yourdomain.com/messages?client_token=myapikey&username=user" ``` -------------------------------- ### Add Product using PHP Source: https://github.com/sitejabber/business-api-docs/blob/main/build/index.html Adds a new product using PHP. This example demonstrates how to set up the request with headers, POST data, and execute it via cURL. ```php '4476', 'brand' => 'sony', 'title' => 'playstation', 'categories' => 'games,ps3', 'price' => '129', 'attributes' => 'pros:usability,automatic,control|cons:slow,big|user experience:novice,expert' ]; $url = 'https://api.sitejabber.com/v1/businesses/yourdomain.com/products/add?client_token=myapikey'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); $res = curl_exec($ch); curl_close($ch); ``` -------------------------------- ### Add Product Source: https://github.com/sitejabber/business-api-docs/blob/main/source/index.html.md Adds a new product listing for a business. ```APIDOC ## POST /businesses/{business_id}/products ### Description Adds a new product to a business's product listings. ### Method POST ### Endpoint /businesses/{business_id}/products ### Parameters #### Path Parameters - **business_id** (string) - Required - The unique identifier for the business. #### Request Body - **name** (string) - Required - The name of the product. - **description** (string) - Optional - A description of the product. - **price** (number) - Required - The price of the product. ### Request Example ```json { "name": "New Gizmo", "description": "The latest innovation in gadget technology.", "price": 79.95 } ``` ### Response #### Success Response (200) - A confirmation message and the details of the newly added product. #### Response Example ```json { "message": "Product added successfully.", "product_id": "prod_333", "name": "New Gizmo", "description": "The latest innovation in gadget technology.", "price": 79.95 } ``` ``` -------------------------------- ### Message Response Structure (JSON) Source: https://github.com/sitejabber/business-api-docs/blob/main/source/includes/endpoints/_get-messages.md The expected JSON structure for a successful response when retrieving messages. It includes an array of message objects, count, start, status, and success flag. ```json { "messages":[ { "subject": "Re: Business - 348289THX", "body": "My new message4", "review": null, "created": "2017/07/10 12:45:44", "createdRFC": "2017/07/10T12:45:44-07:00", "recipient": { "username": "user123", "firstName": "John", "lastName": "D", "thumbnail": "default_profile_photo.png", "profilePage": "https://www.sitejabber.com/users/user123", "numReviews": 0, "numHelpfulVotes": 1 }, "sender": { "username": "user3", "firstName": "John", "lastName": "F", "thumbnail": "default_profile_photo.png", "profilePage": "https://www.sitejabber.com/users/user3", "numReviews": 0, "numHelpfulVotes": 1 } }, { "subject": "Re: Business - 348289THX", "body": "My new message3", "review": null, "created": "2017/07/07 02:31:44", "createdRFC": "2017/07/07T02:31:44-07:00", "recipient": { "username": "user123", "firstName": "John", "lastName": "D", "thumbnail": "default_profile_photo.png", "profilePage": "https://www.sitejabber.com/users/user123", "numReviews": 0, "numHelpfulVotes": 1 }, "sender": { "username": "user3", "firstName": "John", "lastName": "F", "thumbnail": "default_profile_photo.png", "profilePage": "https://www.sitejabber.com/users/user3", "numReviews": 0, "numHelpfulVotes": 1 } }, { "subject": "Re: Business - 348289THX", "body": "My new message2", "review": null, "created": "2017/07/05 11:07:31", "createdRFC": "2017/07/05T11:07:31-07:00", "recipient": { "username": "user123", "firstName": "John", "lastName": "D", "thumbnail": "default_profile_photo.png", "profilePage": "https://www.sitejabber.com/users/user123", "numReviews": 0, "numHelpfulVotes": 1 }, "sender":{ "username": "user3", "firstName": "John", "lastName": "F", "thumbnail": "default_profile_photo.png", "profilePage": "https://www.sitejabber.com/users/user3", "numReviews": 0, "numHelpfulVotes": 1 } }, { "subject": "Business - 348289THX", "body": "My new message1", "review": { "reviewNo": 3, "rating": [ { "type": "overall", "rating": 2 }, { "type": "service", "rating": null }, { "type": "value", "rating": null }, { "type": "shipping", "rating": null }, { "type": "returns", "rating": null }, { "type": "quality", "rating": null } ], "title": "Dissapointed", "content": "Dissapointed.", "tip": null, "order_id": "348289THX", "published": "2017/01/04 03:35:20", "publishedRFC": "2017/01/04T03:35:20-07:00", "edited": "", "author": { "username": "user123", "firstName": "John", "lastName": "D", "thumbnail": "default_profile_photo.png", "profilePage": "https://www.sitejabber.com/users/user123", "numReviews": 0, "numHelpfulVotes": 1 } }, "created": "2017/06/30 02:57:59", "createdRFC": "2017/06/30T02:57:59-07:00", "recipient": { "username": "user123", "firstName": "John", "lastName": "D", "thumbnail": "default_profile_photo.png", "profilePage": "https://www.sitejabber.com/users/user123", "numReviews": 0, "numHelpfulVotes": 1 }, "sender":{ "username": "user3", "firstName": "John", "lastName": "F", "thumbnail": "default_profile_photo.png", "profilePage": "https://www.sitejabber.com/users/user3", "numReviews": 0, "numHelpfulVotes": 1 } } ], "count":4, "start":0, "status":"OK", "success":true } ``` -------------------------------- ### Retrieve All Reviews (GET Request) Source: https://github.com/sitejabber/business-api-docs/blob/main/build/index.html Fetches all reviews for a business. Supports pagination, keyword search, label filtering, date range filtering, and sorting. Dependencies: None. Outputs a JSON array of review objects. ```HTTP GET https://api.sitejabber.com/v1/businesses/yourdomain.com/reviews?start=0&count=10&q=keyword&labels=label1,label2&date_from=yyyy-mm-dd%20hh:mm:ss&date_to=yyyy-mm-dd%20hh:mm:ss&unpublished=1&updated=1&deleted=1&solicited=1&datasources=source1,source2&order=ASC ``` -------------------------------- ### API Response Structure (JSON) Source: https://github.com/sitejabber/business-api-docs/blob/main/source/includes/endpoints/_get-info-for-several-businesses.md This is an example of the JSON structure returned by the Sitejabber Business API when requesting information for multiple businesses. It contains an array of 'urls', where each object represents a business with its details, ratings, and review counts. ```json { "urls":[ { "name":"Business1", "urlAddress":"http:\/\/business1.com", "displayAddress":"business1.com", "urlProfilePage":"https:\/\/www.sitejabber.com\/reviews\/www.business1.com", "averageRating":[ { "type":"overall", "rating":1.85 }, { "type":"service", "rating":1.64 }, { "type":"value", "rating":1.89 }, { "type":"shipping", "rating":2.21 }, { "type":"returns", "rating":1.55 }, { "type":"quality", "rating":2 } ], "numReviews":[ { "type":"total", "rating":1088 }, { "type":"fiveStars", "rating":146 }, { "type":"fourStars", "rating":35 }, { "type":"threeStars", "rating":21 }, { "type":"twoStars", "rating":58 }, { "type":"oneStar", "rating":828 } ], "phone":"", "email":"", "address":{ "streetAddress":"FakeStreet", "streetAddress2":"", "city":"FakeCity", "state":"CA", "postalCode":"", "country":"USA", "completeAddress":"FakeCity, CA, USA" } }, { "name":"Business2", "urlAddress":"http:\/\/business2.com", "displayAddress":"business2.com", "urlProfilePage":"https:\/\/www.sitejabber.com\/reviews\/www.business2.com", "averageRating":[ { "type":"overall", "rating":4.15 }, { "type":"service", "rating":4.26 }, { "type":"value", "rating":4.11 }, { "type":"shipping", "rating":4.22 }, { "type":"returns", "rating":4.19 }, { "type":"quality", "rating":4.34 } ], "numReviews":[ { "type":"total", "rating":807 }, { "type":"fiveStars", "rating":514 }, { "type":"fourStars", "rating":147 }, { "type":"threeStars", "rating":33 }, { "type":"twoStars", "rating":38 }, { "type":"oneStar", "rating":75 } ], "phone":"", "email":"support@business2.com", "address":{ "streetAddress":"FakeStreet", "streetAddress2":"", "city":"FakeCity", "state":"CA", "postalCode":"94403", "country":"USA", "completeAddress":"FakeCity, CA 94403, USA" } }, { "name":"Business3", "urlAddress":"http:\/\/business3.com", "displayAddress":"business3.com", "urlProfilePage":"https:\/\/www.sitejabber.com\/reviews\/www.business3.com", "averageRating":[ { "type":"overall", "rating":3.46 }, { "type":"service", "rating":3.16 }, { "type":"value", "rating":2.48 }, { "type":"shipping", "rating":2.76 } ``` -------------------------------- ### Get Products using PHP Source: https://github.com/sitejabber/business-api-docs/blob/main/build/index.html Retrieves a list of products associated with a business using PHP. It sets the necessary headers and options for the cURL request. ```php ``` -------------------------------- ### Add Product using cURL Source: https://github.com/sitejabber/business-api-docs/blob/main/build/index.html Adds a new product to the business profile. Requires a user token and provides product details such as SKU, brand, title, categories, price, and attributes. ```shell curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" -d "sku=4476&brand=sony&title=playstation&categories=games,ps3&price=129&attributes=pros:usability,automatic,control|cons:slow,big|user %20experience:novice,expert" https://api.sitejabber.com/v1/businesses/yourdomain.com/products/add?client_token=myapikey ``` -------------------------------- ### Get Business Reviews (cURL) Source: https://github.com/sitejabber/business-api-docs/blob/main/source/includes/endpoints/_get-reviews-of-a-business.md This cURL command demonstrates how to make an authenticated GET request to the Sitejabber API to retrieve reviews for a given business. It requires a user token for authentication and a client token for API access. The response is a JSON array of review objects. ```shell curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" "https://api.sitejabber.com/v1/businesses/yourdomain.com/reviews?client_token=myapikey" ``` -------------------------------- ### Get Products using cURL Source: https://github.com/sitejabber/business-api-docs/blob/main/build/index.html Retrieves a list of products associated with a business. Requires a user token for authentication. Supports filtering via query parameters. ```shell curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" https://api.sitejabber.com/v1/businesses/yourdomain.com/products?client_token=myapikey ``` -------------------------------- ### Product Object Source: https://github.com/sitejabber/business-api-docs/blob/main/source/includes/_intro.md Defines the structure of a product object, including its details and reviews. ```APIDOC ## Product Object ### Description Represents a product with its attributes, pricing, and review summary. ### Fields - **id** (Integer) - No - Internal product ID - **sku** (String) - No - SKU of the product - **item_group** (String) - Yes - Used to group similar products together - **gtin** (String) - Yes - GTIN of the product - **mpn** (String) - Yes - MPN of the product - **brand** (String) - Yes - Brand of the product - **title** (String) - Yes - Title of the product - **description** (String) - Yes - Description of the product - **categories** (ProductCategory object) - Yes - Product categories - **price** (Float) - Yes - Price of the product - **retail_price** (Float) - Yes - Retail price of the product - **currency** (String) - Yes - Currency of the product - **product_link** (String) - Yes - Url link to the product's page - **images** (ProductImage object) - Yes - Product images - **attributes** (ProductAttribute object) - Yes - Customer attributes - **num_reviews** (Integer) - No - Number of product reviews - **average_rating** (Float) - No - Average rating of the product reviews - **created** (DateTime) - No - Creation date of the product - **createdRFC** (DateTime) - No - Same as created but in format RFC 3339 ``` -------------------------------- ### GET /v1/businesses/{domain} Source: https://github.com/sitejabber/business-api-docs/blob/main/source/includes/endpoints/_get-info-for-a-given-business.md Retrieves detailed information for a specific business identified by its domain name. ```APIDOC ## GET /v1/businesses/{domain} ### Description This endpoint retrieves detailed information for a specific business, identified by its domain name. ### Method GET ### Endpoint `https://api.sitejabber.com/v1/businesses/{domain}` ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name of the business (e.g., `yourdomain.com`). #### Query Parameters - **client_token** (string) - Required - Your API client token. - **user_token** (string) - Required - Your API user token. - **datasources** (boolean) - Optional - Set to `true` to include ratings from specified comma-separated data sources (refer to the data sources section for available options). ### Request Example ```shell curl -H "user_token: YOUR_USER_TOKEN" "https://api.sitejabber.com/v1/businesses/yourdomain.com?client_token=YOUR_CLIENT_TOKEN" ``` ### Response #### Success Response (200) - **name** (string) - The name of the business. - **urlAddress** (string) - The primary URL address of the business. - **displayAddress** (string) - The display version of the business URL. - **urlProfilePage** (string) - A URL to the business's profile page on Sitejabber. - **averageRating** (array) - An array of objects, each containing a rating type (e.g., 'overall', 'service') and its corresponding rating value. - **numReviews** (array) - An array of objects, each containing a review count type (e.g., 'total', 'oneStar') and its corresponding count. - **phone** (string) - The business's phone number. - **email** (string) - The business's email address. - **address** (object) - An object containing the business's address details (streetAddress, city, state, postalCode, country, completeAddress). - **status** (string) - The status of the API request (e.g., "OK"). - **success** (boolean) - Indicates whether the request was successful. #### Response Example ```json { "name":"Business Name", "urlAddress":"http://yourdomain.com", "displayAddress":"yourdomain.com", "urlProfilePage":"https://www.sitejabber.com/reviews/www.yourdomain.com", "averageRating": [ { "type":"overall", "rating":4.5 } ], "numReviews": [ { "type":"total", "rating":100 } ], "phone":"", "email":"", "address":{ "streetAddress":"FakeStreet", "streetAddress2":"", "city":"FakeCity", "state":"CA", "postalCode":"", "country":"USA", "completeAddress":"FakeCity, CA, USA" }, "status":"OK", "success":true } ``` ``` -------------------------------- ### Create Product Review Request Source: https://github.com/sitejabber/business-api-docs/blob/main/source/index.html.md Initiates a request for a customer to review a purchased product. ```APIDOC ## POST /products/{product_id}/review_requests ### Description Creates a request to ask a customer to review a specific product they purchased. ### Method POST ### Endpoint /products/{product_id}/review_requests ### Parameters #### Path Parameters - **product_id** (string) - Required - The unique identifier for the product. #### Request Body - **customer_email** (string) - Required - The email address of the customer. - **order_id** (string) - Optional - Identifier for the customer's order. ### Request Example ```json { "customer_email": "customer@email.com", ``` -------------------------------- ### Get Business Info (PHP) Source: https://github.com/sitejabber/business-api-docs/blob/main/source/includes/endpoints/_get-info-for-several-businesses.md This PHP script demonstrates how to make a request to the Sitejabber Business API to retrieve information for multiple businesses. It uses cURL to send a GET request with the necessary authentication and authorization tokens, and a JSON-encoded array of business domain names. ```php ``` -------------------------------- ### Retrieve Business Messages via HTTP GET Source: https://github.com/sitejabber/business-api-docs/blob/main/source/includes/endpoints/_get-messages.md This snippet demonstrates how to make an HTTP GET request to the Sitejabber API to retrieve messages for a specific domain. It highlights the base URL and the need to replace 'yourdomain.com' with the actual domain. The request can be augmented with query parameters to filter and sort the results. ```HTTP GET https://api.sitejabber.com/v1/businesses/yourdomain.com/messages ``` -------------------------------- ### GET /v1/businesses/{domain}/messages Source: https://github.com/sitejabber/business-api-docs/blob/main/source/includes/endpoints/_get-messages.md Retrieves messages associated with a specific business domain. Requires user and client tokens for authentication. ```APIDOC ## Get messages ### Description Retrieves messages associated with a specific business domain. This endpoint requires authentication via `user_token` and `client_token`. ### Method GET ### Endpoint `/v1/businesses/{domain}/messages` ### Parameters #### Path Parameters - **domain** (string) - Required - The domain name of the business to retrieve messages for. #### Query Parameters - **client_token** (string) - Required - Your API key for authentication. - **username** (string) - Required - The username of the recipient for filtering messages. #### Headers - **user_token** (string) - Required - Your user token for authentication. ### Request Example ```shell curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" "https://api.sitejabber.com/v1/businesses/yourdomain.com/messages?client_token=myapikey&username=user" ``` ### Response #### Success Response (200) Returns a JSON object containing a list of messages, total count, and status information. - **messages** (array) - An array of message objects. - **subject** (string) - The subject of the message. - **body** (string) - The content of the message. - **review** (object | null) - Associated review object if available. - **created** (string) - The creation date and time of the message. - **createdRFC** (string) - The creation date and time in RFC format. - **recipient** (object) - Information about the message recipient. - **sender** (object) - Information about the message sender. - **count** (integer) - The number of messages returned in this response. - **start** (integer) - The starting index for pagination. - **status** (string) - The status of the request (e.g., "OK"). - **success** (boolean) - Indicates if the request was successful. #### Response Example ```json { "messages":[ { "subject": "Re: Business - 348289THX", "body": "My new message4", "review": null, "created": "2017\/07\/10 12:45:44", "createdRFC": "2017\/07\/10T12:45:44-07:00", "recipient": { "username": "user123", "firstName": "John", "lastName": "D", "thumbnail": "default_profile_photo.png", "profilePage": "https://www.sitejabber.com/users/user123", "numReviews": 0, "numHelpfulVotes": 1 }, "sender": { "username": "user3", "firstName": "John", "lastName": "F", "thumbnail": "default_profile_photo.png", "profilePage": "https://www.sitejabber.com/users/user3", "numReviews": 0, "numHelpfulVotes": 1 } } ], "count":4, "start":0, "status":"OK", "success":true } ``` ``` -------------------------------- ### ProductImage Object Source: https://github.com/sitejabber/business-api-docs/blob/main/source/includes/_intro.md Defines the structure for product images, including URLs for different sizes. ```APIDOC ## ProductImage Object ### Description Represents an image associated with a product, with different size variants. ### Fields - **caption** (String) - No - Caption of the image - **original** (String) - No - Url of the image original size - **normal** (String) - No - Url of the image normal size, max width 600px - **large** (String) - No - Url of the image thumbnail large size 160x160 - **small** (String) - No - Url of the image thumbnail small size 96x96 - **created** (DateTime) - No - Creation date of the image - **createdRFC** (DateTime) - No - Same as created but in format RFC 3339 ```