### Get Products (PHP) Source: https://apidocs.sitejabber.com/index Demonstrates how to fetch product information using PHP. The code sets up the necessary headers with the user token and makes a GET request to the products endpoint, returning an array of product objects. ```php ``` -------------------------------- ### Get Product Reviews using cURL Source: https://apidocs.sitejabber.com/index This snippet demonstrates how to fetch product reviews from the Sitejabber API using a cURL command. It includes the necessary headers for authentication and the API endpoint. ```bash curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" https://api.sitejabber.com/v1/businesses/yourdomain.com/product/reviews?client_token=myapikey ``` -------------------------------- ### Get Business Information from Sitejabber API Source: https://apidocs.sitejabber.com/index This snippet demonstrates how to retrieve detailed information for a specific business using its domain name. It provides examples in cURL and PHP, requiring a user token for authorization and a client token for the request. The response includes business details such as name, ratings, contact information, and address. ```bash curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" "https://api.sitejabber.com/v1/businesses/yourdomain.com?client_token=myapikey" ``` ```php ``` -------------------------------- ### Get Business Reviews using cURL Source: https://apidocs.sitejabber.com/index This snippet demonstrates how to fetch reviews for a business using a cURL command. It requires a user token for authentication and a client token for authorization. The request targets the /v1/businesses/yourdomain.com/reviews endpoint. ```bash curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" "https://api.sitejabber.com/v1/businesses/yourdomain.com/reviews?client_token=myapikey" ``` -------------------------------- ### Get Business Reviews using PHP Source: https://apidocs.sitejabber.com/index This PHP script retrieves business reviews using cURL. It sets up the necessary headers, including the user token, and makes a GET request to the Sitejabber API. The response, containing review data, is then captured. ```php ``` -------------------------------- ### Get Products Source: https://apidocs.sitejabber.com/index Retrieves a list of products associated with a business. This endpoint supports filtering by various parameters such as SKU, brand, price range, and number of reviews. It requires a user token and client token. ```bash curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" https://api.sitejabber.com/v1/businesses/yourdomain.com/products?client_token=myapikey ``` -------------------------------- ### Get Product Reviews using PHP Source: https://apidocs.sitejabber.com/index This PHP script shows how to make an API request to get product reviews from Sitejabber. It utilizes cURL to send the HTTP request with the required authentication headers and returns the JSON response. ```php ``` -------------------------------- ### Get Business Review using PHP Source: https://apidocs.sitejabber.com/index This PHP script shows how to fetch a business review from the Sitejabber API. It sets up the necessary headers and URL, then uses cURL to make the request and retrieve the review data. ```php ``` -------------------------------- ### Get Write Review Link (PHP) Source: https://apidocs.sitejabber.com/index Implements the functionality to get a write review link using PHP cURL. It sets the necessary headers including the user token and makes a GET request to the Sitejabber API. ```php ``` -------------------------------- ### Get Business Info (curl) Source: https://apidocs.sitejabber.com/index This snippet demonstrates how to retrieve information for multiple businesses using the curl command-line tool. It includes the necessary user token for authentication and specifies the businesses to query in a JSON format within the URL. ```curl curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" "https://api.sitejabber.com/v1/businesses/bulk?client_token=myapikey&businesses=%5B%22business1.com%22%2C%22business2.com%22%2C%22business3.com%22%5D" ``` -------------------------------- ### Get Business Review using cURL Source: https://apidocs.sitejabber.com/index This snippet demonstrates how to retrieve a specific business review using a cURL command. It requires a user token for authentication and specifies the business domain and review number in the URL. ```bash curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" "https://api.sitejabber.com/v1/businesses/yourdomain.com/review?client_token=myapikey&review_no=1" ``` -------------------------------- ### Get Top Rated Product Source: https://apidocs.sitejabber.com/index Retrieve a list of top-rated products. You can filter results by category name and currency. If no category is specified, it returns the top-rated product for all categories. Authentication is required. ```curl curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" "https://api.sitejabber.com/v1/businesses/yourdomain.com/product/reviews/top-rated?client_token=myapikey&category_name=Tablets¤cy=CAD" ``` ```php $header = [ 'user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582' ]; $url = 'https://api.sitejabber.com/v1/businesses/yourdomain.com/product/reviews/top-rated?client_token=myapikey&category_name=Tablets¤cy=CAD'; $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); $res = curl_exec($ch); curl_close($ch); ``` -------------------------------- ### Get Business Info (PHP) Source: https://apidocs.sitejabber.com/index This PHP script shows how to fetch business information from the Sitejabber API. It sets up the required headers, including the user token, and constructs the URL with the client token and a JSON-encoded list of businesses. The response is then retrieved using cURL. ```php ``` -------------------------------- ### Authenticate with Sitejabber API Source: https://apidocs.sitejabber.com/index This snippet shows how to authenticate with the Sitejabber API to obtain a user token. It includes examples using cURL and PHP, demonstrating how to send email and password credentials. The authentication process requires a client token and returns a JSON object containing a user token, expiration, and user details. ```bash curl -d "email=myemail&password=mypassword" "https://api.sitejabber.com/v1/login?client_token=myapikey" ``` ```php 'myemail', 'password' => 'mypassword' ]; $url = 'https://api.sitejabber.com/v1/login?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_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); $res = curl_exec($ch); curl_close($ch); ?> ``` -------------------------------- ### Get Messages via PHP Source: https://apidocs.sitejabber.com/index This PHP code snippet shows how to make a GET request to the Sitejabber API to fetch messages. It utilizes cURL to set the request headers, URL, and retrieve the response, which is expected to be a JSON array of messages. ```php ``` -------------------------------- ### Get Write Review Link Source: https://apidocs.sitejabber.com/index Retrieves a link for users to write a review for a specific business. Requires a user token for authentication and a client token for the request. The returned link and hash are valid until the expiration date. ```bash curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" "https://api.sitejabber.com/v1/partners/yourdomain.com/write-link/get?client_token=myapikey" ``` -------------------------------- ### Get Messages via cURL Source: https://apidocs.sitejabber.com/index This snippet demonstrates how to retrieve messages from the Sitejabber API using a cURL command. It includes the necessary headers and URL parameters for authentication and specifying the target business. ```curl curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" "https://api.sitejabber.com/v1/businesses/yourdomain.com/messages?client_token=myapikey&username=user" ``` -------------------------------- ### Get Review Comments Source: https://apidocs.sitejabber.com/index Retrieves comments associated with a specific review. This API call requires user and client tokens and returns an array of comment objects. ```cURL curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" "https://api.sitejabber.com/v1/businesses/yourdomain.com/review/comments?client_token=myapikey" ``` ```PHP ``` -------------------------------- ### Get Edit Review Link Source: https://apidocs.sitejabber.com/index Fetches a link that allows a user to edit their existing review for a given business. This endpoint requires a user token and client token, along with the user's email address. ```bash curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" "https://api.sitejabber.com/v1/partners/yourdomain.com/edit-link/get?client_token=myapikey&email=user@email.com" ``` -------------------------------- ### Get Product Reviews Stats Source: https://apidocs.sitejabber.com/index Fetch statistics for published product reviews, including the total number of reviews and the average rating. Optional query parameters allow filtering stats by SKU, categories, item group, or brand. Authentication is necessary. ```curl curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" https://api.sitejabber.com/v1/businesses/yourdomain.com/product/reviews/stats?client_token=myapikey ``` ```php $header = [ 'user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582' ]; $url = 'https://api.sitejabber.com/v1/businesses/yourdomain.com/product/reviews/stats?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); $res = curl_exec($ch); curl_close($ch); ``` -------------------------------- ### Get Edit Review Link (PHP) Source: https://apidocs.sitejabber.com/index Provides a PHP implementation for obtaining an edit review link. It configures cURL to include the user token in the headers and sends a request to the specified API endpoint with the user's email. ```php ``` -------------------------------- ### Add Product Review using cURL Source: https://apidocs.sitejabber.com/index This snippet demonstrates how to add a product review using a cURL command. It includes authentication with a user token and sends product details and image information via multipart form data. ```bash curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" -F "sku=26" -F "title=playstation" -F "content=very%20good" -F "rating=5" -F "caption1=my%20flowers" -F "caption2=more%20flowers" -F "image1=https://img.server.xyz/image.jpg" -F "image2=@/home/filename.jpg" "https://api.sitejabber.com/v1/businesses/yourdomain.com/product/reviews/add?client_token=myapikey" ``` -------------------------------- ### Create Product Review Request Source: https://apidocs.sitejabber.com/index This snippet demonstrates how to create a product review request using the Sitejabber API. It requires customer details, product SKUs, order information, and authentication tokens. The API can return a link to complete the review or send out emails. ```bash curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" -d "email=test@test.com&product_sku=4457,4458,4459&order_id=XHS2854&order_date=2017-04-28&first_name=John&last_name=Doe" "https://api.sitejabber.com/v1/businesses/yourdomain.com/product/review/request/add?client_token=myapikey" ``` ```php $header = [ 'user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582' ]; $post = [ 'email' => 'test@test.com', 'product_sku' => '4457,4458,4459', 'order_id' => 'XHS2854', 'order_date' => '2017-04-28', 'first_name' => 'John', 'last_name' => 'Doe' ]; $url = 'https://api.sitejabber.com/v1/businesses/yourdomain.com/product/review/request/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($post)); $res = curl_exec($ch); curl_close($ch); ``` -------------------------------- ### Add Product Source: https://apidocs.sitejabber.com/index This endpoint adds a new product to your domain on Sitejabber. It requires product details such as SKU, brand, title, categories, price, and custom attributes. The attributes can be formatted with specific types and options. ```cURL 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 ``` ```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 Review using PHP Source: https://apidocs.sitejabber.com/index This PHP script shows how to add a product review via the Sitejabber API. It utilizes cURL to send a POST request with multipart form data, including product details and image uploads. ```php '26', 'title' => 'playstation', 'content' => 'very good', 'rating' => '5', 'image1' => curl_file_create('/home/filename.jpg', 'image/jpg', 'filename.jpg'), 'caption1' => 'my flowers', 'image2' => 'https://img.server.xyz/image.jpg', 'caption2' => 'more flowers' ]; $url = 'https://api.sitejabber.com/v1/businesses/yourdomain.com/reviews/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); ?> ``` -------------------------------- ### Create Review Request Source: https://apidocs.sitejabber.com/index Creates a new review request for a customer. This function requires customer details like email or phone, order information, and optionally customer name and other parameters. It can return a link to complete the review. ```cURL curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" -d "email=test@test.com&order_id=XHS2854&order_date=2017-04-28&first_name=John&last_name=Doe" "https://api.sitejabber.com/v1/businesses/yourdomain.com/review/request/add?client_token=myapikey" ``` ```PHP $header = [ 'user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582' ]; $post = [ 'email' => 'test@test.com', 'order_id' => 'XHS2854', 'order_date' => '2017-04-28', 'first_name' => 'John', 'last_name' => 'Doe', 'return_link' => 1 ]; $url = 'https://api.sitejabber.com/v1/businesses/yourdomain.com/review/request/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($post)); $res = curl_exec($ch); curl_close($ch); ``` -------------------------------- ### Url Object Schema Source: https://apidocs.sitejabber.com/index Represents business information, including name, URL, address, and associated ratings and reviews. ```json { "name": "String", "urlAddress": "String", "displayAddress": "String", "urlProfilePage": "String", "averageRating": "Array", "numReviews": "Array", "phone": "String (Optional)", "email": "String (Optional)", "address": "Address object" } ``` -------------------------------- ### Flag a Review Source: https://apidocs.sitejabber.com/index Flags a review with a specified reason and an optional message. This action requires user and client tokens, along with the review number. ```cURL curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" -d "review_no=2&reason=personal_info&message=Privacy%20policy%20violation" "https://api.sitejabber.com/v1/businesses/yourdomain.com/reviews/flag?client_token=myapikey" ``` ```PHP '2', 'reason' => 'personal_info', 'message' => 'Privacy policy violation' ]; $url = 'https://api.sitejabber.com/v1/businesses/yourdomain.com/reviews/flag?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($post)); $res = curl_exec($ch); curl_close($ch); ?> ``` -------------------------------- ### User Object Schema Source: https://apidocs.sitejabber.com/index Contains information about a user, including their username, name, and review activity. ```json { "username": "String", "firstName": "String", "lastName": "String", "thumbnail": "String", "profilePage": "String", "numReviews": "Integer", "numHelpfulVotes": "Integer", "email": "String (Optional)" } ``` -------------------------------- ### ReviewImage Object Schema Source: https://apidocs.sitejabber.com/index Contains metadata for images associated with reviews, including captions and URLs for different sizes. ```json { "caption": "String", "original": "String", "normal": "String", "large": "String", "small": "String", "created": "DateTime", "createdRFC": "DateTime" } ``` -------------------------------- ### Add Product Image Source: https://apidocs.sitejabber.com/index This endpoint updates the image URL for an existing product on Sitejabber. It requires the product's SKU and the new image URL as post parameters. ```cURL curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" -d "sku=4770&image=https://xyz.xyz/img/4770.jpg" \ https://api.sitejabber.com/v1/businesses/yourdomain.com/product/images/add?client_token=myapikey ``` ```PHP '4770', 'image' => 'https://xyz.xyz/img/4770.jpg' ]; $url = 'https://api.sitejabber.com/v1/businesses/yourdomain.com/product/images/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, $data); $res = curl_exec($ch); curl_close($ch); ?> ``` -------------------------------- ### Login Object Schema Source: https://apidocs.sitejabber.com/index Defines the structure for user authentication, including a token for identification and expiration time. ```json { "token": "String", "expire": "DateTime", "user": "User object" } ``` -------------------------------- ### Review Object Schema Source: https://apidocs.sitejabber.com/index Represents a customer review, including its content, rating, votes, and associated images. ```json { "reviewNo": "Integer", "rating": "Array", "title": "String", "content": "String", "tip": "String (Optional)", "order_id": "String (Optional)", "images": "ReviewImage (Optional)", "positive_votes": "Integer", "negative_votes": "Integer", "created": "DateTime/String", "createdRFC": "DateTime/String", "published": "DateTime/String", "publishedRFC": "DateTime/String", "edited": "DateTime (Optional)", "editedRFC": "DateTime (Optional)", "removedRFC": "DateTime (Optional)", "updated_for": "Review object (Optional)", "source": "String (Optional)", "datasource": "String (Optional)", "labels": "Array (Optional)", "author": "User object" } ``` -------------------------------- ### Address Object Schema Source: https://apidocs.sitejabber.com/index Details the physical address of a business, including street, city, state, and postal code. ```json { "streetAddress": "String (Optional)", "streetAddress2": "String (Optional)", "city": "String (Optional)", "state": "String (Optional)", "postalCode": "String (Optional)", "country": "String (Optional)", "completeAddress": "String (Optional)" } ``` -------------------------------- ### NumReviews Object Schema Source: https://apidocs.sitejabber.com/index Provides counts for different review categories, such as total reviews or reviews for specific star ratings. ```json { "type": "String", "rating": "Integer" } ``` -------------------------------- ### Send Resolution Message Source: https://apidocs.sitejabber.com/index This snippet demonstrates how to send a resolution message to a user for a specific review using the Sitejabber API. It requires a user token, review number, and the message body. The API endpoint is for sending resolution messages. ```curl curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" -d "review_no=2&body=my%20new%20message" "https://api.sitejabber.com/v1/businesses/yourdomain.com/resolution/send?client_token=myapikey" ``` -------------------------------- ### Rating Object Schema Source: https://apidocs.sitejabber.com/index Defines a specific rating metric for a review, such as overall experience or value. ```json { "type": "String", "rating": "Float" } ``` -------------------------------- ### Add Product Review Vote Source: https://apidocs.sitejabber.com/index This endpoint allows you to cast a vote (positive or negative) on a specific product review. It requires the review ID and the type of vote as post parameters. Authentication is handled via a user token. ```curl curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" -d "review_id=22&vote=positive" https://api.sitejabber.com/v1/businesses/yourdomain.com/product/reviews/vote?client_token=myapikey ``` ```php $header = [ 'user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582' ]; $data = [ 'review_id' => '21', 'vote' => 'positive' ]; $url = 'https://api.sitejabber.com/v1/businesses/yourdomain.com/product/reviews/vote?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); ``` -------------------------------- ### Send Resolution Message (PHP) Source: https://apidocs.sitejabber.com/index This PHP code snippet shows how to send a resolution message to a user via the Sitejabber API. It configures cURL to send a POST request with the necessary headers and POST data, including the user token, review number, and message body. ```php '2', 'body' => 'my new message' ]; $url = 'https://api.sitejabber.com/v1/businesses/yourdomain.com/resolution/send?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($post)); $res = curl_exec($ch); curl_close($ch); ?> ``` -------------------------------- ### Comment Object Schema Source: https://apidocs.sitejabber.com/index Represents a comment on a review, including its content, votes, and activation status. ```json { "reviewNo": "Integer", "content": "String", "num_votes": "Integer", "activated": "Boolean", "created": "DateTime", "createdRFC": "DateTime", "modified": "DateTime" } ``` -------------------------------- ### Send Message to User Source: https://apidocs.sitejabber.com/index Sends a message to a specific user associated with a review. Requires user_token for authentication and specifies the review number, subject, and message body. ```cURL curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" -d "review_no=2&subject=hello&body=my%20new%20message" "https://api.sitejabber.com/v1/businesses/yourdomain.com/message/send?client_token=myapikey" ``` ```PHP $header = [ 'user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582' ]; $post = [ 'review_no' => '2', 'subject' => 'hello', 'body' => 'my new message' ]; $url = 'https://api.sitejabber.com/v1/businesses/yourdomain.com/message/send?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($post)); $res = curl_exec($ch); curl_close($ch); ``` -------------------------------- ### Access Customer Information via Sitejabber API Source: https://apidocs.sitejabber.com/index Retrieves customer privacy information from the Sitejabber API using a user token and email address. Requires a valid user token and the customer's email. The response is a JSON object containing various categories of customer data. ```shell curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" -d "email=john@example.com" "https://api.sitejabber.com/v1/businesses/yourdomain.com/privacy/access?client_token=myapikey&email=john@example.com" ``` ```php $header = [ 'user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582' ]; $url = 'https://api.sitejabber.com/v1/businesses/yourdomain.com/privacy/access?client_token=myapikey&email=john@example.com'; $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); $res = curl_exec($ch); curl_close($ch); ``` -------------------------------- ### Add Comment to Review Source: https://apidocs.sitejabber.com/index This snippet demonstrates how to add a comment to a specific review using the Sitejabber API. It requires a user token, review number, and the comment text. The API endpoint is for adding comments to businesses. ```curl curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" -d "review_no=2&text=my%20new%20comment" "https://api.sitejabber.com/v1/businesses/yourdomain.com/review/comments/add?client_token=myapikey" ``` -------------------------------- ### Remove Product Source: https://apidocs.sitejabber.com/index This endpoint removes a product from your domain on Sitejabber using its unique product ID. It requires the product_id as a post parameter. ```cURL curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" -d "product_id=32" https://api.sitejabber.com/v1/businesses/yourdomain.com/products/remove?client_token=myapikey ``` ```PHP '32' ]; $url = 'https://api.sitejabber.com/v1/businesses/yourdomain.com/products/remove?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, $data); $res = curl_exec($ch); curl_close($ch); ?> ``` -------------------------------- ### Publish Unpublished Review Source: https://apidocs.sitejabber.com/index Publishes a review that was previously unpublished. Requires a user token and client token. The review number is specified in the request body. ```cURL curl -H "user_token: 5922b0ad07f849330de5af5c07fdd27ead7f4582" -d "review_no=2" "https://api.sitejabber.com/v1/businesses/yourdomain.com/reviews/publish?client_token=myapikey" ``` ```PHP '2' ]; $url = 'https://api.sitejabber.com/v1/businesses/yourdomain.com/reviews/publish?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($post)); $res = curl_exec($ch); curl_close($ch); ?> ```