jasonknight / woocommerce-json-api

A simple, Abstract JSON API for Wordpress' Awesome Plugin: WooCommerce
58 stars 21 forks source link

Errors -4 and -7 for proc get_images #27

Closed michaelfranzl closed 11 years ago

michaelfranzl commented 11 years ago

I'm getting this, though other models work:

Raw JSON Request

{
  "action": "woocommerce_json_api",
  "proc": "get_images",
  "arguments": {
    "token": "1234",
    "order_by": "name",
    "order": "ASC"
  }
}

Raw JSON Response

{
  "action": "woocommerce_json_api",
  "proc": "get_images",
  "arguments": {
    "token": "",
    "order_by": "name",
    "order": "ASC"
  },
  "status": false,
  "errors": [
    {
      "text": "Permissions for this user have not been set",
      "code": -7
    },
    {
      "text": "Not a valid API User",
      "code": -4
    }
  ],
  "warnings": [],
  "notifications": [],
  "payload": [],
  "payload_length": 0
}
jasonknight commented 11 years ago

You need to resave the API user. Visit the user edit page, and make sure the permissions for that call are set to what you want, and then save.

michaelfranzl commented 11 years ago

That fixed it.