User Tools

Site Tools


en:api_solutions:api_product_reviews

API-interface #6: Product Reviews

API-client interface to send XML-requests and receiving XML/JSON response from the server API with a list of negative or positive reviews about the product (by Product ID, or by ID seller)


XML-request (example)

Request URL
https://axefile.com/api/reviews_list/
Method POST
Request Getting results by Seller ID:
<?xml version="1.0" encoding="UTF-8"?>
<request api_version="1.0">
    <merchant_data>
        <merchant>120</merchant>
        <signature>J6NDWTCOPZ2GLD3GGODXIYJESHBUGT13</signature>
    </merchant_data>
    <data>
        <type_reviews>1</type_reviews>
        <seller></seller>
        <good_id>1220</good_id>
        <page>0</page>
        <rows>25</rows>
        <order>desc</order>
        <format>xml</format>
    </data>
</request>

Getting results by Seller ID:

<?xml version="1.0" encoding="UTF-8"?>
<request api_version="1.0">
    <merchant_data>
        <merchant>120</merchant>
        <signature>J6NDWTCOPZ2GLD3GGODXIYJESHBUGT13</signature>
    </merchant_data>
    <data>
        <type_reviews>1</type_reviews>
        <seller>169</seller>
        <good_id></good_id>
        <page>0</page>
        <rows>25</rows>
        <order>desc</order>
        <format>xml</format>
    </data>
</request>

Request parameters

Name Status Description Data Type
merchantrequiredThe unique identifier of the seller (agent), received at registration (you can view My Office) (integer)
signaturerequiredThe signature request is calculated as follows (PHP):
$sign=sha1(md5($merchant.$shop_hash))

where
$merchant - the unique identifier of the seller (agent)
$shop_hash - secret key, which can be obtained here: https://axefile.com/en/partner/referal

(string)
type_reviewsrequiredType of Review: 0/1 (1-positive or 0-negative). (integer)
selleroptional/requiredID seller of goods. This option seller can be used together with the parameter good_id. This parameter is required, provided that there is no option good_id (integer)
good_idoptional/requiredProduct ID. This option good_id can be used together with the parameter seller. This parameter is required, provided that there is no option seller (integer)
pageoptionalThe page number at which to start output results. Default: 0 (integer)
rowsoptionalThe number of entries per page. Default: 25 (integer)
orderoptionalSort by date added. Default: New to Old - DESC (string)
formatoptionalThe format of the response to the request (xml/json). Default: xml (string)

XML response to the request (Example)

<?xml version="1.0" encoding="UTF-8"?>
<response api_version="1.0">
  <reviews cnt="2">
    <review id="0">
      <id>3</id>
      <seller>145</seller>
      <good_id>1220</good_id>
      <body_review>Excellent!</body_review>
      <rate>1</rate>
      <date>1435491730</date>
    </review>
    <review id="1">
      <id>2</id>
      <user_id>145</user_id>
      <good_id>1220</good_id>
      <body_review>Everything works fine! My Respect to seller!</body_review>
      <rate>1</rate>
      <date>1435491352</date>
    </review>
  </reviews>
  <cnt_reviews>0</cnt_reviews>
  <status status_descr="Successful sending a response from the API-server">success</status>
</response>

JSON response to the request (Example)

//The answer comes to JSON format, but we have to render its conclusions in the form of a data array (PHP):
print_r(json_decode($json_data, TRUE);)
Array
(
    [reviews] => Array
        (
            [0] => Array
                (
                    [id] => 2
                    [seller] => 145
                    [good_id] => 1220
                    [body_review] => Everything works fine! My Respect to seller!
                    [rate] => 1
                    [date] => 1435494575
                )
 
            [1] => Array
                (
                    [id] => 3
                    [seller] => 145
                    [good_id] => 1220
                    [body_review] => Excellent!
                    [rate] => 1
                    [date] => 1435491730
                )
 
        )
 
    [cnt_reviews] => 0
    [status] => success
    [status_descr] => Successful sending a response from the API-server
)

Response parameters (XML/JSON)

Name Description Data Type
reviews/ Product Reviews. Attribute cnt - the total number of buyer reviews
reviews/review/ Reviews of commodity output in the cycle. Attribute id - serial number
reviews/review/idReview ID(integer)
reviews/review/sellerSeller ID (integer)
reviews/review/good_idProduct ID (integer)
reviews/review/dateReview Date format *unix time stamp (integer)
reviews/review/body_reviewReview text (text)
reviews/review/rateType Review (1-positive or 0-negative) (integer)
cnt_reviewsNumber of reviews (integer)
status (XML)The status of the response from the API server: success - successfully completed, error - error. For a more complete understanding of the tag is transferred XML-Attribute @status_descr - status description (string)
status (JSON)The status of the response from the API server: success - successfully completed, error - error. (string)
status_descr (JSON)Description of the status of the response from the API server. (string)

To obtain and use API-solutions you need to log in using the login form for partners / sellers to get seretny key. If you are not registered as a partner, you can do it right now: go to the registration.

en/api_solutions/api_product_reviews.txt · Last modified: 2015/09/26 10:45 by root