WordPress.org

Forums

JSON API
Feature Request (1 post)

  1. monkeypunch3
    Member
    Posted 1 year ago #

    Have you thought about adding error codes? Currently, if I want to check if someone needs to login or not is to check the error message,

    {"status":"error","error":"You need to login with a user that has 'edit_posts' capacity."}

    But if that terminology changes or needs rewording the application will break. With error codes you could check the error number and know what it's about and display your own message if need be. For example,

    Error Codes
    1000 - This action requires the user to login
    1001 - This user does not have permission for this action.
    1002 - Post does not exist

    http://wordpress.org/plugins/json-api/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • JSON API
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags