Review create and update using API

49 views
Skip to first unread message

Amar Shiva

unread,
Feb 22, 2016, 5:08:26 AM2/22/16
to MerchantCircle API
Hi All,

This is Amar, I am very new to this API. I am trying to create & update a review by using an API. But I am unable to do that and I am getting an error like "Missing entity" and "Missing required fields." Here are the sample requests and responses.

URL: https://api.merchantcircle.com/api/v1/branded_profile/review_update?api_key=<API_KEY>&timestamp=1456128101637&signature=<SIGNATURE>

Request:
{
"entity": {
    "review_id": <Review ID>,
    "rating": 3,
    "title": "Pizzas are good Updated.",
    "body": "Good"
    }
}

Response:
{
  "request": {
    "resource": "/api/v1/branded_profile/review_update",
    "rate": {
      "current": 21,
      "allowed": 10000
    },
    "format": "json",
    "expects": [
      "POST"
    ],
    "host": "www.merchantcircle.com",
    "params": {
      "timestamp": "1456128101637",
      "api_key": <API_KEY>,
      "signature": <SIGNATURE>
    },
    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36",
    "query_string": "api_key=<API_KEY>&timestamp=1456128101637&signature=<SIGNATURE>",
    "protocol": "https",
    "ip_address": "183.83.40.17",
    "method": "POST"
  },
  "response": {
    "status": 500,
    "seconds": 0.3834,
    "errors": [
      {
        "msg": "Missing entity",
        "code": 600
      },
      {
        "msg": "Missing required parameter(s).",
        "code": 14
      }
    ]
  }
}

Is it the proper way to send a request.? Can any one please help me on this. I stuck over here.

Note: I am using "Postman"(Rest Client) to test this API.


Thanks & Regards,
Amar.T

Karthik Divi

unread,
Feb 25, 2016, 4:26:01 AM2/25/16
to MerchantCircle API
Entity should be a queryParamater. 

Vsevolod Kulaga

unread,
Mar 11, 2016, 12:15:48 PM3/11/16
to MerchantCircle API
Hello
You need to pass 'entity' as url-encoded parameter in body of POST request.
Here is an example:

import json
import urllib
url = 'https://api.merchantcircle.com/api/v1/branded_profile/review_create?timestamp=1457715674.55&api_key=<API_KEY>&signature=<SIGNATURE>'
entity = {'company_id': <MerchantCircle’s company id>, 'rating': 4, 'email': '<EMAIL>', 'name': '<NAME>', 'title': 'Nice business', 'body': "I like this business\nAnd I'm going to visit them soon"}
entity_json = json.dumps(entity)
parameters = {'entity': entity_json}
f = urllib.urlopen(url, urllib.urlencode(parameters))
response = f.read()
Reply all
Reply to author
Forward
0 new messages